mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-11-11 16:19:16 +05:00
typo-fix by Kunda + minor changes
This commit is contained in:
parent
254c2216c3
commit
05318c85be
@ -28,22 +28,22 @@ critaria = [ \
|
|||||||
]
|
]
|
||||||
filt = smesh.GetFilterFromCriteria( critaria )
|
filt = smesh.GetFilterFromCriteria( critaria )
|
||||||
filtGroup = mesh.GroupOnFilter( SMESH.FACE, "group on filter", filt )
|
filtGroup = mesh.GroupOnFilter( SMESH.FACE, "group on filter", filt )
|
||||||
print "Group on filter contains %s elemens" % filtGroup.Size()
|
print "Group on filter contains %s elements" % filtGroup.Size()
|
||||||
|
|
||||||
# group on filter is updated if the mesh is modified
|
# group on filter is updated if the mesh is modified
|
||||||
hyp1D.SetStartLength( 2.5 )
|
hyp1D.SetStartLength( 2.5 )
|
||||||
hyp1D.SetEndLength( 2.5 )
|
hyp1D.SetEndLength( 2.5 )
|
||||||
mesh.Compute()
|
mesh.Compute()
|
||||||
print "After mesh change, group on filter contains %s elemens" % filtGroup.Size()
|
print "After mesh change, group on filter contains %s elements" % filtGroup.Size()
|
||||||
|
|
||||||
# set a new filter defining the group
|
# set a new filter defining the group
|
||||||
filt2 = smesh.GetFilter( SMESH.FACE, SMESH.FT_RangeOfIds, "1-50" )
|
filt2 = smesh.GetFilter( SMESH.FACE, SMESH.FT_RangeOfIds, "1-50" )
|
||||||
filtGroup.SetFilter( filt2 )
|
filtGroup.SetFilter( filt2 )
|
||||||
print "With a new filter, group on filter contains %s elemens" % filtGroup.Size()
|
print "With a new filter, group on filter contains %s elements" % filtGroup.Size()
|
||||||
|
|
||||||
# group is updated at modification of the filter
|
# group is updated at modification of the filter
|
||||||
filt2.SetCriteria( [ smesh.GetCriterion( SMESH.FACE, SMESH.FT_RangeOfIds, "1-70" )])
|
filt2.SetCriteria( [ smesh.GetCriterion( SMESH.FACE, SMESH.FT_RangeOfIds, "1-70" )])
|
||||||
filtIDs3 = filtGroup.GetIDs()
|
filtIDs3 = filtGroup.GetIDs()
|
||||||
print "After filter modification, group on filter contains %s elemens" % filtGroup.Size()
|
print "After filter modification, group on filter contains %s elements" % filtGroup.Size()
|
||||||
|
|
||||||
salome.sg.updateObjBrowser(True)
|
salome.sg.updateObjBrowser(True)
|
||||||
|
@ -31,7 +31,7 @@ smesh = smeshBuilder.New(salome.myStudy)
|
|||||||
|
|
||||||
|
|
||||||
<b> Of course, <em>from smesh import *</em> is no more possible.</b>
|
<b> Of course, <em>from smesh import *</em> is no more possible.</b>
|
||||||
\n You have to explicitely write <em>smesh.some_method()</em>.
|
\n You have to explicitly write <em>smesh.some_method()</em>.
|
||||||
|
|
||||||
<b>All algorithms have been transferred from the namespace <em>smesh</em> to the namespace <em>smeshBuilder</em>.</b>
|
<b>All algorithms have been transferred from the namespace <em>smesh</em> to the namespace <em>smeshBuilder</em>.</b>
|
||||||
\n For instance:
|
\n For instance:
|
||||||
@ -79,7 +79,7 @@ is replaced by:
|
|||||||
Compound1 = smesh.Concatenate([Mesh_inf.GetMesh(), Mesh_sup.GetMesh()], 0, 1, 1e-05)
|
Compound1 = smesh.Concatenate([Mesh_inf.GetMesh(), Mesh_sup.GetMesh()], 0, 1, 1e-05)
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
<b>If you need to import a %SMESH Plugin explicitely, keep in mind that they are now located in separate namespaces.</b>
|
<b>If you need to import a %SMESH Plugin explicitly, keep in mind that they are now located in separate namespaces.</b>
|
||||||
\n For instance:
|
\n For instance:
|
||||||
\code
|
\code
|
||||||
import StdMeshers
|
import StdMeshers
|
||||||
|
@ -551,7 +551,7 @@ module SMESH
|
|||||||
raises (SALOME::SALOME_Exception);
|
raises (SALOME::SALOME_Exception);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Remove an hypothesis previouly added with AddHypothesis.
|
* Remove an hypothesis previously added with AddHypothesis.
|
||||||
*/
|
*/
|
||||||
Hypothesis_Status RemoveHypothesis(in GEOM::GEOM_Object aSubObject,
|
Hypothesis_Status RemoveHypothesis(in GEOM::GEOM_Object aSubObject,
|
||||||
in SMESH_Hypothesis anHyp)
|
in SMESH_Hypothesis anHyp)
|
||||||
@ -734,7 +734,7 @@ module SMESH
|
|||||||
double GetComputeProgress();
|
double GetComputeProgress();
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Get informations about mesh contents
|
* Get information about mesh contents
|
||||||
*/
|
*/
|
||||||
long NbNodes()
|
long NbNodes()
|
||||||
raises (SALOME::SALOME_Exception);
|
raises (SALOME::SALOME_Exception);
|
||||||
|
@ -45,6 +45,7 @@
|
|||||||
#include <BRepClass3d_SolidClassifier.hxx>
|
#include <BRepClass3d_SolidClassifier.hxx>
|
||||||
#include <BRepClass_FaceClassifier.hxx>
|
#include <BRepClass_FaceClassifier.hxx>
|
||||||
#include <BRep_Tool.hxx>
|
#include <BRep_Tool.hxx>
|
||||||
|
#include <GeomLib_IsPlanarSurface.hxx>
|
||||||
#include <Geom_CylindricalSurface.hxx>
|
#include <Geom_CylindricalSurface.hxx>
|
||||||
#include <Geom_Plane.hxx>
|
#include <Geom_Plane.hxx>
|
||||||
#include <Geom_Surface.hxx>
|
#include <Geom_Surface.hxx>
|
||||||
@ -98,6 +99,15 @@ namespace {
|
|||||||
v2.Magnitude() < gp::Resolution() ? 0 : v1.Angle( v2 );
|
v2.Magnitude() < gp::Resolution() ? 0 : v1.Angle( v2 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline double getCos2( const gp_XYZ& P1, const gp_XYZ& P2, const gp_XYZ& P3 )
|
||||||
|
{
|
||||||
|
gp_Vec v1( P1 - P2 ), v2( P3 - P2 );
|
||||||
|
double dot = v1 * v2, len1 = v1.SquareMagnitude(), len2 = v2.SquareMagnitude();
|
||||||
|
|
||||||
|
return ( len1 < gp::Resolution() || len2 < gp::Resolution() ? -1 :
|
||||||
|
dot * dot / len1 / len2 );
|
||||||
|
}
|
||||||
|
|
||||||
inline double getArea( const gp_XYZ& P1, const gp_XYZ& P2, const gp_XYZ& P3 )
|
inline double getArea( const gp_XYZ& P1, const gp_XYZ& P2, const gp_XYZ& P3 )
|
||||||
{
|
{
|
||||||
gp_Vec aVec1( P2 - P1 );
|
gp_Vec aVec1( P2 - P1 );
|
||||||
@ -713,21 +723,25 @@ SMDSAbs_ElementType MaxElementLength3D::GetType() const
|
|||||||
|
|
||||||
double MinimumAngle::GetValue( const TSequenceOfXYZ& P )
|
double MinimumAngle::GetValue( const TSequenceOfXYZ& P )
|
||||||
{
|
{
|
||||||
double aMin;
|
if ( P.size() < 3 )
|
||||||
|
|
||||||
if (P.size() <3)
|
|
||||||
return 0.;
|
return 0.;
|
||||||
|
|
||||||
aMin = getAngle(P( P.size() ), P( 1 ), P( 2 ));
|
double aMaxCos2;
|
||||||
aMin = Min(aMin,getAngle(P( P.size()-1 ), P( P.size() ), P( 1 )));
|
|
||||||
|
aMaxCos2 = getCos2( P( P.size() ), P( 1 ), P( 2 ));
|
||||||
|
aMaxCos2 = Max( aMaxCos2, getCos2( P( P.size()-1 ), P( P.size() ), P( 1 )));
|
||||||
|
|
||||||
for ( size_t i = 2; i < P.size(); i++ )
|
for ( size_t i = 2; i < P.size(); i++ )
|
||||||
{
|
{
|
||||||
double A0 = getAngle( P( i-1 ), P( i ), P( i+1 ) );
|
double A0 = getCos2( P( i-1 ), P( i ), P( i+1 ) );
|
||||||
aMin = Min(aMin,A0);
|
aMaxCos2 = Max( aMaxCos2, A0 );
|
||||||
}
|
}
|
||||||
|
if ( aMaxCos2 <= 0 )
|
||||||
|
return 0; // all nodes coincide
|
||||||
|
|
||||||
return aMin * 180.0 / M_PI;
|
double cos = sqrt( aMaxCos2 );
|
||||||
|
if ( cos >= 1 ) return 0;
|
||||||
|
return acos( cos ) * 180.0 / M_PI;
|
||||||
}
|
}
|
||||||
|
|
||||||
double MinimumAngle::GetBadRate( double Value, int nbNodes ) const
|
double MinimumAngle::GetBadRate( double Value, int nbNodes ) const
|
||||||
@ -786,58 +800,51 @@ double AspectRatio::GetValue( const TSequenceOfXYZ& P )
|
|||||||
|
|
||||||
if ( nbNodes == 3 ) {
|
if ( nbNodes == 3 ) {
|
||||||
// Compute lengths of the sides
|
// Compute lengths of the sides
|
||||||
std::vector< double > aLen (nbNodes);
|
double aLen1 = getDistance( P( 1 ), P( 2 ));
|
||||||
for ( int i = 0; i < nbNodes - 1; i++ )
|
double aLen2 = getDistance( P( 2 ), P( 3 ));
|
||||||
aLen[ i ] = getDistance( P( i + 1 ), P( i + 2 ) );
|
double aLen3 = getDistance( P( 3 ), P( 1 ));
|
||||||
aLen[ nbNodes - 1 ] = getDistance( P( 1 ), P( nbNodes ) );
|
|
||||||
// Q = alfa * h * p / S, where
|
// Q = alfa * h * p / S, where
|
||||||
//
|
//
|
||||||
// alfa = sqrt( 3 ) / 6
|
// alfa = sqrt( 3 ) / 6
|
||||||
// h - length of the longest edge
|
// h - length of the longest edge
|
||||||
// p - half perimeter
|
// p - half perimeter
|
||||||
// S - triangle surface
|
// S - triangle surface
|
||||||
const double alfa = sqrt( 3. ) / 6.;
|
const double alfa = sqrt( 3. ) / 6.;
|
||||||
double maxLen = Max( aLen[ 0 ], Max( aLen[ 1 ], aLen[ 2 ] ) );
|
double maxLen = Max( aLen1, Max( aLen2, aLen3 ));
|
||||||
double half_perimeter = ( aLen[0] + aLen[1] + aLen[2] ) / 2.;
|
double half_perimeter = ( aLen1 + aLen2 + aLen3 ) / 2.;
|
||||||
double anArea = getArea( P( 1 ), P( 2 ), P( 3 ) );
|
double anArea = getArea( P( 1 ), P( 2 ), P( 3 ));
|
||||||
if ( anArea <= theEps )
|
if ( anArea <= theEps )
|
||||||
return theInf;
|
return theInf;
|
||||||
return alfa * maxLen * half_perimeter / anArea;
|
return alfa * maxLen * half_perimeter / anArea;
|
||||||
}
|
}
|
||||||
else if ( nbNodes == 6 ) { // quadratic triangles
|
else if ( nbNodes == 6 ) { // quadratic triangles
|
||||||
// Compute lengths of the sides
|
// Compute lengths of the sides
|
||||||
std::vector< double > aLen (3);
|
double aLen1 = getDistance( P( 1 ), P( 3 ));
|
||||||
aLen[0] = getDistance( P(1), P(3) );
|
double aLen2 = getDistance( P( 3 ), P( 5 ));
|
||||||
aLen[1] = getDistance( P(3), P(5) );
|
double aLen3 = getDistance( P( 5 ), P( 1 ));
|
||||||
aLen[2] = getDistance( P(5), P(1) );
|
// algo same as for the linear triangle
|
||||||
// Q = alfa * h * p / S, where
|
const double alfa = sqrt( 3. ) / 6.;
|
||||||
//
|
double maxLen = Max( aLen1, Max( aLen2, aLen3 ));
|
||||||
// alfa = sqrt( 3 ) / 6
|
double half_perimeter = ( aLen1 + aLen2 + aLen3 ) / 2.;
|
||||||
// h - length of the longest edge
|
double anArea = getArea( P( 1 ), P( 3 ), P( 5 ));
|
||||||
// p - half perimeter
|
|
||||||
// S - triangle surface
|
|
||||||
const double alfa = sqrt( 3. ) / 6.;
|
|
||||||
double maxLen = Max( aLen[ 0 ], Max( aLen[ 1 ], aLen[ 2 ] ) );
|
|
||||||
double half_perimeter = ( aLen[0] + aLen[1] + aLen[2] ) / 2.;
|
|
||||||
double anArea = getArea( P(1), P(3), P(5) );
|
|
||||||
if ( anArea <= theEps )
|
if ( anArea <= theEps )
|
||||||
return theInf;
|
return theInf;
|
||||||
return alfa * maxLen * half_perimeter / anArea;
|
return alfa * maxLen * half_perimeter / anArea;
|
||||||
}
|
}
|
||||||
else if( nbNodes == 4 ) { // quadrangle
|
else if( nbNodes == 4 ) { // quadrangle
|
||||||
// Compute lengths of the sides
|
// Compute lengths of the sides
|
||||||
std::vector< double > aLen (4);
|
double aLen[4];
|
||||||
aLen[0] = getDistance( P(1), P(2) );
|
aLen[0] = getDistance( P(1), P(2) );
|
||||||
aLen[1] = getDistance( P(2), P(3) );
|
aLen[1] = getDistance( P(2), P(3) );
|
||||||
aLen[2] = getDistance( P(3), P(4) );
|
aLen[2] = getDistance( P(3), P(4) );
|
||||||
aLen[3] = getDistance( P(4), P(1) );
|
aLen[3] = getDistance( P(4), P(1) );
|
||||||
// Compute lengths of the diagonals
|
// Compute lengths of the diagonals
|
||||||
std::vector< double > aDia (2);
|
double aDia[2];
|
||||||
aDia[0] = getDistance( P(1), P(3) );
|
aDia[0] = getDistance( P(1), P(3) );
|
||||||
aDia[1] = getDistance( P(2), P(4) );
|
aDia[1] = getDistance( P(2), P(4) );
|
||||||
// Compute areas of all triangles which can be built
|
// Compute areas of all triangles which can be built
|
||||||
// taking three nodes of the quadrangle
|
// taking three nodes of the quadrangle
|
||||||
std::vector< double > anArea (4);
|
double anArea[4];
|
||||||
anArea[0] = getArea( P(1), P(2), P(3) );
|
anArea[0] = getArea( P(1), P(2), P(3) );
|
||||||
anArea[1] = getArea( P(1), P(2), P(4) );
|
anArea[1] = getArea( P(1), P(2), P(4) );
|
||||||
anArea[2] = getArea( P(1), P(3), P(4) );
|
anArea[2] = getArea( P(1), P(3), P(4) );
|
||||||
@ -853,35 +860,35 @@ double AspectRatio::GetValue( const TSequenceOfXYZ& P )
|
|||||||
// Si - areas of the triangles
|
// Si - areas of the triangles
|
||||||
const double alpha = sqrt( 1 / 32. );
|
const double alpha = sqrt( 1 / 32. );
|
||||||
double L = Max( aLen[ 0 ],
|
double L = Max( aLen[ 0 ],
|
||||||
Max( aLen[ 1 ],
|
Max( aLen[ 1 ],
|
||||||
Max( aLen[ 2 ],
|
Max( aLen[ 2 ],
|
||||||
Max( aLen[ 3 ],
|
Max( aLen[ 3 ],
|
||||||
Max( aDia[ 0 ], aDia[ 1 ] ) ) ) ) );
|
Max( aDia[ 0 ], aDia[ 1 ] ) ) ) ) );
|
||||||
double C1 = sqrt( ( aLen[0] * aLen[0] +
|
double C1 = sqrt( ( aLen[0] * aLen[0] +
|
||||||
aLen[1] * aLen[1] +
|
aLen[1] * aLen[1] +
|
||||||
aLen[2] * aLen[2] +
|
aLen[2] * aLen[2] +
|
||||||
aLen[3] * aLen[3] ) / 4. );
|
aLen[3] * aLen[3] ) / 4. );
|
||||||
double C2 = Min( anArea[ 0 ],
|
double C2 = Min( anArea[ 0 ],
|
||||||
Min( anArea[ 1 ],
|
Min( anArea[ 1 ],
|
||||||
Min( anArea[ 2 ], anArea[ 3 ] ) ) );
|
Min( anArea[ 2 ], anArea[ 3 ] ) ) );
|
||||||
if ( C2 <= theEps )
|
if ( C2 <= theEps )
|
||||||
return theInf;
|
return theInf;
|
||||||
return alpha * L * C1 / C2;
|
return alpha * L * C1 / C2;
|
||||||
}
|
}
|
||||||
else if( nbNodes == 8 || nbNodes == 9 ) { // nbNodes==8 - quadratic quadrangle
|
else if( nbNodes == 8 || nbNodes == 9 ) { // nbNodes==8 - quadratic quadrangle
|
||||||
// Compute lengths of the sides
|
// Compute lengths of the sides
|
||||||
std::vector< double > aLen (4);
|
double aLen[4];
|
||||||
aLen[0] = getDistance( P(1), P(3) );
|
aLen[0] = getDistance( P(1), P(3) );
|
||||||
aLen[1] = getDistance( P(3), P(5) );
|
aLen[1] = getDistance( P(3), P(5) );
|
||||||
aLen[2] = getDistance( P(5), P(7) );
|
aLen[2] = getDistance( P(5), P(7) );
|
||||||
aLen[3] = getDistance( P(7), P(1) );
|
aLen[3] = getDistance( P(7), P(1) );
|
||||||
// Compute lengths of the diagonals
|
// Compute lengths of the diagonals
|
||||||
std::vector< double > aDia (2);
|
double aDia[2];
|
||||||
aDia[0] = getDistance( P(1), P(5) );
|
aDia[0] = getDistance( P(1), P(5) );
|
||||||
aDia[1] = getDistance( P(3), P(7) );
|
aDia[1] = getDistance( P(3), P(7) );
|
||||||
// Compute areas of all triangles which can be built
|
// Compute areas of all triangles which can be built
|
||||||
// taking three nodes of the quadrangle
|
// taking three nodes of the quadrangle
|
||||||
std::vector< double > anArea (4);
|
double anArea[4];
|
||||||
anArea[0] = getArea( P(1), P(3), P(5) );
|
anArea[0] = getArea( P(1), P(3), P(5) );
|
||||||
anArea[1] = getArea( P(1), P(3), P(7) );
|
anArea[1] = getArea( P(1), P(3), P(7) );
|
||||||
anArea[2] = getArea( P(1), P(5), P(7) );
|
anArea[2] = getArea( P(1), P(5), P(7) );
|
||||||
@ -1922,6 +1929,12 @@ double Deflection2D::GetValue( const TSequenceOfXYZ& P )
|
|||||||
if ( !S.IsNull() && S.ShapeType() == TopAbs_FACE )
|
if ( !S.IsNull() && S.ShapeType() == TopAbs_FACE )
|
||||||
{
|
{
|
||||||
mySurface = new ShapeAnalysis_Surface( BRep_Tool::Surface( TopoDS::Face( S )));
|
mySurface = new ShapeAnalysis_Surface( BRep_Tool::Surface( TopoDS::Face( S )));
|
||||||
|
|
||||||
|
GeomLib_IsPlanarSurface isPlaneCheck( mySurface->Surface() );
|
||||||
|
if ( isPlaneCheck.IsPlanar() )
|
||||||
|
myPlane.reset( new gp_Pln( isPlaneCheck.Plan() ));
|
||||||
|
else
|
||||||
|
myPlane.reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// project gravity center to the surface
|
// project gravity center to the surface
|
||||||
@ -1947,12 +1960,22 @@ double Deflection2D::GetValue( const TSequenceOfXYZ& P )
|
|||||||
|
|
||||||
double maxLen = MaxElementLength2D().GetValue( P );
|
double maxLen = MaxElementLength2D().GetValue( P );
|
||||||
double tol = 1e-3 * maxLen;
|
double tol = 1e-3 * maxLen;
|
||||||
if ( uv.X() != 0 && uv.Y() != 0 ) // faster way
|
double dist;
|
||||||
mySurface->NextValueOfUV( uv, gc, tol, 0.5 * maxLen );
|
if ( myPlane )
|
||||||
|
{
|
||||||
|
dist = myPlane->Distance( gc );
|
||||||
|
if ( dist < tol )
|
||||||
|
dist = 0;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
mySurface->ValueOfUV( gc, tol );
|
{
|
||||||
|
if ( uv.X() != 0 && uv.Y() != 0 ) // faster way
|
||||||
return Round( mySurface->Gap() );
|
mySurface->NextValueOfUV( uv, gc, tol, 0.5 * maxLen );
|
||||||
|
else
|
||||||
|
mySurface->ValueOfUV( gc, tol );
|
||||||
|
dist = mySurface->Gap();
|
||||||
|
}
|
||||||
|
return Round( dist );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@ -1962,6 +1985,7 @@ void Deflection2D::SetMesh( const SMDS_Mesh* theMesh )
|
|||||||
{
|
{
|
||||||
NumericalFunctor::SetMesh( dynamic_cast<const SMESHDS_Mesh* >( theMesh ));
|
NumericalFunctor::SetMesh( dynamic_cast<const SMESHDS_Mesh* >( theMesh ));
|
||||||
myShapeIndex = -100;
|
myShapeIndex = -100;
|
||||||
|
myPlane.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
SMDSAbs_ElementType Deflection2D::GetType() const
|
SMDSAbs_ElementType Deflection2D::GetType() const
|
||||||
|
@ -53,9 +53,10 @@ class SMESHDS_Mesh;
|
|||||||
class SMESHDS_SubMesh;
|
class SMESHDS_SubMesh;
|
||||||
class SMESHDS_GroupBase;
|
class SMESHDS_GroupBase;
|
||||||
|
|
||||||
class gp_Pnt;
|
|
||||||
class BRepClass3d_SolidClassifier;
|
class BRepClass3d_SolidClassifier;
|
||||||
class ShapeAnalysis_Surface;
|
class ShapeAnalysis_Surface;
|
||||||
|
class gp_Pln;
|
||||||
|
class gp_Pnt;
|
||||||
|
|
||||||
namespace SMESH{
|
namespace SMESH{
|
||||||
namespace Controls{
|
namespace Controls{
|
||||||
@ -321,6 +322,7 @@ namespace SMESH{
|
|||||||
private:
|
private:
|
||||||
Handle(ShapeAnalysis_Surface) mySurface;
|
Handle(ShapeAnalysis_Surface) mySurface;
|
||||||
int myShapeIndex;
|
int myShapeIndex;
|
||||||
|
boost::shared_ptr<gp_Pln> myPlane;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -87,7 +87,7 @@ using namespace std;
|
|||||||
bool SMESH_Algo::Features::IsCompatible( const SMESH_Algo::Features& algo2 ) const
|
bool SMESH_Algo::Features::IsCompatible( const SMESH_Algo::Features& algo2 ) const
|
||||||
{
|
{
|
||||||
if ( _dim > algo2._dim ) return algo2.IsCompatible( *this );
|
if ( _dim > algo2._dim ) return algo2.IsCompatible( *this );
|
||||||
// algo2 is of highter dimension
|
// algo2 is of higher dimension
|
||||||
if ( _outElemTypes.empty() || algo2._inElemTypes.empty() )
|
if ( _outElemTypes.empty() || algo2._inElemTypes.empty() )
|
||||||
return false;
|
return false;
|
||||||
bool compatible = true;
|
bool compatible = true;
|
||||||
|
@ -2188,7 +2188,7 @@ ostream& SMESH_Mesh::Dump(ostream& save)
|
|||||||
save << clause << ".3) Faces in detail: " << endl;
|
save << clause << ".3) Faces in detail: " << endl;
|
||||||
map <int,int>::iterator itF;
|
map <int,int>::iterator itF;
|
||||||
for (itF = myFaceMap.begin(); itF != myFaceMap.end(); itF++)
|
for (itF = myFaceMap.begin(); itF != myFaceMap.end(); itF++)
|
||||||
save << "--> nb nodes: " << itF->first << " - nb elemens:\t" << itF->second << endl;
|
save << "--> nb nodes: " << itF->first << " - nb elements:\t" << itF->second << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
save << ++clause << ") Total number of " << orderStr << " volumes:\t" << NbVolumes(order) << endl;
|
save << ++clause << ") Total number of " << orderStr << " volumes:\t" << NbVolumes(order) << endl;
|
||||||
@ -2213,7 +2213,7 @@ ostream& SMESH_Mesh::Dump(ostream& save)
|
|||||||
save << clause << ".5) Volumes in detail: " << endl;
|
save << clause << ".5) Volumes in detail: " << endl;
|
||||||
map <int,int>::iterator itV;
|
map <int,int>::iterator itV;
|
||||||
for (itV = myVolumesMap.begin(); itV != myVolumesMap.end(); itV++)
|
for (itV = myVolumesMap.begin(); itV != myVolumesMap.end(); itV++)
|
||||||
save << "--> nb nodes: " << itV->first << " - nb elemens:\t" << itV->second << endl;
|
save << "--> nb nodes: " << itV->first << " - nb elements:\t" << itV->second << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
save << endl;
|
save << endl;
|
||||||
|
@ -3460,6 +3460,24 @@ double SMESH_MesherHelper::GetOtherParam(const double param) const
|
|||||||
return fabs(param-myPar1[i]) < fabs(param-myPar2[i]) ? myPar2[i] : myPar1[i];
|
return fabs(param-myPar1[i]) < fabs(param-myPar2[i]) ? myPar2[i] : myPar1[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : NbRealSeam
|
||||||
|
//purpose : Return a number of real seam edges in the shape set through
|
||||||
|
// IsQuadraticSubMesh() or SetSubShape(). A real seam edge encounters twice in a wire
|
||||||
|
//=======================================================================
|
||||||
|
|
||||||
|
size_t SMESH_MesherHelper::NbRealSeam() const
|
||||||
|
{
|
||||||
|
size_t nb = 0;
|
||||||
|
|
||||||
|
std::set< int >::const_iterator id = mySeamShapeIds.begin();
|
||||||
|
for ( ; id != mySeamShapeIds.end(); ++id )
|
||||||
|
if ( *id < 0 ) ++nb;
|
||||||
|
else break;
|
||||||
|
|
||||||
|
return nb;
|
||||||
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : IsOnSeam
|
//function : IsOnSeam
|
||||||
//purpose : Check if UV is on seam. Return 0 if not, 1 for U seam, 2 for V seam
|
//purpose : Check if UV is on seam. Return 0 if not, 1 for U seam, 2 for V seam
|
||||||
@ -5126,7 +5144,7 @@ void SMESH_MesherHelper::FixQuadraticElements(SMESH_ComputeErrorPtr& compError,
|
|||||||
MSG("Internal chain - ignore");
|
MSG("Internal chain - ignore");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// mesure chain length and compute link position along the chain
|
// measure chain length and compute link position along the chain
|
||||||
double chainLen = 0;
|
double chainLen = 0;
|
||||||
vector< double > linkPos;
|
vector< double > linkPos;
|
||||||
TChain savedChain; // backup
|
TChain savedChain; // backup
|
||||||
|
@ -52,7 +52,7 @@ typedef std::map<SMESH_TLink, const SMDS_MeshNode*>::iterator ItTLinkNode;
|
|||||||
|
|
||||||
typedef SMDS_Iterator<const TopoDS_Shape*> PShapeIterator;
|
typedef SMDS_Iterator<const TopoDS_Shape*> PShapeIterator;
|
||||||
typedef boost::shared_ptr< PShapeIterator > PShapeIteratorPtr;
|
typedef boost::shared_ptr< PShapeIterator > PShapeIteratorPtr;
|
||||||
|
|
||||||
typedef std::vector<const SMDS_MeshNode* > TNodeColumn;
|
typedef std::vector<const SMDS_MeshNode* > TNodeColumn;
|
||||||
typedef std::map< double, TNodeColumn > TParam2ColumnMap;
|
typedef std::map< double, TNodeColumn > TParam2ColumnMap;
|
||||||
|
|
||||||
@ -561,9 +561,15 @@ public:
|
|||||||
/*!
|
/*!
|
||||||
* \brief Check if the shape set through IsQuadraticSubMesh() or SetSubShape()
|
* \brief Check if the shape set through IsQuadraticSubMesh() or SetSubShape()
|
||||||
* has a degenerated edges
|
* has a degenerated edges
|
||||||
* \retval bool - true if it has
|
* \retval bool - true if there are degenerated edges
|
||||||
*/
|
*/
|
||||||
bool HasDegeneratedEdges() const { return !myDegenShapeIds.empty(); }
|
bool HasDegeneratedEdges() const { return !myDegenShapeIds.empty(); }
|
||||||
|
/*!
|
||||||
|
* \brief Return a number of degenerated edges in the shape set through
|
||||||
|
* IsQuadraticSubMesh() or SetSubShape()
|
||||||
|
* \retval size_t - nb edges
|
||||||
|
*/
|
||||||
|
size_t NbDegeneratedEdges() const { return myDegenShapeIds.size(); }
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Check if shape is a seam edge or it's vertex
|
* \brief Check if shape is a seam edge or it's vertex
|
||||||
@ -610,6 +616,12 @@ public:
|
|||||||
* \retval bool - true if it has
|
* \retval bool - true if it has
|
||||||
*/
|
*/
|
||||||
bool HasRealSeam() const { return HasSeam() && ( *mySeamShapeIds.begin() < 0 ); }
|
bool HasRealSeam() const { return HasSeam() && ( *mySeamShapeIds.begin() < 0 ); }
|
||||||
|
/*!
|
||||||
|
* \brief Return a number of real seam edges in the shape set through
|
||||||
|
* IsQuadraticSubMesh() or SetSubShape(). A real seam edge encounters twice in a wire
|
||||||
|
* \retval size_t - nb of real seams
|
||||||
|
*/
|
||||||
|
size_t NbRealSeam() const;
|
||||||
/*!
|
/*!
|
||||||
* \brief Return index of periodic parametric direction of a closed face
|
* \brief Return index of periodic parametric direction of a closed face
|
||||||
* \retval int - 1 for U, 2 for V direction
|
* \retval int - 1 for U, 2 for V direction
|
||||||
|
@ -95,7 +95,7 @@ SMESH_ProxyMesh::SMESH_ProxyMesh(std::vector<SMESH_ProxyMesh::Ptr>& components):
|
|||||||
|
|
||||||
//================================================================================
|
//================================================================================
|
||||||
/*!
|
/*!
|
||||||
* \brief Destructor deletes proxy submeshes and tmp elemens
|
* \brief Destructor deletes proxy submeshes and tmp elements
|
||||||
*/
|
*/
|
||||||
//================================================================================
|
//================================================================================
|
||||||
|
|
||||||
|
@ -1539,7 +1539,7 @@ SMESHGUI_ComputeOp::SMESHGUI_ComputeOp()
|
|||||||
|
|
||||||
//================================================================================
|
//================================================================================
|
||||||
/*!
|
/*!
|
||||||
* \brief Desctructor
|
* \brief Destructor
|
||||||
*/
|
*/
|
||||||
//================================================================================
|
//================================================================================
|
||||||
|
|
||||||
@ -2158,7 +2158,7 @@ SMESHGUI_EvaluateOp::SMESHGUI_EvaluateOp()
|
|||||||
|
|
||||||
//================================================================================
|
//================================================================================
|
||||||
/*!
|
/*!
|
||||||
* \brief Desctructor
|
* \brief Destructor
|
||||||
*/
|
*/
|
||||||
//================================================================================
|
//================================================================================
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ namespace SMESHOp {
|
|||||||
OpRemoveElemGroupPopup = 2082, // POPUP MENU - REMOVE ELEMENTS FROM GROUP
|
OpRemoveElemGroupPopup = 2082, // POPUP MENU - REMOVE ELEMENTS FROM GROUP
|
||||||
OpMeshInformation = 2100, // MENU MESH - MESH INFORMATION
|
OpMeshInformation = 2100, // MENU MESH - MESH INFORMATION
|
||||||
OpWhatIs = 2101, // MENU MESH - MESH ELEMENT INFORMATION
|
OpWhatIs = 2101, // MENU MESH - MESH ELEMENT INFORMATION
|
||||||
OpStdInfo = 2102, // MENU MESH - MESH STANDART INFORMATION
|
OpStdInfo = 2102, // MENU MESH - MESH STANDARD INFORMATION
|
||||||
OpFindElementByPoint = 2103, // MENU MESH - FIND ELEMENT BY POINT
|
OpFindElementByPoint = 2103, // MENU MESH - FIND ELEMENT BY POINT
|
||||||
OpUpdate = 2200, // POPUP MENU - UPDATE
|
OpUpdate = 2200, // POPUP MENU - UPDATE
|
||||||
// Controls -----------------------//--------------------------------
|
// Controls -----------------------//--------------------------------
|
||||||
|
@ -66,6 +66,7 @@ namespace
|
|||||||
double myDirCoef; // 1. or -1, to make myDir oriented as myNodes in myFace
|
double myDirCoef; // 1. or -1, to make myDir oriented as myNodes in myFace
|
||||||
double myLength; // between nodes
|
double myLength; // between nodes
|
||||||
double myAngleWithPrev; // between myDir and -myPrev->myDir
|
double myAngleWithPrev; // between myDir and -myPrev->myDir
|
||||||
|
double myMinMaxRatio; // of a possible triangle sides
|
||||||
TAngleMap::iterator myAngleMapPos;
|
TAngleMap::iterator myAngleMapPos;
|
||||||
double myOverlapAngle; // angle delta due to overlapping
|
double myOverlapAngle; // angle delta due to overlapping
|
||||||
const SMDS_MeshNode* myNode1Shift; // nodes created to avoid overlapping of faces
|
const SMDS_MeshNode* myNode1Shift; // nodes created to avoid overlapping of faces
|
||||||
@ -87,11 +88,13 @@ namespace
|
|||||||
std::vector<const SMDS_MeshElement*>& newFaces,
|
std::vector<const SMDS_MeshElement*>& newFaces,
|
||||||
const bool isReverse );
|
const bool isReverse );
|
||||||
gp_XYZ GetInFaceDir() const { return myFaceNorm ^ myDir * myDirCoef; }
|
gp_XYZ GetInFaceDir() const { return myFaceNorm ^ myDir * myDirCoef; }
|
||||||
|
double ShapeFactor() const { return 0.5 * ( 1. - myMinMaxRatio ); }
|
||||||
void InsertSelf(TAngleMap& edgesByAngle, bool isReverseFaces, bool reBind, bool useOverlap )
|
void InsertSelf(TAngleMap& edgesByAngle, bool isReverseFaces, bool reBind, bool useOverlap )
|
||||||
{
|
{
|
||||||
if ( reBind ) edgesByAngle.erase( myAngleMapPos );
|
if ( reBind ) edgesByAngle.erase( myAngleMapPos );
|
||||||
double key = (( isReverseFaces ? 2 * M_PI - myAngleWithPrev : myAngleWithPrev )
|
double key = (( isReverseFaces ? 2 * M_PI - myAngleWithPrev : myAngleWithPrev )
|
||||||
+ myOverlapAngle * useOverlap );
|
+ myOverlapAngle * useOverlap
|
||||||
|
+ ShapeFactor() );
|
||||||
myAngleMapPos = edgesByAngle.insert( std::make_pair( key, this ));
|
myAngleMapPos = edgesByAngle.insert( std::make_pair( key, this ));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -163,7 +166,6 @@ namespace
|
|||||||
myFaceNorm *= -1;
|
myFaceNorm *= -1;
|
||||||
myDirCoef *= -1;
|
myDirCoef *= -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//================================================================================
|
//================================================================================
|
||||||
@ -174,21 +176,28 @@ namespace
|
|||||||
|
|
||||||
void BEdge::ComputeAngle( bool theReverseAngle )
|
void BEdge::ComputeAngle( bool theReverseAngle )
|
||||||
{
|
{
|
||||||
myAngleWithPrev = ACos( myDir.Dot( myPrev->myDir.Reversed() ));
|
double dot = myDir.Dot( myPrev->myDir.Reversed() );
|
||||||
|
if ( dot >= 1 ) myAngleWithPrev = 0;
|
||||||
|
else if ( dot <= -1 ) myAngleWithPrev = M_PI;
|
||||||
|
else myAngleWithPrev = acos( dot );
|
||||||
|
|
||||||
bool isObtuse;
|
bool isObtuse;
|
||||||
gp_XYZ inNewFaceDir = myDir - myPrev->myDir;
|
gp_XYZ inFaceDirNew = myDir - myPrev->myDir;
|
||||||
double dot1 = myDir.Dot( myPrev->myFaceNorm );
|
gp_XYZ inFaceDir1 = myPrev->GetInFaceDir();
|
||||||
double dot2 = myPrev->myDir.Dot( myFaceNorm );
|
gp_XYZ inFaceDir2 = this->GetInFaceDir();
|
||||||
bool isOverlap1 = ( inNewFaceDir * myPrev->GetInFaceDir() > 0 );
|
double dot1 = inFaceDirNew * inFaceDir1;
|
||||||
bool isOverlap2 = ( inNewFaceDir * GetInFaceDir() > 0 );
|
double dot2 = inFaceDirNew * inFaceDir2;
|
||||||
|
bool isOverlap1 = ( dot1 > 0 );
|
||||||
|
bool isOverlap2 = ( dot2 > 0 );
|
||||||
if ( !myPrev->myFace )
|
if ( !myPrev->myFace )
|
||||||
isObtuse = isOverlap1;
|
isObtuse = isOverlap1;
|
||||||
else if ( !myFace )
|
else if ( !myFace )
|
||||||
isObtuse = isOverlap2;
|
isObtuse = isOverlap2;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
isObtuse = ( dot1 > 0 || dot2 < 0 ); // suppose face normals point outside the border
|
double dt1 = myDir.Dot( myPrev->myFaceNorm );
|
||||||
|
double dt2 = myPrev->myDir.Dot( myFaceNorm );
|
||||||
|
isObtuse = ( dt1 > 0 || dt2 < 0 ); // suppose face normals point outside the border
|
||||||
if ( theReverseAngle )
|
if ( theReverseAngle )
|
||||||
isObtuse = !isObtuse;
|
isObtuse = !isObtuse;
|
||||||
}
|
}
|
||||||
@ -207,15 +216,22 @@ namespace
|
|||||||
// check if myFace and a triangle built on this and prev edges overlap
|
// check if myFace and a triangle built on this and prev edges overlap
|
||||||
if ( isOverlap1 )
|
if ( isOverlap1 )
|
||||||
{
|
{
|
||||||
double cos2 = dot1 * dot1 / myPrev->myFaceNorm.SquareModulus();
|
double cos2 = dot1 * dot1 / inFaceDirNew.SquareModulus() / inFaceDir1.SquareModulus();
|
||||||
myOverlapAngle += 0.5 * M_PI * ( 1 - cos2 );
|
myOverlapAngle += 1. * M_PI * cos2;
|
||||||
}
|
}
|
||||||
if ( isOverlap2 )
|
if ( isOverlap2 )
|
||||||
{
|
{
|
||||||
double cos2 = dot2 * dot2 / myFaceNorm.SquareModulus();
|
double cos2 = dot2 * dot2 / inFaceDirNew.SquareModulus() / inFaceDir2.SquareModulus();
|
||||||
myOverlapAngle += 0.5 * M_PI * ( 1 - cos2 );
|
myOverlapAngle += 1. * M_PI * cos2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
double len3 = SMESH_NodeXYZ( myPrev->myNode1 ).Distance( myNode2 );
|
||||||
|
double minLen = Min( myLength, Min( myPrev->myLength, len3 ));
|
||||||
|
double maxLen = Max( myLength, Max( myPrev->myLength, len3 ));
|
||||||
|
myMinMaxRatio = minLen / maxLen;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//================================================================================
|
//================================================================================
|
||||||
@ -445,11 +461,12 @@ void SMESH_MeshAlgos::FillHole(const SMESH_MeshAlgos::TFreeBorder & theFreeBord
|
|||||||
while ( edgesByAngle.size() > 2 )
|
while ( edgesByAngle.size() > 2 )
|
||||||
{
|
{
|
||||||
TAngleMap::iterator a2e = edgesByAngle.begin();
|
TAngleMap::iterator a2e = edgesByAngle.begin();
|
||||||
if ( useOverlap && a2e->first > M_PI - angTol ) // all new triangles need shift
|
edge = a2e->second;
|
||||||
|
if ( useOverlap &&
|
||||||
|
a2e->first - edge->ShapeFactor() > M_PI - angTol ) // all new triangles need shift
|
||||||
{
|
{
|
||||||
// re-sort the edges
|
// re-sort the edges w/o overlap consideration
|
||||||
useOverlap = false;
|
useOverlap = false;
|
||||||
edge = a2e->second;
|
|
||||||
nbEdges = edgesByAngle.size();
|
nbEdges = edgesByAngle.size();
|
||||||
edgesByAngle.clear();
|
edgesByAngle.clear();
|
||||||
for ( size_t i = 0; i < nbEdges; ++i, edge = edge->myNext )
|
for ( size_t i = 0; i < nbEdges; ++i, edge = edge->myNext )
|
||||||
|
@ -149,7 +149,6 @@ struct SMESH_OrientedLink: public SMESH_TLink
|
|||||||
struct SMESH_TNodeXYZ : public gp_XYZ
|
struct SMESH_TNodeXYZ : public gp_XYZ
|
||||||
{
|
{
|
||||||
const SMDS_MeshNode* _node;
|
const SMDS_MeshNode* _node;
|
||||||
double _xyz[3];
|
|
||||||
SMESH_TNodeXYZ( const SMDS_MeshElement* e=0):gp_XYZ(0,0,0),_node(0)
|
SMESH_TNodeXYZ( const SMDS_MeshElement* e=0):gp_XYZ(0,0,0),_node(0)
|
||||||
{
|
{
|
||||||
Set(e);
|
Set(e);
|
||||||
@ -159,15 +158,14 @@ struct SMESH_TNodeXYZ : public gp_XYZ
|
|||||||
if (e) {
|
if (e) {
|
||||||
assert( e->GetType() == SMDSAbs_Node );
|
assert( e->GetType() == SMDSAbs_Node );
|
||||||
_node = static_cast<const SMDS_MeshNode*>(e);
|
_node = static_cast<const SMDS_MeshNode*>(e);
|
||||||
_node->GetXYZ(_xyz); // - thread safe getting coords
|
_node->GetXYZ( ChangeData() ); // - thread safe getting coords
|
||||||
SetCoord( _xyz[0], _xyz[1], _xyz[2] );
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
double Distance(const SMDS_MeshNode* n) const { return (SMESH_TNodeXYZ( n )-*this).Modulus(); }
|
double Distance(const SMDS_MeshNode* n) const { return (SMESH_TNodeXYZ( n )-*this).Modulus(); }
|
||||||
double SquareDistance(const SMDS_MeshNode* n) const { return (SMESH_TNodeXYZ( n )-*this).SquareModulus(); }
|
double SquareDistance(const SMDS_MeshNode* n) const { return (SMESH_TNodeXYZ( n )-*this).SquareModulus(); }
|
||||||
bool operator==(const SMESH_TNodeXYZ& other) const { return _node == other._node; }
|
bool operator==(const SMESH_TNodeXYZ& other) const { return _node == other._node; }
|
||||||
};
|
};
|
||||||
typedef SMESH_TNodeXYZ SMESH_NodeXYZ;
|
typedef SMESH_TNodeXYZ SMESH_NodeXYZ;
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ using SMESH::TPythonDump;
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Container of commands into which the initial script is split.
|
* \brief Container of commands into which the initial script is split.
|
||||||
* It also contains data coresponding to SMESH_Gen contents
|
* It also contains data corresponding to SMESH_Gen contents
|
||||||
*/
|
*/
|
||||||
static Handle(_pyGen) theGen;
|
static Handle(_pyGen) theGen;
|
||||||
|
|
||||||
|
@ -3812,7 +3812,7 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent,
|
|||||||
// "Face V positions" - V parameter of node on face
|
// "Face V positions" - V parameter of node on face
|
||||||
|
|
||||||
// Find out nb of nodes on edges and faces
|
// Find out nb of nodes on edges and faces
|
||||||
// Collect corresponing sub-meshes
|
// Collect corresponding sub-meshes
|
||||||
int nbEdgeNodes = 0, nbFaceNodes = 0;
|
int nbEdgeNodes = 0, nbFaceNodes = 0;
|
||||||
list<SMESHDS_SubMesh*> aEdgeSM, aFaceSM;
|
list<SMESHDS_SubMesh*> aEdgeSM, aFaceSM;
|
||||||
// loop on SMESHDS_SubMesh'es
|
// loop on SMESHDS_SubMesh'es
|
||||||
|
@ -953,6 +953,10 @@ class StdMeshersBuilder_Prism3D(Mesh_Algorithm):
|
|||||||
## doc string of the method
|
## doc string of the method
|
||||||
# @internal
|
# @internal
|
||||||
docHelper = "Creates prism 3D algorithm for volumes"
|
docHelper = "Creates prism 3D algorithm for volumes"
|
||||||
|
## flag pointing whether this algorithm should be used by default in dynamic method
|
||||||
|
# of smeshBuilder.Mesh class
|
||||||
|
# @internal
|
||||||
|
isDefault = True
|
||||||
|
|
||||||
## Private constructor.
|
## Private constructor.
|
||||||
# @param mesh parent mesh object algorithm is assigned to
|
# @param mesh parent mesh object algorithm is assigned to
|
||||||
|
@ -2303,10 +2303,10 @@ class Mesh:
|
|||||||
return self.editor.MakeIDSource(ids, elemType)
|
return self.editor.MakeIDSource(ids, elemType)
|
||||||
|
|
||||||
|
|
||||||
# Get informations about mesh contents:
|
# Get information about mesh contents:
|
||||||
# ------------------------------------
|
# ------------------------------------
|
||||||
|
|
||||||
## Get the mesh stattistic
|
## Get the mesh statistic
|
||||||
# @return dictionary type element - count of elements
|
# @return dictionary type element - count of elements
|
||||||
# @ingroup l1_meshinfo
|
# @ingroup l1_meshinfo
|
||||||
def GetMeshInfo(self, obj = None):
|
def GetMeshInfo(self, obj = None):
|
||||||
@ -4924,12 +4924,12 @@ class Mesh:
|
|||||||
|
|
||||||
## Identify the elements that will be affected by node duplication (actual duplication is not performed.
|
## Identify the elements that will be affected by node duplication (actual duplication is not performed.
|
||||||
# This method is the first step of DoubleNodeElemGroupsInRegion.
|
# This method is the first step of DoubleNodeElemGroupsInRegion.
|
||||||
# @param theElems - list of groups of elements (edges or faces) to be replicated
|
# @param theElems - list of groups of nodes or elements (edges or faces) to be replicated
|
||||||
# @param theNodesNot - list of groups of nodes not to replicated
|
# @param theNodesNot - list of groups of nodes not to replicated
|
||||||
# @param theShape - shape to detect affected elements (element which geometric center
|
# @param theShape - shape to detect affected elements (element which geometric center
|
||||||
# located on or inside shape).
|
# located on or inside shape).
|
||||||
# The replicated nodes should be associated to affected elements.
|
# The replicated nodes should be associated to affected elements.
|
||||||
# @return groups of affected elements
|
# @return groups of affected elements in order: volumes, faces, edges
|
||||||
# @ingroup l2_modif_duplicat
|
# @ingroup l2_modif_duplicat
|
||||||
def AffectedElemGroupsInRegion(self, theElems, theNodesNot, theShape):
|
def AffectedElemGroupsInRegion(self, theElems, theNodesNot, theShape):
|
||||||
return self.editor.AffectedElemGroupsInRegion(theElems, theNodesNot, theShape)
|
return self.editor.AffectedElemGroupsInRegion(theElems, theNodesNot, theShape)
|
||||||
|
@ -191,7 +191,7 @@ namespace {
|
|||||||
theTShapeToLengthMap.insert( make_pair( getTShape( edge ), L ));
|
theTShapeToLengthMap.insert( make_pair( getTShape( edge ), L ));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Compute S0 - minimal segement length, is computed by the shortest EDGE
|
// Compute S0 - minimal segment length, is computed by the shortest EDGE
|
||||||
|
|
||||||
/* image attached to PAL10237
|
/* image attached to PAL10237
|
||||||
|
|
||||||
|
@ -604,7 +604,7 @@ namespace
|
|||||||
theSinuEdges [0].size() > 0 && theSinuEdges [1].size() > 0 );
|
theSinuEdges [0].size() > 0 && theSinuEdges [1].size() > 0 );
|
||||||
|
|
||||||
// the sinuous EDGEs can be composite and C0 continuous,
|
// the sinuous EDGEs can be composite and C0 continuous,
|
||||||
// therefor we use a complex criterion to find TWO short non-sinuous EDGEs
|
// therefore we use a complex criterion to find TWO short non-sinuous EDGEs
|
||||||
// and the rest EDGEs will be treated as sinuous.
|
// and the rest EDGEs will be treated as sinuous.
|
||||||
// A short edge should have the following features:
|
// A short edge should have the following features:
|
||||||
// a) straight
|
// a) straight
|
||||||
|
@ -4593,7 +4593,7 @@ int StdMeshers_Quadrangle_2D::getCorners(const TopoDS_Face& theFace,
|
|||||||
{
|
{
|
||||||
d = Abs( idealLen - accuLength[ iEV ]);
|
d = Abs( idealLen - accuLength[ iEV ]);
|
||||||
|
|
||||||
// take into account presence of a coresponding halfDivider
|
// take into account presence of a corresponding halfDivider
|
||||||
const double cornerWgt = 0.5 / nbSides;
|
const double cornerWgt = 0.5 / nbSides;
|
||||||
const double vertexWgt = 0.25 / nbSides;
|
const double vertexWgt = 0.25 / nbSides;
|
||||||
TGeoIndex hd = halfDivider[ evVec[ iEV ]];
|
TGeoIndex hd = halfDivider[ evVec[ iEV ]];
|
||||||
|
@ -429,7 +429,7 @@ CORBA::Long MeshJobManager_i::initialize(const MESHJOB::MeshJobFileList & meshJo
|
|||||||
//jobParameters->maximum_duration = CORBA::string_dup("01:00");
|
//jobParameters->maximum_duration = CORBA::string_dup("01:00");
|
||||||
jobParameters->queue = CORBA::string_dup("");
|
jobParameters->queue = CORBA::string_dup("");
|
||||||
|
|
||||||
// Setting resource and additionnal properties (if needed)
|
// Setting resource and additional properties (if needed)
|
||||||
// The resource parameters can be initiated from scratch, for
|
// The resource parameters can be initiated from scratch, for
|
||||||
// example by specifying the values in hard coding:
|
// example by specifying the values in hard coding:
|
||||||
// >>>
|
// >>>
|
||||||
@ -451,7 +451,7 @@ CORBA::Long MeshJobManager_i::initialize(const MESHJOB::MeshJobFileList & meshJo
|
|||||||
resourceDefinition = _resourcesManager->GetResourceDefinition(resourceName);
|
resourceDefinition = _resourcesManager->GetResourceDefinition(resourceName);
|
||||||
}
|
}
|
||||||
catch (const CORBA::SystemException& ex) {
|
catch (const CORBA::SystemException& ex) {
|
||||||
_lastErrorMessage = std::string("We can not access to the ressource ") + std::string(resourceName);
|
_lastErrorMessage = std::string("We can not access the resource ") + std::string(resourceName);
|
||||||
_lastErrorMessage+= std::string("(check the file CatalogResource.xml)");
|
_lastErrorMessage+= std::string("(check the file CatalogResource.xml)");
|
||||||
LOG(_lastErrorMessage);
|
LOG(_lastErrorMessage);
|
||||||
return JOBID_UNDEFINED;
|
return JOBID_UNDEFINED;
|
||||||
@ -462,7 +462,7 @@ CORBA::Long MeshJobManager_i::initialize(const MESHJOB::MeshJobFileList & meshJo
|
|||||||
// Then, the values can be used to initiate the resource parameters
|
// Then, the values can be used to initiate the resource parameters
|
||||||
// of the job:
|
// of the job:
|
||||||
jobParameters->resource_required.name = CORBA::string_dup(resourceDefinition->name.in());
|
jobParameters->resource_required.name = CORBA::string_dup(resourceDefinition->name.in());
|
||||||
// CAUTION: the additionnal two following parameters MUST be
|
// CAUTION: the additional two following parameters MUST be
|
||||||
// specified explicitly, because they are not provided by the
|
// specified explicitly, because they are not provided by the
|
||||||
// resource definition:
|
// resource definition:
|
||||||
jobParameters->resource_required.mem_mb = resourceDefinition->mem_mb;
|
jobParameters->resource_required.mem_mb = resourceDefinition->mem_mb;
|
||||||
@ -682,7 +682,7 @@ std::vector<std::string> * MeshJobManager_i::_getResourceNames() {
|
|||||||
// SALOME application.
|
// SALOME application.
|
||||||
// In the code instructions, you just have to choose a resource
|
// In the code instructions, you just have to choose a resource
|
||||||
// configuration by its name and then define the ResourceParameters
|
// configuration by its name and then define the ResourceParameters
|
||||||
// that specify additionnal properties for a specific job submission
|
// that specify additional properties for a specific job submission
|
||||||
// (use the attribute resource_required of the JobParameters).
|
// (use the attribute resource_required of the JobParameters).
|
||||||
|
|
||||||
return resourceNames;
|
return resourceNames;
|
||||||
|
@ -73,7 +73,7 @@ private:
|
|||||||
Engines::ResourcesManager_var _resourcesManager;
|
Engines::ResourcesManager_var _resourcesManager;
|
||||||
|
|
||||||
// This maps the config identifier to the config parameters. A
|
// This maps the config identifier to the config parameters. A
|
||||||
// config is a resource with additionnal data specifying the
|
// config is a resource with additional data specifying the
|
||||||
// location of the binary program to be executed by the task
|
// location of the binary program to be executed by the task
|
||||||
std::map<std::string, MESHJOB::ConfigParameter> _configMap;
|
std::map<std::string, MESHJOB::ConfigParameter> _configMap;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user