Compare commits
2 Commits
master
...
vuzlov/202
Author | SHA1 | Date | |
---|---|---|---|
|
f9e1c3b725 | ||
|
1cb4fd020b |
@ -3184,7 +3184,7 @@ bool NETGENPlugin_Mesher::Compute()
|
|||||||
FillSMesh( occgeo, *_ngMesh, initState, *_mesh, nodeVec, comment, &quadHelper );
|
FillSMesh( occgeo, *_ngMesh, initState, *_mesh, nodeVec, comment, &quadHelper );
|
||||||
|
|
||||||
// compute prismatic boundary volumes
|
// compute prismatic boundary volumes
|
||||||
int nbQuad = _mesh->NbQuadrangles();
|
smIdType nbQuad = _mesh->NbQuadrangles();
|
||||||
SMESH_ProxyMesh::Ptr viscousMesh;
|
SMESH_ProxyMesh::Ptr viscousMesh;
|
||||||
if ( _viscousLayersHyp )
|
if ( _viscousLayersHyp )
|
||||||
{
|
{
|
||||||
@ -3564,7 +3564,7 @@ bool NETGENPlugin_Mesher::Evaluate(MapShapeNbElems& aResMap)
|
|||||||
double aLen = SMESH_Algo::EdgeLength(E);
|
double aLen = SMESH_Algo::EdgeLength(E);
|
||||||
fullLen += aLen;
|
fullLen += aLen;
|
||||||
|
|
||||||
vector<int>& aVec = aResMap[_mesh->GetSubMesh(E)];
|
vector<smIdType>& aVec = aResMap[_mesh->GetSubMesh(E)];
|
||||||
if ( aVec.empty() )
|
if ( aVec.empty() )
|
||||||
aVec.resize( SMDSEntity_Last, 0);
|
aVec.resize( SMDSEntity_Last, 0);
|
||||||
else
|
else
|
||||||
@ -3581,7 +3581,7 @@ bool NETGENPlugin_Mesher::Evaluate(MapShapeNbElems& aResMap)
|
|||||||
int aGeomEdgeInd = seg.epgeominfo[0].edgenr;
|
int aGeomEdgeInd = seg.epgeominfo[0].edgenr;
|
||||||
if (aGeomEdgeInd > 0 && aGeomEdgeInd <= occgeo.emap.Extent())
|
if (aGeomEdgeInd > 0 && aGeomEdgeInd <= occgeo.emap.Extent())
|
||||||
{
|
{
|
||||||
vector<int>& aVec = aResMap[_mesh->GetSubMesh(occgeo.emap(aGeomEdgeInd))];
|
vector<smIdType>& aVec = aResMap[_mesh->GetSubMesh(occgeo.emap(aGeomEdgeInd))];
|
||||||
aVec[ entity ]++;
|
aVec[ entity ]++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3589,7 +3589,7 @@ bool NETGENPlugin_Mesher::Evaluate(MapShapeNbElems& aResMap)
|
|||||||
TopTools_DataMapIteratorOfDataMapOfShapeInteger Edge2NbSegIt(Edge2NbSeg);
|
TopTools_DataMapIteratorOfDataMapOfShapeInteger Edge2NbSegIt(Edge2NbSeg);
|
||||||
for (; Edge2NbSegIt.More(); Edge2NbSegIt.Next())
|
for (; Edge2NbSegIt.More(); Edge2NbSegIt.Next())
|
||||||
{
|
{
|
||||||
vector<int>& aVec = aResMap[_mesh->GetSubMesh(Edge2NbSegIt.Key())];
|
vector<smIdType>& aVec = aResMap[_mesh->GetSubMesh(Edge2NbSegIt.Key())];
|
||||||
if ( aVec[ entity ] > 1 && aVec[ SMDSEntity_Node ] == 0 )
|
if ( aVec[ entity ] > 1 && aVec[ SMDSEntity_Node ] == 0 )
|
||||||
aVec[SMDSEntity_Node] = mparams.secondorder > 0 ? 2*aVec[ entity ]-1 : aVec[ entity ]-1;
|
aVec[SMDSEntity_Node] = mparams.secondorder > 0 ? 2*aVec[ entity ]-1 : aVec[ entity ]-1;
|
||||||
|
|
||||||
@ -3636,7 +3636,7 @@ bool NETGENPlugin_Mesher::Evaluate(MapShapeNbElems& aResMap)
|
|||||||
int nbFaces = tooManyElems ? hugeNb : int( 4*anArea / (mparams.maxh*mparams.maxh*sqrt(3.)));
|
int nbFaces = tooManyElems ? hugeNb : int( 4*anArea / (mparams.maxh*mparams.maxh*sqrt(3.)));
|
||||||
int nbNodes = tooManyElems ? hugeNb : (( nbFaces*3 - (nb1d-1)*2 ) / 6 + 1 );
|
int nbNodes = tooManyElems ? hugeNb : (( nbFaces*3 - (nb1d-1)*2 ) / 6 + 1 );
|
||||||
|
|
||||||
vector<int> aVec(SMDSEntity_Last, 0);
|
vector<smIdType> aVec(SMDSEntity_Last, 0);
|
||||||
if( mparams.secondorder > 0 ) {
|
if( mparams.secondorder > 0 ) {
|
||||||
int nb1d_in = (nbFaces*3 - nb1d) / 2;
|
int nb1d_in = (nbFaces*3 - nb1d) / 2;
|
||||||
aVec[SMDSEntity_Node] = nbNodes + nb1d_in;
|
aVec[SMDSEntity_Node] = nbNodes + nb1d_in;
|
||||||
@ -3675,7 +3675,7 @@ bool NETGENPlugin_Mesher::Evaluate(MapShapeNbElems& aResMap)
|
|||||||
tooManyElems = tooManyElems || ( aVolume/hugeNb > tetrVol );
|
tooManyElems = tooManyElems || ( aVolume/hugeNb > tetrVol );
|
||||||
int nbVols = tooManyElems ? hugeNb : int(aVolume/tetrVol);
|
int nbVols = tooManyElems ? hugeNb : int(aVolume/tetrVol);
|
||||||
int nb1d_in = int(( nbVols*6 - fullNbSeg ) / 6 );
|
int nb1d_in = int(( nbVols*6 - fullNbSeg ) / 6 );
|
||||||
vector<int> aVec(SMDSEntity_Last, 0 );
|
vector<smIdType> aVec(SMDSEntity_Last, 0 );
|
||||||
if ( tooManyElems ) // avoid FPE
|
if ( tooManyElems ) // avoid FPE
|
||||||
{
|
{
|
||||||
aVec[SMDSEntity_Node] = hugeNb;
|
aVec[SMDSEntity_Node] = hugeNb;
|
||||||
|
@ -646,7 +646,7 @@ bool NETGENPlugin_NETGEN_2D_ONLY::Evaluate(SMESH_Mesh& aMesh,
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
// collect info from edges
|
// collect info from edges
|
||||||
int nb0d = 0, nb1d = 0;
|
smIdType nb0d = 0, nb1d = 0;
|
||||||
bool IsQuadratic = false;
|
bool IsQuadratic = false;
|
||||||
bool IsFirst = true;
|
bool IsFirst = true;
|
||||||
double fullLen = 0.0;
|
double fullLen = 0.0;
|
||||||
@ -664,9 +664,9 @@ bool NETGENPlugin_NETGEN_2D_ONLY::Evaluate(SMESH_Mesh& aMesh,
|
|||||||
smError.reset( new SMESH_ComputeError(COMPERR_ALGO_FAILED,"Submesh can not be evaluated",this));
|
smError.reset( new SMESH_ComputeError(COMPERR_ALGO_FAILED,"Submesh can not be evaluated",this));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
std::vector<int> aVec = (*anIt).second;
|
std::vector<smIdType> aVec = (*anIt).second;
|
||||||
nb0d += aVec[SMDSEntity_Node];
|
nb0d += aVec[SMDSEntity_Node];
|
||||||
nb1d += Max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]);
|
nb1d += std::max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]);
|
||||||
double aLen = SMESH_Algo::EdgeLength(E);
|
double aLen = SMESH_Algo::EdgeLength(E);
|
||||||
fullLen += aLen;
|
fullLen += aLen;
|
||||||
if(IsFirst) {
|
if(IsFirst) {
|
||||||
@ -698,10 +698,10 @@ bool NETGENPlugin_NETGEN_2D_ONLY::Evaluate(SMESH_Mesh& aMesh,
|
|||||||
smError.reset( new SMESH_ComputeError(COMPERR_ALGO_FAILED,"Submesh can not be evaluated.\nToo small element length",this));
|
smError.reset( new SMESH_ComputeError(COMPERR_ALGO_FAILED,"Submesh can not be evaluated.\nToo small element length",this));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
int nbFaces = (int) ( anArea / ( ELen*ELen*sqrt(3.) / 4 ) );
|
smIdType nbFaces = (smIdType) ( anArea / ( ELen*ELen*sqrt(3.) / 4 ) );
|
||||||
int nbNodes = (int) ( ( nbFaces*3 - (nb1d-1)*2 ) / 6 + 1 );
|
smIdType nbNodes = (smIdType) ( ( nbFaces*3 - (nb1d-1)*2 ) / 6 + 1 );
|
||||||
std::vector<int> aVec(SMDSEntity_Last);
|
std::vector<smIdType> aVec(SMDSEntity_Last);
|
||||||
for(int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aVec[i]=0;
|
for(smIdType i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aVec[i]=0;
|
||||||
if( IsQuadratic ) {
|
if( IsQuadratic ) {
|
||||||
aVec[SMDSEntity_Node] = nbNodes;
|
aVec[SMDSEntity_Node] = nbNodes;
|
||||||
aVec[SMDSEntity_Quad_Triangle] = nbFaces;
|
aVec[SMDSEntity_Quad_Triangle] = nbFaces;
|
||||||
|
@ -728,7 +728,7 @@ bool NETGENPlugin_NETGEN_3D::Evaluate(SMESH_Mesh& aMesh,
|
|||||||
const TopoDS_Shape& aShape,
|
const TopoDS_Shape& aShape,
|
||||||
MapShapeNbElems& aResMap)
|
MapShapeNbElems& aResMap)
|
||||||
{
|
{
|
||||||
int nbtri = 0, nbqua = 0;
|
smIdType nbtri = 0, nbqua = 0;
|
||||||
double fullArea = 0.0;
|
double fullArea = 0.0;
|
||||||
for (TopExp_Explorer expF(aShape, TopAbs_FACE); expF.More(); expF.Next()) {
|
for (TopExp_Explorer expF(aShape, TopAbs_FACE); expF.More(); expF.Next()) {
|
||||||
TopoDS_Face F = TopoDS::Face( expF.Current() );
|
TopoDS_Face F = TopoDS::Face( expF.Current() );
|
||||||
@ -739,9 +739,9 @@ bool NETGENPlugin_NETGEN_3D::Evaluate(SMESH_Mesh& aMesh,
|
|||||||
smError.reset( new SMESH_ComputeError(COMPERR_ALGO_FAILED,"Submesh can not be evaluated",this));
|
smError.reset( new SMESH_ComputeError(COMPERR_ALGO_FAILED,"Submesh can not be evaluated",this));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
std::vector<int> aVec = (*anIt).second;
|
std::vector<smIdType> aVec = (*anIt).second;
|
||||||
nbtri += Max(aVec[SMDSEntity_Triangle],aVec[SMDSEntity_Quad_Triangle]);
|
nbtri += std::max(aVec[SMDSEntity_Triangle],aVec[SMDSEntity_Quad_Triangle]);
|
||||||
nbqua += Max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]);
|
nbqua += std::max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]);
|
||||||
GProp_GProps G;
|
GProp_GProps G;
|
||||||
BRepGProp::SurfaceProperties(F,G);
|
BRepGProp::SurfaceProperties(F,G);
|
||||||
double anArea = G.Mass();
|
double anArea = G.Mass();
|
||||||
@ -749,7 +749,7 @@ bool NETGENPlugin_NETGEN_3D::Evaluate(SMESH_Mesh& aMesh,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// collect info from edges
|
// collect info from edges
|
||||||
int nb0d_e = 0, nb1d_e = 0;
|
smIdType nb0d_e = 0, nb1d_e = 0;
|
||||||
bool IsQuadratic = false;
|
bool IsQuadratic = false;
|
||||||
bool IsFirst = true;
|
bool IsFirst = true;
|
||||||
TopTools_MapOfShape tmpMap;
|
TopTools_MapOfShape tmpMap;
|
||||||
@ -766,9 +766,9 @@ bool NETGENPlugin_NETGEN_3D::Evaluate(SMESH_Mesh& aMesh,
|
|||||||
"Submesh can not be evaluated",this));
|
"Submesh can not be evaluated",this));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
std::vector<int> aVec = (*anIt).second;
|
std::vector<smIdType> aVec = (*anIt).second;
|
||||||
nb0d_e += aVec[SMDSEntity_Node];
|
nb0d_e += aVec[SMDSEntity_Node];
|
||||||
nb1d_e += Max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]);
|
nb1d_e += std::max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]);
|
||||||
if(IsFirst) {
|
if(IsFirst) {
|
||||||
IsQuadratic = (aVec[SMDSEntity_Quad_Edge] > aVec[SMDSEntity_Edge]);
|
IsQuadratic = (aVec[SMDSEntity_Quad_Edge] > aVec[SMDSEntity_Edge]);
|
||||||
IsFirst = false;
|
IsFirst = false;
|
||||||
@ -785,11 +785,11 @@ bool NETGENPlugin_NETGEN_3D::Evaluate(SMESH_Mesh& aMesh,
|
|||||||
double aVolume = G.Mass();
|
double aVolume = G.Mass();
|
||||||
double tetrVol = 0.1179*ELen*ELen*ELen;
|
double tetrVol = 0.1179*ELen*ELen*ELen;
|
||||||
double CoeffQuality = 0.9;
|
double CoeffQuality = 0.9;
|
||||||
int nbVols = int( aVolume/tetrVol/CoeffQuality );
|
smIdType nbVols = (smIdType)( aVolume/tetrVol/CoeffQuality );
|
||||||
int nb1d_f = (nbtri*3 + nbqua*4 - nb1d_e) / 2;
|
smIdType nb1d_f = (nbtri*3 + nbqua*4 - nb1d_e) / 2;
|
||||||
int nb1d_in = (nbVols*6 - nb1d_e - nb1d_f ) / 5;
|
smIdType nb1d_in = (nbVols*6 - nb1d_e - nb1d_f ) / 5;
|
||||||
std::vector<int> aVec(SMDSEntity_Last);
|
std::vector<smIdType> aVec(SMDSEntity_Last);
|
||||||
for(int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aVec[i]=0;
|
for(smIdType i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aVec[i]=0;
|
||||||
if( IsQuadratic ) {
|
if( IsQuadratic ) {
|
||||||
aVec[SMDSEntity_Node] = nb1d_in/6 + 1 + nb1d_in;
|
aVec[SMDSEntity_Node] = nb1d_in/6 + 1 + nb1d_in;
|
||||||
aVec[SMDSEntity_Quad_Tetra] = nbVols - nbqua*2;
|
aVec[SMDSEntity_Quad_Tetra] = nbVols - nbqua*2;
|
||||||
|
@ -199,7 +199,7 @@ bool NETGENPlugin_SimpleHypothesis_2D::SetParametersByMesh(const SMESH_Mesh* t
|
|||||||
const TopoDS_Shape& theShape)
|
const TopoDS_Shape& theShape)
|
||||||
{
|
{
|
||||||
// Find out nb of segments.
|
// Find out nb of segments.
|
||||||
int nbSeg = 0, nbEdges = 0;
|
smIdType nbSeg = 0, nbEdges = 0;
|
||||||
TopExp_Explorer exp( theShape, TopAbs_EDGE );
|
TopExp_Explorer exp( theShape, TopAbs_EDGE );
|
||||||
for ( ; exp.More(); exp.Next() ) {
|
for ( ; exp.More(); exp.Next() ) {
|
||||||
SMESH_subMesh* sm = theMesh->GetSubMeshContaining( exp.Current() );
|
SMESH_subMesh* sm = theMesh->GetSubMeshContaining( exp.Current() );
|
||||||
|
Loading…
Reference in New Issue
Block a user