IF(EXISTS ${KERNEL_ROOT_DIR})
LIST(APPEND CMAKE_MODULE_PATH "${KERNEL_ROOT_DIR}/salome_adm/cmake_files")
FIND_PACKAGE(SalomeKERNEL REQUIRED)
- KERNEL_WITH_CORBA() #check whether KERNEL builded with CORBA
+ KERNEL_WITH_CORBA() #check whether KERNEL built with CORBA
ADD_DEFINITIONS(${KERNEL_DEFINITIONS})
INCLUDE_DIRECTORIES(${KERNEL_INCLUDE_DIRS})
ELSE(EXISTS ${KERNEL_ROOT_DIR})
IF(EXISTS ${GUI_ROOT_DIR})
LIST(APPEND CMAKE_MODULE_PATH "${GUI_ROOT_DIR}/adm_local/cmake_files")
FIND_PACKAGE(SalomeGUI)
- SALOME_GUI_WITH_CORBA() #check whether GUI builded with CORBA
+ SALOME_GUI_WITH_CORBA() #check whether GUI built with CORBA
SALOME_GUI_MODE(SALOME_USE_VTKVIEWER SALOME_USE_SALOMEOBJECT
OPTIONAL SALOME_USE_PLOT2DVIEWER SALOME_USE_PYCONSOLE)
##
proj3D.SourceShape3D( box, src_mesh, v1F1, v1F2, v2F1, v2F2 )
tgt_mesh.Compute()
-# Move the source mesh to visualy compare the two meshes
+# Move the source mesh to visually compare the two meshes
src_mesh.TranslateObject( src_mesh, smesh.MakeDirStruct( 210, 0, 0 ), Copy=False)
# get number of the edges not belonging to the group with the given color
filter = smesh.GetFilter(SMESH.EDGE, SMESH.FT_GroupColor, c, SMESH.FT_LogicalNOT)
ids = mesh.GetIdsFromFilter(filter)
-print("Number of edges not beloging to the group with color (0.1, 0.5, 1.0):", len(ids))
+print ("Number of edges not belonging to the group with color (0.1, 0.5, 1.0):", len(ids))
Quadrangle_2D = Mesh1.Quadrangle()
isDone = Mesh1.Compute()
-#Perform scale opration for the whole mesh and creation of a new mesh
+#Perform scale operation for the whole mesh and creation of a new mesh
newMesh = Mesh1.ScaleMakeMesh(Mesh1,SMESH.PointStruct(100,100,200),[0.5,0.3,0.7],True,"ScaledMesh")
#Perform scale operation for the whole mesh and copy elements
Mesh1.Scale(Mesh1,SMESH.PointStruct(200,100,100),[0.5,0.5,0.5],True,True)
-#Perform scale opration for two edges and move elements
+#Perform scale operation for two edges and move elements
Mesh1.Scale([1,2],SMESH.PointStruct(-100,100,100),[0.8,1.0,0.7],False)
-#Perform scale opration for one face and move elements
+#Perform scale operation for one face and move elements
Mesh1.Scale([21],SMESH.PointStruct(0,200,200),[0.7,0.7,0.7],False)
action="store_true", default=False,
help=h)
h = "Format of the documentation strings in the output file. Possible values are: "
- h+= "'doxygen' - documentation strings are generated in the doxygen format, before a method defenition."
- h+= "'sphinx' - documentation strings are generated in the sphinx format, after a method defenition."
+ h+= "'doxygen' - documentation strings are generated in the doxygen format, before a method definition."
+ h+= "'sphinx' - documentation strings are generated in the sphinx format, after a method definition."
parser.add_argument("-f", "--format", dest="format",
action="store", default="doxygen", help=h)
#. The first line indicates the total number of pattern nodes (N).
#. The next N lines describe nodes coordinates. Each line contains 2 node coordinates for a 2D pattern or 3 node coordinates for a 3D pattern. Note, that node coordinates of a 3D pattern can be defined only by relative values in range [0;1].
#. The key-points line contains the indices of the nodes to be mapped on geometrical vertices (for a 2D pattern only). Index n refers to the node described on the n-th line of section 2. The index of the first node is zero. For a 3D pattern the key points are not specified.
- #. The remaining lines describe nodal connectivity of elements, one line for each element. Each line holds indices of nodes forming an element. Index n refers to the node described on the n-th line of section 2. The first node index is zero. There must be 3 or 4 indices on each line for a 2D pattern (only liner 2d elements are allowed) and 4, 5, 6 or 8 indices for a 3D pattern (only linear 3d elements are allowed).
+ #. The remaining lines describe nodal connectivity of elements, one line for each element. Each line holds indices of nodes forming an element. Index n refers to the node described on the n-th line of section 2. The first node index is zero. There must be 3 or 4 indices on each line for a 2D pattern (only linear 2D elements are allowed) and 4, 5, 6 or 8 indices for a 3D pattern (only linear 3D elements are allowed).
A 2D pattern must contain at least one element and at least one key-point. All key-points must lie on boundaries.
When a pattern is created from an existing mesh, two cases are possible:
-* A sub-mesh on a face/solid is selected. The pattern is created from the 2d/3d elements bound to the face/solid by the mesher. For a 2D pattern, the node coordinates are either "positions on face" computed by the mesher, or coordinates got by node projection on a geometrical surface, according to the user choice. For a 3D pattern, the node coordinates correspond to the nodes computed by the mesher.
-* A mesh, where the main shape is a face/solid, is selected. The pattern is created from all 2d/3d elements in a mesh. In addition, if all mesh elements of a 2D pattern are built by the mesher, the user can select how to get node coordinates, otherwise all nodes are projected on a face surface.
+* A sub-mesh on a face/solid is selected. The pattern is created from the 2D/3D elements bound to the face/solid by the mesher. For a 2D pattern, the node coordinates are either "positions on face" computed by the mesher, or coordinates got by node projection on a geometrical surface, according to the user choice. For a 3D pattern, the node coordinates correspond to the nodes computed by the mesher.
+* A mesh, where the main shape is a face/solid, is selected. The pattern is created from all 2D/3D elements in a mesh. In addition, if all mesh elements of a 2D pattern are built by the mesher, the user can select how to get node coordinates, otherwise all nodes are projected on a face surface.
Mapping algorithm
* apply Filters. **Set filter** button allows to apply a filter to the selection of elements. See more about filters in the :ref:`selection_filter_library_page` page.
* specify the axis of rotation:
- * specify the cooordinates of the start **Point** of the vector of rotation;
+ * specify the coordinates of the start **Point** of the vector of rotation;
* specify the **Vector** of rotation through the coordinates of its end point with respect to the coordinates of the start point;
* specify the **Angle** of rotation
Compound1 = smesh.Concatenate([Mesh_inf.GetMesh(), Mesh_sup.GetMesh()], 0, 1, 1e-05)
-* If you need to **import a SMESH Plugin** explicitly, keep in mind that they are now located in separate namespaces.
+* If you need to **import a SMESH Plugin** explicitly, keep in mind that they are now located in separate namespaces.
For instance::
:linenos:
from salome.smesh import smeshBuilder
- smesh = smeshBuilder.New( salome.myStudy )
+ smesh = smeshBuilder.New()
#. Create a :class:`smeshBuilder.Mesh` object:
* bi-quadratic triangle will be split into 3 linear quadrangles;
* bi-quadratic quadrangle will be split into 4 linear quadrangles;
* tri-quadratic hexahedron will be split into 8 linear hexahedra;
-* quadratic segments adjacent to the split bi-quadratic element will be split into 2 liner segments.
+* quadratic segments adjacent to the split bi-quadratic element will be split into 2 linear segments.
.. image:: ../images/split_biquad_to_linear_mesh.png
:align: center
* if the mesh is mirrored through a plane:
- * specify the cooordinates of the **Point** lying on the plane, either directly or by picking a mesh node;
+ * specify the coordinates of the **Point** lying on the plane, either directly or by picking a mesh node;
* specify the components of plane **Normal**, either directly or by picking a mesh node, in which case **Normal** is defined as a shift between the **Point** and the node.
* specify the conditions of symmetry operation:
* specify the vector of translation:
- * specify the cooordinates of the start and end **Points** of the vector of translation; or
+ * specify the coordinates of the start and end **Points** of the vector of translation; or
* specify the end point of the **Vector** of rotation starting at the origin of coordinates.
* specify the conditions of translation:
filters mesh elements basing on the same set of nodes:
-* element type is either *SMESH.EGDE*, *SMESH.FACE* or *SMESH.VOLUME*
+* element type is either *SMESH.EDGE*, *SMESH.FACE* or *SMESH.VOLUME*
* functor type is either *SMESH.FT_EqualEdges*, *SMESH.FT_EqualFaces* or *SMESH.FT_EqualVolumes*,
* threshold value is not required
dynamic_module_name = module_name + DYNAMIC_MODULE_SUFFIX
try:
exec( "import %s" % oringin_module_name )
- exec( "origin_module = %s" % oringin_module_name )
+ origin_module = locals()[ oringin_module_name ]
origin_module_lines = inspect.getsourcelines( origin_module )[0]
origin_meshClass_lines = inspect.getsourcelines(origin_module.Mesh)[0]
origin_module_text = "".join( origin_module_lines )
origin_meshClass_text = "".join( origin_meshClass_lines )
exec( "import %s" % dynamic_module_name )
- exec( "dynanmic_module = %s" % dynamic_module_name )
+ dynanmic_module = locals()[ dynamic_module_name ]
dynanmic_meshClass = dynanmic_module.Mesh
new_meshClass_lines = copy.copy(origin_meshClass_lines)
dynanmic_meshClass_methods = [x for x, y in dynanmic_meshClass.__dict__.items() if type(y) == FunctionType]
for method in dynanmic_meshClass_methods:
exec( "method_lines = inspect.getsourcelines(dynanmic_module.Mesh.%s)[0]" % method)
- new_meshClass_lines+=method_lines
+ new_meshClass_lines+=locals()['method_lines']
pass
new_meshClass_text = "".join( new_meshClass_lines )
HYP_UNKNOWN_FATAL,// --- all statuses below should be considered as fatal
// for Add/RemoveHypothesis operations
HYP_INCOMPATIBLE, // hypothesis does not fit algo
- HYP_NOTCONFORM, // not conform mesh is produced appling a hypothesis
+ HYP_NOTCONFORM, // not conform mesh is produced applying a hypothesis
HYP_ALREADY_EXIST,// such hypothesis already exist
HYP_BAD_DIM, // bad dimension
HYP_BAD_SUBSHAPE, // shape is neither the main one, nor its sub-shape, nor a group
* \param NbOfSteps - number of elements to generate from one element
* \param ToMakeGroups - if true, new elements will be included into new groups
* corresponding to groups the input elements included in.
- * \return ListOfGroups - new groups craeted if \a ToMakeGroups is true
+ * \return ListOfGroups - new groups created if \a ToMakeGroups is true
*/
ListOfGroups RotationSweepObjects(in ListOfIDSources Nodes,
in ListOfIDSources Edges,
* \param nbOfSteps - number of elements to generate from one element
* \param toMakeGroups - if true, new elements will be included into new groups
* corresponding to groups the input elements included in.
- * \return ListOfGroups - new groups craeted if \a toMakeGroups is true
+ * \return ListOfGroups - new groups created if \a toMakeGroups is true
*/
ListOfGroups ExtrusionSweepObjects(in ListOfIDSources nodes,
in ListOfIDSources edges,
* EXTRUSION_FLAG_SEW is set
* \param ToMakeGroups - if true, new elements will be included into new groups
* corresponding to groups the input elements included in.
- * \return ListOfGroups - new groups craeted if \a ToMakeGroups is true
+ * \return ListOfGroups - new groups created if \a ToMakeGroups is true
*/
ListOfGroups AdvancedExtrusion(in long_array IDsOfElements,
in DirStruct StepVector,
/*!
* Return nodal connectivity of the elements of the pattern
- * or of all elements to be crated
+ * or of all elements to be created
*/
array_of_long_array GetElementPoints(in boolean all);
};
return -1;
unsigned long freeRamKb = ( si.freeram * si.mem_unit ) / 1024;
- // totat RAM size in Gb, float is in order not to have 1 instead of 1.9
+ // total RAM size in Gb, float is in order not to have 1 instead of 1.9
float totalramGb = float( si.totalram * si.mem_unit ) / 1024 / 1024 / 1024;
- // nb Kbites to allocate at one step. Small nb leads to hung up
+ // nb Kbytes to allocate at one step. Small nb leads to hung up
const int stepKb = int( 5 * totalramGb );
unsigned long nbSteps = freeRamKb / stepKb * 2;
//================================================================================
/*!
* \brief Raise an exception if free memory (ram+swap) too low
- * \param doNotRaise - if true, suppres exception, just return free memory size
+ * \param doNotRaise - if true, suppress exception, just return free memory size
* \retval int - amount of available memory in MB or negative number in failure case
*/
//================================================================================
/*!
* \brief Raise an exception if free memory (ram+swap) too low
- * \param doNotRaise - if true, suppres exception, just return free memory size
+ * \param doNotRaise - if true, suppress exception, just return free memory size
* \retval int - amount of available memory in MB or negative number in failure case
*/
static int CheckMemory(const bool doNotRaise=false) throw (std::bad_alloc);
if ( !fIt->more() )
return MEr_EMPTY;
- // We check that only links on EDGEs encouter once, the rest links, twice
+ // We check that only links on EDGEs encounter once, the rest links, twice
set< SMESH_TLink > links;
while ( fIt->more() )
{
//=============================================================================
/*!
- * Genarate a new id unique within this Gen
+ * Generate a new id unique within this Gen
*/
//=============================================================================
//================================================================================
/*!
- * \brief Constructor accesible to SMESH_Mesh only
+ * \brief Constructor accessible to SMESH_Mesh only
*/
//================================================================================
HYP_UNKNOWN_FATAL,// --- all statuses below should be considered as fatal
// for Add/RemoveHypothesis operations
HYP_INCOMPATIBLE, // hypothesis does not fit algo
- HYP_NOTCONFORM, // not conform mesh is produced appling a hypothesis
+ HYP_NOTCONFORM, // not conform mesh is produced applying a hypothesis
HYP_ALREADY_EXIST,// several applicable hypothesis of same priority assigned
HYP_BAD_DIM, // bad dimension
HYP_BAD_SUBSHAPE, // shape is neither the main one, nor its sub-shape, nor a group
const SMDS_MeshElement* newElem1 = 0;
const SMDS_MeshElement* newElem2 = 0;
- if ( !elem->IsQuadratic() ) // split liner quadrangle
+ if ( !elem->IsQuadratic() ) // split linear quadrangle
{
// for MaxElementLength2D functor we return minimum diagonal for splitting,
// because aBadRate1=2*len(diagonal 1-3); aBadRate2=2*len(diagonal 2-4)
//=======================================================================
//function : GetProjector
-//purpose : Return projector intitialized by given face without location, which is returned
+//purpose : Return projector initialized by given face without location, which is returned
//=======================================================================
GeomAPI_ProjectPointOnSurf& SMESH_MesherHelper::GetProjector(const TopoDS_Face& F,
for ( size_t i = 0; i < nodes.size(); ++n, ++i )
nodes[ i ] = *n;
- // avoid elems on degenarate shapes as UV on them can be wrong
+ // avoid elems on degenerate shapes as UV on them can be wrong
if ( helper.HasDegeneratedEdges() )
{
bool isOnDegen = false;
/*!
* \brief To set created elements on the shape set by IsQuadraticSubMesh()
- * or the next methods. By defaul elements are set on the shape if
+ * or the next methods. By default elements are set on the shape if
* a mesh has no shape to be meshed
*/
bool SetElementsOnShape(bool toSet)
bool GetNodeUVneedInFaceNode(const TopoDS_Face& F = TopoDS_Face()) const;
/*!
- * \brief Return projector intitialized by given face without location, which is returned
+ * \brief Return projector initialized by given face without location, which is returned
*/
GeomAPI_ProjectPointOnSurf& GetProjector(const TopoDS_Face& F,
TopLoc_Location& loc,
* \retval bool - true if subShape is a seam shape
*
* It works only if IsQuadraticSubMesh() or SetSubShape() has been called.
- * Seam shape has two 2D alternative represenations on the face
+ * Seam shape has two 2D alternative representations on the face
*/
bool IsSeamShape(const int subShape) const
{ return mySeamShapeIds.find( subShape ) != mySeamShapeIds.end(); }
* \retval bool - true if subShape is a seam shape
*
* It works only if IsQuadraticSubMesh() or SetSubShape() has been called.
- * Seam shape has two 2D alternative represenations on the face
+ * Seam shape has two 2D alternative representations on the face
*/
bool IsSeamShape(const TopoDS_Shape& subShape) const
{ return IsSeamShape( ShapeToIndex( subShape )); }
// MakeMesh
ERR_MAKEM_NOT_COMPUTED, // mapping failed
//Unexpected error
- ERR_UNEXPECTED // Unexpected of the pattern mapping alorithm
+ ERR_UNEXPECTED // Unexpected of the pattern mapping algorithm
};
ErrorCode GetErrorCode() const { return myErrorCode; }
/*
Class : SMESHGUI_FilterTable
- Description : Frame containig
+ Description : Frame containing
- Button group for switching entity type
- Table for displaying filter criterions
- Buttons for editing table and filter libraries
/*!
* Class : SMESHGUI_FilterTable
- * Description : Frame containig
+ * Description : Frame containing
* - Button group for switching entity type
* - Table for displaying filter criterions
* - Buttons for editing table
/*!
\brief Resets state of the dialog, initializes its fields with default value, etc.
Usually called by onApply() slot to reinitialize dialog fields. This virtual method
- should be redefined in derived class to update its own fileds
+ should be redefined in derived class to update its own fields
*/
void SMESHGUI_GroupOpDlg::reset()
{
myWidgets[i3DHexaPrisms][iTotal] ->setProperty( "text", QString::number( info[SMDSEntity_Hexagonal_Prism] ));
myWidgets[i3DPolyhedrons][iTotal] ->setProperty( "text", QString::number( info[SMDSEntity_Polyhedra] ));
long nbElemTotal = info[SMDSEntity_0D] + info[SMDSEntity_Ball] + nbEdges + nb2DTotal + nb3DTotal;
- long nbElemLinerial = info[SMDSEntity_Edge] + nb2DLinear + nb3DLinear;
+ long nbElemLinearial = info[SMDSEntity_Edge] + nb2DLinear + nb3DLinear;
long nbElemQuadratic = info[SMDSEntity_Quad_Edge] + nb2DQuadratic + nb3DQuadratic;
long nbElemBiQuadratic = nb2DBiQuadratic + nb3DBiQuadratic;
myWidgets[iNb][iTotal] ->setProperty( "text", QString::number( nbElemTotal ));
- myWidgets[iNb][iLinear] ->setProperty( "text", QString::number( nbElemLinerial ));
+ myWidgets[iNb][iLinear] ->setProperty( "text", QString::number( nbElemLinearial ));
myWidgets[iNb][iQuadratic] ->setProperty( "text", QString::number( nbElemQuadratic ));
myWidgets[iNb][iBiQuadratic]->setProperty( "text", QString::number( nbElemBiQuadratic ));
// before full loading from study file, type of elements in a sub-mesh can't be defined
//=======================================================================
/*!
- * \brief Dialog to reorient faces acoording to vector
+ * \brief Dialog to reorient faces according to vector
*/
//=======================================================================
class SMESHGUI_ReorientFacesDlg;
/*!
- * \brief Operation to reorient faces acoording to some criterion
+ * \brief Operation to reorient faces according to some criterion
*/
class SMESHGUI_EXPORT SMESHGUI_ReorientFacesOp: public SMESHGUI_SelectionOp
{
};
/*!
- * \brief Dialog to reorient faces acoording to vector
+ * \brief Dialog to reorient faces according to vector
*/
class SMESHGUI_EXPORT SMESHGUI_ReorientFacesDlg : public SMESHGUI_Dialog
myHasSolids = nbShapes[ TopAbs_SOLID ];
}
- // disable inexistant elem types
+ // disable inexistent elem types
for ( int i = 0; i < myDlg->myElemTypeGroup->buttons().count(); ++i ) {
if ( QAbstractButton* button = myDlg->myElemTypeGroup->button( i ) )
button->setEnabled( hasElement[ i ] );
if(SMESH_Actor *anActor = dynamic_cast<SMESH_Actor*>(anAct)){
if(anActor->hasIO())
if (!Update(anActor->getIO(),anActor->GetVisibility()))
- break; // avoid multiple warinings if visu failed
+ break; // avoid multiple warnings if visu failed
}
}
}
{
Handle(SALOME_InteractiveObject) anIO = anIter.Value();
if ( !Update( anIO, true ))
- break; // avoid multiple warinings if visu failed
+ break; // avoid multiple warnings if visu failed
if ( withChildrenOfSelected ) // update all visible children
{
//================================================================================
/*!
* \brief Find all SMESH_Actor's in the View Window.
- * If actor constains Plot2d_Histogram object remove it from each Plot2d Viewer.
+ * If actor contains Plot2d_Histogram object remove it from each Plot2d Viewer.
*/
//================================================================================
}
}
- // refine solution using half-division technic
+ // refine solution using half-division technique
gp_XYZ sol = theParams;
//function : LoadBlockShapes
//purpose : Initialize block geometry with theShell,
// add sub-shapes of theBlock to theShapeIDMap so that they get
-// IDs acoording to enum TShapeID
+// IDs according to enum TShapeID
//=======================================================================
bool SMESH_Block::LoadBlockShapes(const TopoDS_Shell& theShell,
//=======================================================================
//function : LoadBlockShapes
//purpose : add sub-shapes of theBlock to theShapeIDMap so that they get
-// IDs acoording to enum TShapeID
+// IDs according to enum TShapeID
//=======================================================================
bool SMESH_Block::FindBlockShapes(const TopoDS_Shell& theShell,
TopTools_IndexedMapOfOrientedShape& theShapeIDMap );
// Initialize block geometry with theShell,
// add sub-shapes of theBlock to theShapeIDMap so that they get
- // IDs acoording to enum TShapeID
+ // IDs according to enum TShapeID
bool LoadBlockShapes(const TopTools_IndexedMapOfOrientedShape& theShapeIDMap);
// Initialize block geometry with shapes from theShapeIDMap
const TopoDS_Vertex& theVertex001,
TopTools_IndexedMapOfOrientedShape& theShapeIDMap );
// add sub-shapes of theBlock to theShapeIDMap so that they get
- // IDs acoording to enum TShapeID
+ // IDs according to enum TShapeID
public:
// ---------------------------------
//================================================================================
/*!
* \brief Replaces "SMESH.PointStruct(x,y,z)" and "SMESH.DirStruct( SMESH.PointStruct(x,y,z))"
- * arguments of a given command by a list "[x,y,z]" if the list is accesible
+ * arguments of a given command by a list "[x,y,z]" if the list is accessible
* type of argument.
*/
//================================================================================
//================================================================================
/*!
* \brief Replaces "mesh.GetIDSource([id1,id2])" argument of a given command by
- * a list "[id1,id2]" if the list is an accesible type of argument.
+ * a list "[id1,id2]" if the list is an accessible type of argument.
*/
//================================================================================
ASSERT( meshServant );
if ( meshServant ) {
meshServant->Load();
- // NPAL16168: "geometrical group edition from a submesh don't modifiy mesh computation"
+ // NPAL16168: "geometrical group edition from a submesh don't modify mesh computation"
meshServant->CheckGeomModif();
// get local TopoDS_Shape
TopoDS_Shape myLocShape;
meshServant->Load();
ASSERT( meshServant );
if ( meshServant ) {
- // NPAL16168: "geometrical group edition from a submesh don't modifiy mesh computation"
+ // NPAL16168: "geometrical group edition from a submesh don't modify mesh computation"
meshServant->CheckGeomModif();
// get local TopoDS_Shape
TopoDS_Shape myLocShape;
ASSERT( meshServant );
if ( meshServant ) {
meshServant->Load();
- // NPAL16168: "geometrical group edition from a submesh don't modifiy mesh computation"
+ // NPAL16168: "geometrical group edition from a submesh don't modify mesh computation"
meshServant->CheckGeomModif();
// get local TopoDS_Shape
TopoDS_Shape myLocShape;
bool SMESH_Hypothesis_i::IsPublished()
{
bool res = false;
- if ( SMESH_Gen_i *gen = SMESH_Gen_i::GetSMESHGen())
+ if ( SMESH_Gen_i::GetSMESHGen() )
{
SALOMEDS::SObject_wrap SO = SMESH_Gen_i::ObjectToSObject( _this());
res = !SO->_is_nil();
* \param [in] nbOfSteps - number of elements to generate from one element
* \param [in] toMakeGroups - if true, new elements will be included into new groups
* corresponding to groups the input elements included in.
- * \return ListOfGroups - new groups craeted if \a toMakeGroups is true
+ * \return ListOfGroups - new groups created if \a toMakeGroups is true
*/
//=======================================================================
if ( *theMeshName && mesh_var->NbFaces() == 0 )
{
// new mesh empty, remove it
- SMESH_Gen_i* smesh = SMESH_Gen_i::GetSMESHGen();
- SALOMEDS::Study_var study = smesh->GetCurrentStudy();
+ SALOMEDS::Study_var study = SMESH_Gen_i::getStudyServant();
SALOMEDS::StudyBuilder_var builder = study->NewBuilder();
- SALOMEDS::SObject_wrap meshSO = smesh->ObjectToSObject( study, mesh_var );
+ SALOMEDS::SObject_wrap meshSO = SMESH_Gen_i::ObjectToSObject( mesh_var );
builder->RemoveObjectWithChildren( meshSO );
THROW_SALOME_CORBA_EXCEPTION("Offset failed", SALOME::INTERNAL_ERROR);
}
/*!
* \brief Update objects depending on changed geom groups
*
- * NPAL16168: geometrical group edition from a submesh don't modifiy mesh computation
+ * NPAL16168: geometrical group edition from a submesh don't modify mesh computation
* issue 0020210: Update of a smesh group after modification of the associated geom group
*/
//=============================================================================
class SMESH_DimHyp
{
public:
- //! fileds
+ //! fields
int _dim; //!< a dimension the algo can build (concurrent dimension)
int _ownDim; //!< dimension of shape of _subMesh (>=_dim)
TopTools_MapOfShape _shapeMap;
/*!
* \brief Update hypotheses assigned to geom groups if the latter change
*
- * NPAL16168: "geometrical group edition from a submesh don't modifiy mesh computation"
+ * NPAL16168: "geometrical group edition from a submesh don't modify mesh computation"
*/
void CheckGeomGroupModif();
#####################################################################
#Created :17/02/2005
-#Auhtor :MASLOV Eugeny, KOVALTCHUK Alexey
+#Author :MASLOV Eugeny, KOVALTCHUK Alexey
#####################################################################
#
import salome
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-# GEOM GEOM_SWIG : binding of C++ omplementaion with Python
+# GEOM GEOM_SWIG : binding of C++ implementation with Python
# File : GEOM_Sphere.py
# Author : Damien COQUERET, Open CASCADE
# Module : GEOM
class StdMeshersBuilder_Segment_Python(Mesh_Algorithm):
"""
- Defines a segment 1D algorithm for discretization of edges with Python function
- It is created by calling smeshBuilder.Mesh.Segment(smeshBuilder.PYTHON,geom=0)
+ Defines a segment 1D algorithm for discretization of edges with Python function.
+ It is created by calling smeshBuilder.Mesh.Segment(smeshBuilder.PYTHON,geom=0)
"""
class StdMeshersBuilder_Triangle_MEFISTO(Mesh_Algorithm):
"""
- Triangle MEFISTO 2D algorithm
+ Triangle MEFISTO 2D algorithm.
It is created by calling smeshBuilder.Mesh.Triangle(smeshBuilder.MEFISTO,geom=0)
"""
class StdMeshersBuilder_Quadrangle(Mesh_Algorithm):
"""
- Defines a quadrangle 2D algorithm
+ Defines a quadrangle 2D algorithm.
It is created by calling smeshBuilder.Mesh.Quadrangle(geom=0)
"""
class StdMeshersBuilder_Hexahedron(Mesh_Algorithm):
"""
- Defines a hexahedron 3D algorithm
+ Defines a hexahedron 3D algorithm.
It is created by calling smeshBuilder.Mesh.Hexahedron(geom=0)
"""
class StdMeshersBuilder_Projection1D(Mesh_Algorithm):
"""
- Defines a projection 1D algorithm
+ Defines a projection 1D algorithm.
It is created by calling smeshBuilder.Mesh.Projection1D(geom=0)
"""
class StdMeshersBuilder_Projection2D(Mesh_Algorithm):
"""
- Defines a projection 2D algorithm
+ Defines a projection 2D algorithm.
It is created by calling smeshBuilder.Mesh.Projection2D(geom=0)
"""
class StdMeshersBuilder_Projection1D2D(StdMeshersBuilder_Projection2D):
"""
- Defines a projection 1D-2D algorithm
+ Defines a projection 1D-2D algorithm.
It is created by calling smeshBuilder.Mesh.Projection1D2D(geom=0)
"""
class StdMeshersBuilder_Projection3D(Mesh_Algorithm):
"""
- Defines a projection 3D algorithm
+ Defines a projection 3D algorithm.
It is created by calling smeshBuilder.Mesh.Projection3D(geom=0)
"""
class StdMeshersBuilder_RadialQuadrangle1D2D(StdMeshersBuilder_RadialAlgorithm):
"""
- Defines a Radial Quadrangle 1D-2D algorithm
+ Defines a Radial Quadrangle 1D-2D algorithm.
It is created by calling smeshBuilder.Mesh.Quadrangle(smeshBuilder.RADIAL_QUAD,geom=0)
"""
class StdMeshersBuilder_QuadMA_1D2D(StdMeshersBuilder_RadialAlgorithm):
"""
- Defines a Quadrangle (Medial Axis Projection) 1D-2D algorithm
+ Defines a Quadrangle (Medial Axis Projection) 1D-2D algorithm .
It is created by calling smeshBuilder.Mesh.Quadrangle(smeshBuilder.QUAD_MA_PROJ,geom=0)
"""
pass
class StdMeshersBuilder_PolygonPerFace(Mesh_Algorithm):
- """ Defines a Polygon Per Face 2D algorithm
+ """ Defines a Polygon Per Face 2D algorithm.
It is created by calling smeshBuilder.Mesh.Polygon(geom=0)
"""
pass
class StdMeshersBuilder_UseExistingElements_1D(Mesh_Algorithm):
- """ Defines a Use Existing Elements 1D algorithm
+ """ Defines a Use Existing Elements 1D algorithm.
It is created by calling smeshBuilder.Mesh.UseExisting1DElements(geom=0)
"""
pass # end of StdMeshersBuilder_UseExistingElements_1D class
class StdMeshersBuilder_UseExistingElements_1D2D(Mesh_Algorithm):
- """ Defines a Use Existing Elements 1D-2D algorithm
+ """ Defines a Use Existing Elements 1D-2D algorithm.
It is created by calling smeshBuilder.Mesh.UseExisting2DElements(geom=0)
"""
pass # end of StdMeshersBuilder_UseExistingElements_1D2D class
class StdMeshersBuilder_Cartesian_3D(Mesh_Algorithm):
- """ Defines a Body Fitting 3D algorithm
+ """ Defines a Body Fitting 3D algorithm.
It is created by calling smeshBuilder.Mesh.BodyFitted(geom=0)
"""
class StdMeshersBuilder_UseExisting_1D(Mesh_Algorithm):
""" Defines a stub 1D algorithm, which enables "manual" creation of nodes and
- segments usable by 2D algorithms
+ segments usable by 2D algorithms.
It is created by calling smeshBuilder.Mesh.UseExistingSegments(geom=0)
"""
class StdMeshersBuilder_UseExisting_2D(Mesh_Algorithm):
""" Defines a stub 2D algorithm, which enables "manual" creation of nodes and
- faces usable by 3D algorithms
+ faces usable by 3D algorithms.
It is created by calling smeshBuilder.Mesh.UseExistingFaces(geom=0)
"""
full.append(geompy.MakeCut(geompy.MakeCommon(full_solid_3, full_internal), box))
full.append(geompy.MakeCut(geompy.MakeCommon(full_solid_4, full_internal), box))
-# Cut the cylinder thikness
+# Cut the cylinder thickness
# -------------------------
full_plan = geompy.MakePlane(geompy.MakeVertex(0, 0, cyl_dz+cyl_thick), cyl_dir, 5000)
return SMESH._objref_SMESH_Gen.IsEmbeddedMode(self)
def UpdateStudy( self, geompyD = None ):
- """
- Update the current study. Calling UpdateStudy() allows to
- update meshes at switching GEOM->SMESH
- """
+ """
+ Update the current study. Calling UpdateStudy() allows to
+ update meshes at switching GEOM->SMESH
+ """
#self.UpdateStudy()
- if not geompyD:
+ if not geompyD:
from salome.geom import geomBuilder
geompyD = geomBuilder.geom
pass
- self.geompyD=geompyD
- self.SetGeomEngine(geompyD)
- SMESH._objref_SMESH_Gen.UpdateStudy(self)
- sb = salome.myStudy.NewBuilder()
- sc = salome.myStudy.FindComponent("SMESH")
- if sc:
+ self.geompyD=geompyD
+ self.SetGeomEngine(geompyD)
+ SMESH._objref_SMESH_Gen.UpdateStudy(self)
+ sb = salome.myStudy.NewBuilder()
+ sc = salome.myStudy.FindComponent("SMESH")
+ if sc:
sb.LoadWith(sc, self)
- pass
+ pass
def SetEnablePublish( self, theIsEnablePublish ):
- """
- Sets enable publishing in the study. Calling SetEnablePublish( false ) allows to
- switch OFF publishing in the Study of mesh objects.
- """
- #self.SetEnablePublish(theIsEnablePublish)
- SMESH._objref_SMESH_Gen.SetEnablePublish(self,theIsEnablePublish)
- global notebook
- notebook = salome_notebook.NoteBook( theIsEnablePublish )
+ """
+ Set enable publishing in the study. Calling SetEnablePublish( False ) allows to
+ switch **off** publishing in the Study of mesh objects.
+ """
+ #self.SetEnablePublish(theIsEnablePublish)
+ SMESH._objref_SMESH_Gen.SetEnablePublish(self,theIsEnablePublish)
+ global notebook
+ notebook = salome_notebook.NoteBook( theIsEnablePublish )
def CreateMeshesFromUNV( self,theFileName ):
Create a new smeshBuilder instance. The smeshBuilder class provides the Python
interface to create or load meshes.
- Typical use is:
+ Typical use is::
import salome
salome.salome_init()
smesh = smeshBuilder.New()
Parameters:
- isPublished If False, the notebool will not be used.
- instance CORBA proxy of SMESH Engine. If None, the default Engine is used.
+ study: SALOME study, generally obtained by salome.myStudy.
+ instance: CORBA proxy of SMESH Engine. If None, the default Engine is used.
+ instanceGeom: CORBA proxy of GEOM Engine. If None, the default Engine is used.
Returns:
:class:`smeshBuilder` instance
"""
continue
if ids == subShapeID:
shapeText = '"%s"' % subSO.GetName()
+ break
if not shapeText:
shape = self.geompyD.GetSubShape( self.GetShape(), [subShapeID])
if shape:
Parameters:
fileName: is the file name
auto_groups (boolean): parameter for creating/not creating
- the groups Group_On_All_Nodes, Group_On_All_Faces, ... ;
- the typical use is auto_groups=False.
+ the groups Group_On_All_Nodes, Group_On_All_Faces, ... ;
+ the typical use is auto_groups=False.
overwrite (boolean): parameter for overwriting/not overwriting the file
- meshPart: a part of mesh (group, sub-mesh) to export instead of the mesh
- autoDimension if @c True (default), a space dimension of a MED mesh can be either
- - 1D if all mesh nodes lie on OX coordinate axis, or
- - 2D if all mesh nodes lie on XOY coordinate plane, or
- - 3D in the rest cases.
+ meshPart: a part of mesh (:class:`sub-mesh, group or filter <SMESH.SMESH_IDSource>`) to export instead of the mesh
+ autoDimension: if *True* (default), a space dimension of a MED mesh can be either
+
+ - 1D if all mesh nodes lie on OX coordinate axis, or
+ - 2D if all mesh nodes lie on XOY coordinate plane, or
+ - 3D in the rest cases.
+
If *autoDimension* is *False*, the space dimension is always 3.
fields: list of GEOM fields defined on the shape to mesh.
geomAssocFields: each character of this string means a need to export a
- 3D in the rest cases.
If **autoDimension** is *False*, the space dimension is always 3.
- """
+ """
print("WARNING: ExportToMEDX() is deprecated, use ExportMED() instead")
# process positional arguments
a :class:`Mesh`, elements of highest dimension are duplicated
theGroupName: a name of group to contain the generated elements.
If a group with such a name already exists, the new elements
- are added to the existng group, else a new group is created.
+ are added to the existing group, else a new group is created.
If *theGroupName* is empty, new elements are not added
in any group.
algoType = sorted( self.algoTypeToClass.keys() )[0]
if algoType in self.algoTypeToClass:
#print("Create algo",algoType)
-
return self.algoTypeToClass[ algoType ]( self.mesh, shape )
raise RuntimeError( "No class found for algo type %s" % algoType)
return None
Note:
This class should not be used directly, it is supposed to be sub-classed
- for implementing Python API for specific meshing algorithms
+ for implementing Python API for specific meshing algorithms
- For each meshing algorithm, a python class inheriting from class %Mesh_Algorithm
+ For each meshing algorithm, a python class inheriting from class *Mesh_Algorithm*
should be defined. This descendant class should have two attributes defining the way
- it is created by class Mesh (see e.g. class :class:`~StdMeshersBuilder.StdMeshersBuilder_Segment`
- in StdMeshersBuilder package):
+ it is created by class :class:`~smeshBuilder.Mesh` (see e.g. class :class:`~StdMeshersBuilder.StdMeshersBuilder_Segment`):
- - :code:`meshMethod` attribute defines name of method of class smesh.Mesh by calling which the
- python class of algorithm is created; this method is dynamically added to the smesh.Mesh class
- in runtime. For example, if in :code:`class MyPlugin_Algorithm` this attribute is defined as
- ::
+ - :code:`meshMethod` attribute defines name of method of class :class:`~smeshBuilder.Mesh` by calling which the
+ python class of algorithm is created; this method is dynamically added to the :class:`~smeshBuilder.Mesh` class
+ in runtime. For example, if in :code:`class MyPlugin_Algorithm` this attribute is defined as::
- meshMethod = "MyAlgorithm"
+ meshMethod = "MyAlgorithm"
- then an instance of :code:`MyPlugin_Algorithm` can be created by the direct invocation of the function
- of smesh.Mesh class:
- ::
+ then an instance of :code:`MyPlugin_Algorithm` can be created by the direct invocation of the function
+ of :class:`~smeshBuilder.Mesh` class::
- my_algo = mesh.MyAlgorithm()
+ my_algo = mesh.MyAlgorithm()
- - :code:`algoType` defines type of algorithm and is used mostly to discriminate
- algorithms that are created by the same method of class smesh.Mesh. For example, if this attribute
- is specified in :code:`MyPlugin_Algorithm` class as
- ::
+ - :code:`algoType` defines type of algorithm and is used mostly to discriminate
+ algorithms that are created by the same method of class :class:`~smeshBuilder.Mesh`. For example, if this attribute
+ is specified in :code:`MyPlugin_Algorithm` class as::
- algoType = "MyPLUGIN"
+ algoType = "MyPLUGIN"
- then it's creation code can be:
- ::
+ then it's creation code can be::
- my_algo = mesh.MyAlgorithm(algo="MyPLUGIN")
+ my_algo = mesh.MyAlgorithm(algo="MyPLUGIN")
"""
def __init__(self):
"""
- Private constuctor
+ Private constructor
"""
self.mesh = None
self.geom = None
def FindHypothesis (self, hypname, args, CompareMethod, smeshpyD):
"""
Finds a hypothesis in the study by its type name and parameters.
- Finds only the hypotheses created in smeshpyD engine.
+ Finds only the hypotheses created in smeshBuilder engine.
Returns:
- SMESH.SMESH_Hypothesis
+ :class:`~SMESH.SMESH_Hypothesis`
"""
study = salome.myStudy
if not study: return None
def FindAlgorithm (self, algoname, smeshpyD):
"""
Finds the algorithm in the study by its type name.
- Finds only the algorithms, which have been created in smeshpyD engine.
+ Finds only the algorithms, which have been created in smeshBuilder engine.
Returns:
SMESH.SMESH_Algo
def GetSubMesh(self):
"""
If the algorithm is global, returns 0;
- else returns the submesh associated to this algorithm.
+ else returns the :class:`~SMESH.SMESH_subMesh` associated to this algorithm.
"""
return self.subm
nbSeg1 += Max( nbElems[ SMDSEntity_Edge ], nbElems[ SMDSEntity_Quad_Edge ]);
}
- // Get an 1D size of a box side ortogonal to lessComplexSide
+ // Get an 1D size of a box side orthogonal to lessComplexSide
int nbSeg2 = 0;
_QuadFaceGrid* ortoSide =
lessComplexSide->FindAdjacentForSide( Q_LEFT, boxFaceContainer, B_UNDEFINED );
nbSeg2 += Max( nbElems[ SMDSEntity_Edge ], nbElems[ SMDSEntity_Quad_Edge ]);
}
- // Get an 2D size of a box side ortogonal to lessComplexSide
+ // Get an 2D size of a box side orthogonal to lessComplexSide
int nbFaces = 0, nbQuadFace = 0;
list< TopoDS_Face > sideFaces;
if ( ortoSide->IsComplex() )
#include "SMESH_Algo.hxx"
/*!
- * \brief Alorithm generating hexahedral mesh from 2D skin of block
+ * \brief Algorithm generating hexahedral mesh from 2D skin of block
*/
class STDMESHERS_EXPORT StdMeshers_HexaFromSkin_3D : public SMESH_3D_Algo
isOK = static_cast<bool>(load >> scale_factor);
a = (int)scale_factor;
- // try to interprete ditribution type,
+ // try to interpret ditribution type,
// supposing that this hypothesis was written in the new format
if (isOK)
{
//=======================================================================
//function : isSimpleQuad
//purpose : check if the bottom FACE is meshable with nice quadrangles,
-// if so the block aproach can work rather fast.
+// if so the block approach can work rather fast.
// This is a temporary mean caused by problems in StdMeshers_Sweeper
//=======================================================================
PSurface mySurface;
TopoDS_Edge myBaseEdge;
std::map< int, PSurface > myShapeID2Surf;
- // first and last normalized params and orientaion for each component or it-self
+ // first and last normalized params and orientation for each component or it-self
std::vector< std::pair< double, double> > myParams; // select my columns in myParamToColumnMap
bool myIsForward;
std::vector< TSideFace* > myComponents;
//================================================================================
/*!
- * \brief Prepare data for the given face
+ * \brief Retrieve data of the given face
* \param PN - coordinates of face nodes
* \param VN - cross products of vectors (PC-PN(i)) ^ (PC-PN(i+1))
* \param FNodes - face nodes
int nbp = 4;
int j = 0;
- for(i=1; i<4; i++) {
+ for ( i = 1; i < 4; i++ )
+ {
j = i+1;
for(; j<=4; j++) {
if( PN(i).Distance(PN(j)) < 1.e-6 )
}
if(j<=4) break;
}
- //int deg_num = IsDegenarate(PN);
- //if(deg_num>0) {
+
bool hasdeg = false;
- if(i<4) {
- //cout<<"find degeneration"<<endl;
+ if ( i < 4 )
+ {
hasdeg = true;
gp_Pnt Pdeg = PN(i);
gp_Pnt Ptmp(N->X(),N->Y(),N->Z());
if(Pdeg.Distance(Ptmp)<1.e-6) {
DegNode = N;
- //DegNode = const_cast<SMDS_MeshNode*>(N);
break;
}
}
PN.SetValue(nbp+1,PN(1));
FNodes[nbp] = FNodes[0];
+
// find normal direction
gp_Vec V1(PC,PN(nbp));
gp_Vec V2(PC,PN(1));
}
}
- //cout<<" VNorm("<<VNorm.X()<<","<<VNorm.Y()<<","<<VNorm.Z()<<")"<<endl;
return hasdeg ? DEGEN_QUAD : QUAD;
}
int nfull = n1+n2+n3+n4;
if ((nfull % 2) == 0 && ((n1 != n3) || (n2 != n4)))
{
- // special path genarating only quandrangle faces
+ // special path generating only quandrangle faces
res = computeQuadPref( aMesh, F, quad );
}
}
if ( nbBad == oldBadNb &&
nbBad > 0 &&
- step < stepLimit ) // smooth w/o chech of validity
+ step < stepLimit ) // smooth w/o check of validity
{
dumpFunctionEnd();
dumpFunction(SMESH_Comment("smoothWoCheck")<<data._index<<"_Fa"<<sInd
//================================================================================
/*!
- * \brief Chooses a smoothing technic giving a position most close to an initial one.
+ * \brief Chooses a smoothing technique giving a position most close to an initial one.
* For a correct result, _simplices must contain nodes lying on geometry.
*/
//================================================================================
//================================================================================
/*!
- * \brief Computes new UV using angle based smoothing technic
+ * \brief Computes new UV using angle based smoothing technique
*/
//================================================================================