36 #include "../MeshElements.h"
52 "Process elements based on values of Jacobian.");
57 true,
"0",
"Extract non-valid elements from mesh.");
59 true,
"0",
"remove curve nodes if element is singular.");
61 true,
"0",
"Print list of elements having negative Jacobian.");
73 cout <<
"ProcessJac: Calculating Jacobians... " << endl;
76 bool extract =
m_config[
"extract"].as<
bool>();
77 bool printList =
m_config[
"list"].as<
bool>();
78 bool RemoveCurveIfSingular =
m_config[
"removecurveifsingular"].as<
bool>();
79 vector<ElementSharedPtr> el =
m_mesh->m_element[
m_mesh->m_expDim];
88 cout <<
"Elements with negative Jacobian:" << endl;
94 for (
int i = 0; i < el.size(); ++i)
98 el[i]->GetGeom(
m_mesh->m_spaceDim);
102 geom->GetGeomFactors();
106 if (!gfac->IsValid())
112 cout <<
" - " << el[i]->GetId() <<
" ("
117 if(RemoveCurveIfSingular)
119 int nSurf = el[i]->GetFaceCount();
123 for(
int e = 0; e < el[i]->GetEdgeCount(); ++e)
128 if((it =
m_mesh->m_edgeSet.find(ed)) !=
m_mesh->m_edgeSet.end())
130 if((*it)->m_edgeNodes.size())
132 vector<NodeSharedPtr> zeroNodes;
133 (*it)->m_edgeNodes = zeroNodes;
157 if (printList ||
m_mesh->m_verbose)
159 cout <<
"Total negative Jacobians: " << nNeg << endl;
163 cout <<
"WARNING: Detected " << nNeg <<
" element"
164 << (nNeg == 1 ?
"" :
"s") <<
" with negative Jacobian."
virtual void Process()
Write mesh to output file.
pair< ModuleType, string > ModuleKey
boost::shared_ptr< Edge > EdgeSharedPtr
Shared pointer to an edge.
map< string, ConfigOption > m_config
List of configuration values.
MeshSharedPtr m_mesh
Mesh object.
virtual void ProcessEdges(bool ReprocessEdges=true)
Extract element edges.
virtual void ProcessVertices()
Extract element vertices.
virtual void ProcessElements()
Generate element IDs.
boost::shared_ptr< Mesh > MeshSharedPtr
Shared pointer to a mesh.
virtual void ProcessComposites()
Generate composites.
const char *const ElementTypeMap[]
Represents a command-line configuration option.
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
boost::shared_ptr< GeomFactors > GeomFactorsSharedPtr
Pointer to a GeomFactors object.
virtual void ProcessFaces(bool ReprocessFaces=true)
Extract element faces.
boost::shared_ptr< Geometry > GeometrySharedPtr
ModuleFactory & GetModuleFactory()
Abstract base class for processing modules.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.