1/**
2 * MOAB, a Mesh-Oriented datABase, is a software component for creating,
3 * storing and accessing finite element mesh data.
4 *
5 * Copyright 2004 Sandia Corporation. Under the terms of Contract
6 * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government
7 * retains certain rights in this software.
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
13 *
14 */1516#ifndef MOAB_HIGHER_ORDER_FACTORY_HPP17#define MOAB_HIGHER_ORDER_FACTORY_HPP1819#ifndef IS_BUILDING_MB20#error"HigherOrderFactory.hpp isn't supposed to be included into an application"21#endif2223#include"moab/Interface.hpp"2425namespace moab
26 {
2728classElementSequence;
29classCore;
3031/** \class HigherOrderFactory
32 * \brief Functions for converting to/from higher-order elements
33 * \authors Clinton Stimpson
34 * \date 11/25/02
35 * \brief
36 *
37 */38classHigherOrderFactory39 {
40public:
41HigherOrderFactory( Core*, Interface::HONodeAddedRemoved* function_object );
42 ~HigherOrderFactory();
4344ErrorCode convert( const EntityHandle meshset,
45constbool mid_edge_nodes,
46constbool mid_face_nodes,
47constbool mid_volume_nodes );
4849ErrorCode convert( const Range& entities,
50constbool mid_edge_nodes,
51constbool mid_face_nodes,
52constbool mid_volume_nodes );
5354unsignedchar mNodeMap[MBMAXTYPE][8][8];
5556private:
57// static bool mMapInitialized;58voidinitialize_map();
5960 Core* mMB;
61 Interface::HONodeAddedRemoved* mHONodeAddedRemoved;
6263ErrorCode convert_sequence( ElementSequence* sequence,
64 EntityHandle sequence_subset_start,
65 EntityHandle sequence_subset_end,
66bool mid_edge_nodes,
67bool mid_face_nodes,
68bool mid_volume_nodes );
69ErrorCode add_mid_edge_nodes( ElementSequence* );
70ErrorCode add_mid_face_nodes( ElementSequence* );
71ErrorCode add_mid_volume_nodes( ElementSequence* );
7273//! returns the handle of the first center node found between the two corner nodes.74//! returns zero if none found75//! entities that share those two corner nodes and have space allocated for mid-edge nodes are76//! returned in a vector77EntityHandle center_node_exist( EntityHandle corner1,
78 EntityHandle corner2,
79 std::vector< EntityHandle >& adj_entities );
8081//! returns the handle of the first center node found between the 3-4 corner nodes.82//! set the last node to zero if you want only 3 nodes83//! returns zero if none found84//! entities that share those corner nodes and have space allocated for mid face nodes are85//! returned in a vector86EntityHandle center_node_exist( EntityHandle corners[4], std::vector< EntityHandle >& adj_entities );
8788//! adds a center node to element between corner nodes, returns success89booladd_center_node( EntityType type,
90 EntityHandle* element_conn,
91int conn_size,
92 EntityHandle corner_node1,
93 EntityHandle corner_node2,
94 EntityHandle center_node );
9596ErrorCode copy_corner_nodes( ElementSequence* src, ElementSequence* dst );
97ErrorCode copy_mid_edge_nodes( ElementSequence* src, ElementSequence* dst );
98ErrorCode copy_mid_face_nodes( ElementSequence* src, ElementSequence* dst );
99ErrorCode copy_mid_volume_nodes( ElementSequence* src, ElementSequence* dst );
100ErrorCode copy_nodes( ElementSequence* src,
101 ElementSequence* dst,
102unsigned nodes_per_elem_to_copy,
103unsigned src_conn_offset,
104unsigned dst_conn_offset );
105106ErrorCode zero_mid_edge_nodes( ElementSequence* dst );
107ErrorCode zero_mid_face_nodes( ElementSequence* dst );
108ErrorCode zero_mid_volume_nodes( ElementSequence* dst );
109ErrorCode zero_nodes( ElementSequence* dst, unsigned nodes_per_elem_to_zero, unsigned dst_conn_offset );
110111ErrorCode remove_mid_edge_nodes( ElementSequence* seq, EntityHandle start, EntityHandle stop, Tag deletable_ndoes );
112ErrorCode remove_mid_face_nodes( ElementSequence* seq, EntityHandle start, EntityHandle stop, Tag deletable_ndoes );
113ErrorCode remove_mid_volume_nodes( ElementSequence* seq,
114 EntityHandle start,
115 EntityHandle stop,
116 Tag deletable_ndoes );
117ErrorCode remove_ho_nodes( ElementSequence* sequence,
118 EntityHandle subset_start_handle,
119 EntityHandle subset_end_handle,
120int nodes_per_elem_to_remove,
121int elem_conn_offset_to_remove,
122 Tag deletable_nodes );
123booltag_for_deletion( EntityHandle element_with_node,
124int node_index_in_elem_connectivity,
125 ElementSequence* sequence );
126 };
127128 } // namespace moab129130#endif