50 "Process elements based on values of Jacobian.");
55 ConfigOption(
false,
"0.0",
"Extract non-valid elements from mesh.");
57 false,
"0",
"Print list of elements having negative Jacobian.");
68 cout <<
"ProcessJac: Calculating Jacobians... " << endl;
72 bool printList =
m_config[
"list"].as<
bool>();
75 vector<ElementSharedPtr> el =
m_mesh->m_element[
m_mesh->m_expDim];
84 cout <<
"Elements with negative Jacobian:" << endl;
92 for (
int i = 0; i < el.size(); ++i)
96 el[i]->GetGeom(
m_mesh->m_spaceDim);
103 const int pts = deriv[0][0].num_elements();
105 for (
int k = 0; k < pts; ++k)
109 for (
int l = 0; l <
m_mesh->m_expDim; ++l)
111 for (
int j = 0; j <
m_mesh->m_expDim; ++j)
113 jac(j,l) = deriv[l][j][k];
119 jc[k] = jac(0,0) * jac(1,1) - jac(0,1)*jac(1,0);
121 else if(
m_mesh->m_expDim == 3)
123 jc[k] = jac(0,0) * (jac(1,1)*jac(2,2) - jac(2,1)*jac(1,2)) -
124 jac(0,1) * (jac(1,0)*jac(2,2) - jac(2,0)*jac(1,2)) +
125 jac(0,2) * (jac(1,0)*jac(2,1) - jac(2,0)*jac(1,1));
132 bool valid = gfac->IsValid();
134 if (extract && (scaledJac < thres || !valid))
147 cout <<
" - " << el[i]->GetId() <<
" ("
165 if (printList ||
m_mesh->m_verbose)
167 cout <<
"Total negative Jacobians: " << nNeg << endl;
171 cout <<
"WARNING: Detected " << nNeg <<
" element"
172 << (nNeg == 1 ?
"" :
"s") <<
" with negative Jacobian." << endl;
std::vector< PointsKey > PointsKeyVector
virtual void Process()
Write mesh to output file.
T Vmax(int n, const T *x, const int incx)
Return the maximum element in x – called vmax to avoid conflict with max.
T Vmin(int n, const T *x, const int incx)
Return the minimum element in x - called vmin to avoid conflict with min.
pair< ModuleType, string > ModuleKey
MeshSharedPtr m_mesh
Mesh object.
const char *const ShapeTypeMap[]
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.
std::map< std::string, ConfigOption > m_config
List of configuration values.
boost::shared_ptr< Mesh > MeshSharedPtr
Shared pointer to a mesh.
Abstract base class for processing modules.
boost::shared_ptr< GeomFactors > GeomFactorsSharedPtr
Pointer to a GeomFactors object.
virtual NEKMESHUTILS_EXPORT void ProcessVertices()
Extract element vertices.
virtual NEKMESHUTILS_EXPORT void ProcessEdges(bool ReprocessEdges=true)
Extract element edges.
std::pair< ModuleType, std::string > ModuleKey
boost::shared_ptr< Geometry > GeometrySharedPtr
virtual NEKMESHUTILS_EXPORT void ProcessComposites()
Generate composites.
ModuleFactory & GetModuleFactory()
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.