mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-28 05:40:34 +05:00
mesh refinement from nglib
This commit is contained in:
parent
f4bfd278c3
commit
dfebc96d49
8486
nglib/hinge.stl
Normal file
8486
nglib/hinge.stl
Normal file
File diff suppressed because it is too large
Load Diff
@ -112,5 +112,17 @@ int main (int argc, char ** argv)
|
|||||||
cout << "Saving Mesh in VOL Format...." << endl;
|
cout << "Saving Mesh in VOL Format...." << endl;
|
||||||
Ng_SaveMesh(mesh,"test.vol");
|
Ng_SaveMesh(mesh,"test.vol");
|
||||||
|
|
||||||
|
|
||||||
|
// refinement without geomety adaption:
|
||||||
|
// Ng_Uniform_Refinement (mesh);
|
||||||
|
|
||||||
|
// refinement with geomety adaption:
|
||||||
|
Ng_STL_Uniform_Refinement (stl_geom, mesh);
|
||||||
|
|
||||||
|
cout << "elements after refinement: " << Ng_GetNE(mesh) << endl;
|
||||||
|
cout << "points after refinement: " << Ng_GetNP(mesh) << endl;
|
||||||
|
|
||||||
|
Ng_SaveMesh(mesh,"test_ref.vol");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -887,11 +887,52 @@ namespace nglib
|
|||||||
optsteps_3d = 3;
|
optsteps_3d = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
DLL_HEADER void Ng_Uniform_Refinement (Ng_Mesh * mesh)
|
||||||
|
{
|
||||||
|
Refinement ref;
|
||||||
|
ref.Refine ( * (Mesh*) mesh );
|
||||||
|
}
|
||||||
|
|
||||||
|
DLL_HEADER void Ng_2D_Uniform_Refinement (Ng_Geometry_2D * geom,
|
||||||
|
Ng_Mesh * mesh)
|
||||||
|
{
|
||||||
|
( (SplineGeometry2d*)geom ) -> GetRefinement().Refine ( * (Mesh*) mesh );
|
||||||
|
}
|
||||||
|
|
||||||
|
DLL_HEADER void Ng_STL_Uniform_Refinement (Ng_STL_Geometry * geom,
|
||||||
|
Ng_Mesh * mesh)
|
||||||
|
{
|
||||||
|
( (STLGeometry*)geom ) -> GetRefinement().Refine ( * (Mesh*) mesh );
|
||||||
|
}
|
||||||
|
|
||||||
|
DLL_HEADER void Ng_CSG_Uniform_Refinement (Ng_CSG_Geometry * geom,
|
||||||
|
Ng_Mesh * mesh)
|
||||||
|
{
|
||||||
|
( (CSGeometry*)geom ) -> GetRefinement().Refine ( * (Mesh*) mesh );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // End of namespace nglib
|
} // End of namespace nglib
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// compatibility functions:
|
// compatibility functions:
|
||||||
|
|
||||||
namespace netgen
|
namespace netgen
|
||||||
|
@ -631,4 +631,32 @@ DLL_HEADER Ng_Result Ng_OCC_GetFMap(Ng_OCC_Geometry * geom,
|
|||||||
|
|
||||||
#endif // OCCGEOMETRY
|
#endif // OCCGEOMETRY
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// **********************************************************
|
||||||
|
// ** Mesh refinement algorithms **
|
||||||
|
// **********************************************************
|
||||||
|
|
||||||
|
|
||||||
|
// uniform mesh refinement
|
||||||
|
DLL_HEADER void Ng_Uniform_Refinement (Ng_Mesh * mesh);
|
||||||
|
|
||||||
|
|
||||||
|
// uniform mesh refinement with geometry adaption:
|
||||||
|
|
||||||
|
DLL_HEADER void Ng_2D_Uniform_Refinement (Ng_Geometry_2D * geom,
|
||||||
|
Ng_Mesh * mesh);
|
||||||
|
|
||||||
|
DLL_HEADER void Ng_STL_Uniform_Refinement (Ng_STL_Geometry * geom,
|
||||||
|
Ng_Mesh * mesh);
|
||||||
|
|
||||||
|
DLL_HEADER void Ng_CSG_Uniform_Refinement (Ng_CSG_Geometry * geom,
|
||||||
|
Ng_Mesh * mesh);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif // NGLIB
|
#endif // NGLIB
|
||||||
|
Loading…
Reference in New Issue
Block a user