mesh refinement from nglib

This commit is contained in:
Joachim Schoeberl 2009-11-01 11:49:20 +00:00
parent f4bfd278c3
commit dfebc96d49
4 changed files with 8567 additions and 0 deletions

8486
nglib/hinge.stl Normal file

File diff suppressed because it is too large Load Diff

View File

@ -112,5 +112,17 @@ int main (int argc, char ** argv)
cout << "Saving Mesh in VOL Format...." << endl;
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;
}

View File

@ -887,11 +887,52 @@ namespace nglib
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
// compatibility functions:
namespace netgen

View File

@ -631,4 +631,32 @@ DLL_HEADER Ng_Result Ng_OCC_GetFMap(Ng_OCC_Geometry * geom,
#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