63 int nLayers =
m_config[
"layers"].as<
int>();
69 "Extrude should only be called for a two dimensional mesh");
76 vector<ElementSharedPtr> el =
m_mesh->m_element[2];
79 for (
int d = 0; d <= 3; ++d)
81 m_mesh->m_element[d].clear();
86 map<int, NodeSharedPtr> id2node;
89 for (it = nodes.begin(); it != nodes.end(); ++it)
91 id2node[(*it)->m_id] = *it;
95 for (
int i = 1; i < nLayers + 1; ++i)
97 for (it = nodes.begin(); it != nodes.end(); ++it)
101 new Node(i * nodes.size() + n->m_id, n->m_x, n->m_y, i * dz));
102 m_mesh->m_vertexSet.insert(newNode);
103 id2node[i * nodes.size() + n->m_id] = newNode;
109 for (
int j = 0; j < nLayers; ++j)
111 for (
int i = 0; i < el.size(); ++i)
113 vector<NodeSharedPtr> verts = el[i]->GetVertexList();
114 if (verts.size() == 4)
116 vector<NodeSharedPtr> nodeList(8);
117 nodeList[0] = id2node[verts[0]->m_id + j * nodes.size()];
118 nodeList[1] = id2node[verts[1]->m_id + j * nodes.size()];
119 nodeList[2] = id2node[verts[1]->m_id + (j + 1) * nodes.size()];
120 nodeList[3] = id2node[verts[0]->m_id + (j + 1) * nodes.size()];
121 nodeList[4] = id2node[verts[3]->m_id + j * nodes.size()];
122 nodeList[5] = id2node[verts[2]->m_id + j * nodes.size()];
123 nodeList[6] = id2node[verts[2]->m_id + (j + 1) * nodes.size()];
124 nodeList[7] = id2node[verts[3]->m_id + (j + 1) * nodes.size()];
133 m_mesh->m_element[3].push_back(E);
137 vector<NodeSharedPtr> nodeList(6);
138 nodeList[0] = id2node[verts[0]->m_id + (j + 1) * nodes.size()];
139 nodeList[1] = id2node[verts[1]->m_id + (j + 1) * nodes.size()];
140 nodeList[2] = id2node[verts[1]->m_id + j * nodes.size()];
141 nodeList[3] = id2node[verts[0]->m_id + j * nodes.size()];
142 nodeList[4] = id2node[verts[2]->m_id + (j + 1) * nodes.size()];
143 nodeList[5] = id2node[verts[2]->m_id + j * nodes.size()];
152 m_mesh->m_element[3].push_back(E);
163 for (eit = es.begin(); eit != es.end(); eit++)
165 if ((*eit)->m_edgeNodes.size() > 0)
167 for (
int j = 0; j < nLayers + 1; ++j)
169 vector<NodeSharedPtr> ns((*eit)->m_edgeNodes.size());
170 for (
int i = 0; i < ns.size(); i++)
173 ns[i] = boost::shared_ptr<Node>(
174 new Node(0, n->m_x, n->m_y, j * dz));
178 new Edge(id2node[(*eit)->m_n1->m_id + j * nodes.size()],
179 id2node[(*eit)->m_n2->m_id + j * nodes.size()]));
184 if ((*f)->m_n1 == e->m_n1)
186 (*f)->m_edgeNodes = ns;
190 reverse(ns.begin(), ns.end());
191 (*f)->m_edgeNodes = ns;
#define ASSERTL0(condition, msg)
Basic information about an element.
tBaseSharedPtr CreateInstance(tKey idKey BOOST_PP_COMMA_IF(MAX_PARAM) BOOST_PP_ENUM_BINARY_PARAMS(MAX_PARAM, tParam, x))
Create an instance of the class referred to by idKey.
Represents an edge which joins two points.
pair< ModuleType, string > ModuleKey
MeshSharedPtr m_mesh
Mesh object.
ElementFactory & GetElementFactory()
boost::unordered_set< NodeSharedPtr, NodeHash > NodeSet
virtual ~ProcessExtrude()
virtual NEKMESHUTILS_EXPORT void ProcessFaces(bool ReprocessFaces=true)
Extract element faces.
virtual NEKMESHUTILS_EXPORT void ProcessElements()
Generate element IDs.
Represents a command-line configuration option.
boost::shared_ptr< Node > NodeSharedPtr
std::map< std::string, ConfigOption > m_config
List of configuration values.
boost::shared_ptr< Edge > EdgeSharedPtr
Shared pointer to an edge.
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
boost::shared_ptr< Mesh > MeshSharedPtr
Shared pointer to a mesh.
Abstract base class for processing modules.
virtual NEKMESHUTILS_EXPORT void ProcessEdges(bool ReprocessEdges=true)
Extract element edges.
boost::shared_ptr< Element > ElementSharedPtr
boost::unordered_set< EdgeSharedPtr, EdgeHash > EdgeSet
std::pair< ModuleType, std::string > ModuleKey
virtual NEKMESHUTILS_EXPORT void ProcessComposites()
Generate composites.
ModuleFactory & GetModuleFactory()
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.