10 #ifndef MESHADAPT_CURVEMESH_H_
11 #define MESHADAPT_CURVEMESH_H_
14 #include "FMDBInternals.h"
15 #include "FMDB_cint.h"
16 #include "AdaptUtil.h"
18 #include "MeshAdapt.h"
30 class regionCollapsMod;
55 curveMesh(pMeshMdl mesh_instance,
int sizefield_type,
int model_type);
62 int CMA_SetModelType(
int iTheMdlType);
64 int CMA_CheckMeshQuality();
65 int CMA_LockSurfaceMesh();
69 int CMA_CreateHOEdges();
71 int CMA_UncurveInvalidRgns();
72 int CMA_SetCrvMeshQualityThreshold(
double dThreshold);
114 double CMA_AverageEdgeLengthOnGBdry();
115 double CMA_AverageEdgeLengthOnGEdge();
116 double CMA_InterpErrorOnGEdge();
134 rEdShpInfo * FindBestReShapeEdge(std::vector<rEdShpInfo*> &);
137 int create_mesh_shape_field();
138 int destroy_mesh_shape_field();
140 int create_edge_nodes_from_shape_field();
145 NullSField * pNullSF_;
146 evalResults * pResults_;
147 MeanRatio * pShpMeasure_;
150 double dShapeThresh_;
154 std::map<pRegion, crShpInfo*> invalidCurvedRgns;
155 pPList _invalidRgnPList;
158 pMeshDataId fixedEnt_;
159 pMeshDataId _onPartBdry;
166 void createInvalidRgns(
double);
167 void invalidRgnsInfo();
169 int findBestMod(pRegion, crShpInfo *, pMeshMod *);
170 int findEdgeReShape(pRegion, crShpInfo *, pMeshMod *);
176 void ImproveRgnsByMods();
177 void applyGlobalNodalSmoothing();
178 void outPutOpsInfo();
180 int isEdgeSplitModValid(edgeSplitMod *, pRegion,
int &,
double&);
181 int isDsplitClpsModValid(DSplitClpsMod *,pRegion,
double &);
182 int isEdgeClpsModValid(edgeCollapsMod *, pRegion,
double &);
183 int isFaceSwpModValid(faceSwapMod *, pRegion,
double &);
184 int isEdgeSwpModValid(edgeSwapMod *, pRegion,
double &);
185 int isEdgeSplitClpsModValid(EsplitClpsMod *, pRegion,
double &);
186 int isRegionClpsModValid(regionCollapsMod *, pRegion,
double &);
187 int isVertexMotionModValid(vertMotionsMod *, pRegion,
double &);
188 int isDsplitClpsLooseModValid(pRegion, pMeshMod *);
189 int isUnCurvedModValid(pRegion, crShpInfo *, pPList *);
190 void updateNewReg(pPList *);
191 void applyBestMod(pMeshMod *);
194 int isExplicitHONSmoothingValid(vertMotionsMod *, pRegion, crShpInfo *,
double &);
196 int isExplicitNodalSmoothingValid(pRegion region, crShpInfo *, pEdge *targetEdge);
198 int minDetJAmgVertices(crShpInfo *,
int *edgeID,
int *);
200 int computeMiddlePtTarget(pRegion,
int, pEdge);
208 void unCurveInvalidRgns();
209 void createInvalidRgnList(pPList &);
211 void fix_entity(pEntity);
216 template<
class OPERATION>
219 template<
class OPERATION>
220 int traverse_mesh_faces_to_run();
222 template<
class OPERATION>
223 int traverse_mesh_rgns_to_run();
239 void call_smoothing_procedure() {
242 virtual bool v_use_crv_adapt() {
257 template<
class OPERATION>
262 PUMI_Mesh_GetPart(pMeshInst, 0, pumi_part);
264 pPartEntIter pedge_iter;
267 int ient_end = PUMI_PartEntIter_Init(pumi_part, PUMI_EDGE, PUMI_ALLTOPO, pedge_iter);
271 ient_end = PUMI_PartEntIter_GetNext(pedge_iter, pcrnt_edge);
275 OPERATION * edge_op =
new OPERATION(pcrnt_edge);
281 PUMI_PartEntIter_Del(pedge_iter);
287 template<
class OPERATION>
288 int curveMesh::traverse_mesh_faces_to_run()
292 PUMI_Mesh_GetPart(pMeshInst, 0, pumi_part);
294 pPartEntIter pface_iter;
297 int ient_end = PUMI_PartEntIter_Init(pumi_part, PUMI_FACE, PUMI_ALLTOPO, pface_iter);
301 ient_end = PUMI_PartEntIter_GetNext(pface_iter, pcrnt_face);
305 OPERATION * face_op =
new OPERATION(pcrnt_face);
311 PUMI_PartEntIter_Del(pface_iter);
317 template<
class OPERATION>
318 int curveMesh::traverse_mesh_rgns_to_run()
322 PUMI_Mesh_GetPart(pMeshInst, 0, pumi_part);
324 pPartEntIter prgn_iter;
327 int ient_end = PUMI_PartEntIter_Init(pumi_part, PUMI_REGION, PUMI_ALLTOPO, prgn_iter);
331 ient_end = PUMI_PartEntIter_GetNext(prgn_iter, pcrnt_rgn);
335 OPERATION * rgn_op =
new OPERATION(pcrnt_rgn);
341 PUMI_PartEntIter_Del(prgn_iter);
347 #endif//MESHADAPT_CURVEMESH_H_
This class is design to represent the 3D high-order curved tetrahedron element. The data member shoul...
Definition: CrvTet.h:23
curveMesh(pMeshMdl mesh_instance, int sizefield_type, int model_type)
ctor
Definition: CrvMeshInternal.cc:666
pField m_mesh_shape_field_
pointer to mesh shape field data
Definition: curveMesh.h:130
bool is_g1()
determine if the mesh has already been curved to G1
Definition: CrvMeshInternal.cc:2437
int traverse_mesh_edges_to_run()
whether the input mesh entity has been fixed
Definition: curveMesh.h:258
bool hasCad()
returns if a CAD model is loaded for the curved mesh
Definition: CrvMesh.cc:898
std::vector< CrvTet * > m_crv_tets
container for curved tets
Definition: curveMesh.h:246
static curveMesh * m_crv_mesh_inst
static member viariable for the curve mesh object itself
Definition: curveMesh.h:124
int CMA_Optimize()
optimize a given valid curved mesh
Definition: CrvMesh.cc:409
virtual ~curveMesh()
destructor
Definition: CrvMeshInternal.cc:704
apf::Mesh * m_apf_mesh
pointer to apf mesh object
Definition: curveMesh.h:126
void set_g1()
flag the mesh as having been curved to G1
Definition: CrvMeshInternal.cc:2455
int CMA_CreateG1Mesh()
Create a curved mesh with G1 surface mesh.
Definition: CrvMesh.cc:667
double m_max_angle_
the maximum allowed angle in the surface mesh
Definition: curveMesh.h:143
std::vector< CrvFace * > m_crv_faces
container for curved tris
Definition: curveMesh.h:249
base class for curved edge curve edge provides basic evaluation based on barycentric coordinate syste...
Definition: CrvEdge.h:28
int CMA_GlobPtn()
This function calls pumi mesh global partition API.
Definition: CrvMesh.cc:656
int CMA_CreateC0Mesh(int iEdgeOrder, int iFaceOrder)
Create arbitrary degree C0 interpolating surface mesh.
Definition: CrvMesh.cc:764
int CMA_NumVertsOnGEdge()
number of vertices on model verts and edges
Definition: CrvMesh.cc:49
void fixInvalidRgnsByMods()
return the region with lowest straight-side shape quality Qs
Definition: CrvMeshInternal.cc:942
int CMA_Untangle()
untangle a given curved mesh with a number of invalid elements
Definition: CrvMesh.cc:503
int CMA_CreateG1MeshFromAnalyticModel()
Create a curved mesh with G1 surface mesh of analytic boundary.
static curveMesh * instance()
static member function to get the pointer to the curveMesh object
Definition: curveMesh.h:45
int CMA_TagDrivenUniformRefine()
run tag-driven uniform refinement
Definition: CrvMesh.cc:647
abstract class representing curved mesh face
Definition: CrvFace.h:32
int CMA_NumVertsOnGBdry()
number of vertices on model boundary include model verts, edges and faces
Definition: CrvMesh.cc:37
The main driver class for curved mesh adaptation procedures.
Definition: curveMesh.h:41
pField m_vertex_normal_field_
pointer to vertex normal field
Definition: curveMesh.h:132
apf::MeshTag * m_geom_order
pointer to apf mesh tag for geometric order
Definition: curveMesh.h:128
void outPutEdgeVtxClassify(pRegion region)
output the classification info of the six edges
Definition: CrvMeshInternal.cc:558
int CMA_CreateD4C0Mesh()
Create degree 4 C0 interpolating surface mesh.
Definition: CrvMesh.cc:759
int CMA_Linearize()
Make all mesh entities linear by removing edge nodes if there is any.
Definition: CrvMesh.cc:61
std::vector< CrvEdge * > m_crv_edges
container for curved edges
Definition: curveMesh.h:252