extern int OCCGenerateMesh (OCCGeometry&, Mesh*&, MeshingParameters&, int, int);
#else
extern int OCCGenerateMesh (OCCGeometry&, Mesh*&, int, int, char*);
+#endif
+#if defined(NETGEN_V5) && defined(WIN32)
+ DLL_HEADER
#endif
extern MeshingParameters mparam;
extern void OCCSetLocalMeshSize(OCCGeometry & geom, Mesh & mesh);
//=============================================================================
NETGENPlugin_NETGEN_2D_ONLY::NETGENPlugin_NETGEN_2D_ONLY(int hypId,
- int studyId,
SMESH_Gen* gen)
- : SMESH_2D_Algo(hypId, studyId, gen)
+ : SMESH_2D_Algo(hypId, gen)
{
_name = "NETGEN_2D_ONLY";
NETGENPlugin_NETGEN_2D_ONLY::~NETGENPlugin_NETGEN_2D_ONLY()
{
- MESSAGE("NETGENPlugin_NETGEN_2D_ONLY::~NETGENPlugin_NETGEN_2D_ONLY");
+ //MESSAGE("NETGENPlugin_NETGEN_2D_ONLY::~NETGENPlugin_NETGEN_2D_ONLY");
}
//=============================================================================
return ( aStatus == HYP_OK );
}
-namespace
-{
- void limitSize( netgen::Mesh* ngMesh,
- const double maxh )
- {
- // get bnd box
- netgen::Point3d pmin, pmax;
- ngMesh->GetBox( pmin, pmax, 0 );
- const double dx = pmax.X() - pmin.X();
- const double dy = pmax.Y() - pmin.Y();
- const double dz = pmax.Z() - pmin.Z();
-
- const int nbX = Max( 2, int( dx / maxh * 3 ));
- const int nbY = Max( 2, int( dy / maxh * 3 ));
- const int nbZ = Max( 2, int( dz / maxh * 3 ));
-
- if ( ! & ngMesh->LocalHFunction() )
- ngMesh->SetLocalH( pmin, pmax, 0.1 );
-
- netgen::Point3d p;
- for ( int i = 0; i <= nbX; ++i )
- {
- p.X() = pmin.X() + i * dx / nbX;
- for ( int j = 0; j <= nbY; ++j )
- {
- p.Y() = pmin.Y() + j * dy / nbY;
- for ( int k = 0; k <= nbZ; ++k )
- {
- p.Z() = pmin.Z() + k * dz / nbZ;
- ngMesh->RestrictLocalH( p, maxh );
- }
- }
- }
- }
-}
+// namespace
+// {
+// void limitSize( netgen::Mesh* ngMesh,
+// const double maxh )
+// {
+// // get bnd box
+// netgen::Point3d pmin, pmax;
+// ngMesh->GetBox( pmin, pmax, 0 );
+// const double dx = pmax.X() - pmin.X();
+// const double dy = pmax.Y() - pmin.Y();
+// const double dz = pmax.Z() - pmin.Z();
+
+// const int nbX = Max( 2, int( dx / maxh * 3 ));
+// const int nbY = Max( 2, int( dy / maxh * 3 ));
+// const int nbZ = Max( 2, int( dz / maxh * 3 ));
+
+// if ( ! & ngMesh->LocalHFunction() )
+// ngMesh->SetLocalH( pmin, pmax, 0.1 );
+
+// netgen::Point3d p;
+// for ( int i = 0; i <= nbX; ++i )
+// {
+// p.X() = pmin.X() + i * dx / nbX;
+// for ( int j = 0; j <= nbY; ++j )
+// {
+// p.Y() = pmin.Y() + j * dy / nbY;
+// for ( int k = 0; k <= nbZ; ++k )
+// {
+// p.Z() = pmin.Z() + k * dz / nbZ;
+// ngMesh->RestrictLocalH( p, maxh );
+// }
+// }
+// }
+// }
+// }
//=============================================================================
/*!
for ( int iE = 1; iE <= edgeMap.Extent(); ++iE )
{
const TopoDS_Shape& edge = edgeMap( iE );
- if ( SMESH_Algo::isDegenerated( TopoDS::Edge( edge ))/* ||
- helper.IsSubShape( edge, aShape )*/)
+ if ( SMESH_Algo::isDegenerated( TopoDS::Edge( edge )))
continue;
SMESHDS_SubMesh* smDS = meshDS->MeshElements( edge );
if ( !smDS ) continue;
ngMeshes[0]->RestrictLocalH( pi, factor * ( n1 - n2 ).Modulus() );
}
}
+
+ // set local size defined on shapes
+ aMesher.SetLocalSize( occgeoComm, *ngMeshes[0] );
+ try {
+ ngMeshes[0]->LoadLocalMeshSize( mparam.meshsizefilename );
+ } catch (NgException & ex) {
+ return error( COMPERR_BAD_PARMETERS, ex.What() );
+ }
}
netgen::mparam.uselocalh = toOptimize; // restore as it is used at surface optimization
// get all EDGEs of a FACE
// ------------------------
TSideVector wires =
- StdMeshers_FaceSide::GetFaceWires( F, aMesh, ignoreMediumNodes, faceErr, proxyMesh );
+ StdMeshers_FaceSide::GetFaceWires( F, aMesh, ignoreMediumNodes, faceErr, &helper, proxyMesh );
if ( faceErr && !faceErr->IsOK() )
continue;
int nbWires = wires.size();
Box<3> bb = occgeom.GetBoundingBox();
bb.Increase (bb.Diam()/10);
ngMesh->SetLocalH (bb.PMin(), bb.PMax(), mparam.grading);
+ aMesher.SetLocalSize( occgeom, *ngMesh );
+ try {
+ ngMesh->LoadLocalMeshSize( mparam.meshsizefilename );
+ } catch (NgException & ex) {
+ return error( COMPERR_BAD_PARMETERS, ex.What() );
+ }
}
nodeVec.clear();
}
if ( j > elem.GetNP() )
{
- SMDS_MeshFace* face = 0;
if ( elem.GetType() == TRIG )
- face = helper.AddFace(nodes[0],nodes[1],nodes[2]);
+ helper.AddFace(nodes[0],nodes[1],nodes[2]);
else
- face = helper.AddFace(nodes[0],nodes[1],nodes[2],nodes[3]);
+ helper.AddFace(nodes[0],nodes[1],nodes[2],nodes[3]);
}
}