Difference between revisions of "Contrib:JMB/SalomePythonBeginings"

From CAELinuxWiki
Jump to: navigation, search
m
m
 
(3 intermediate revisions by the same user not shown)
Line 4: Line 4:
  
 
This tutorial does NOT teach you to code by using a specific example or objective.  That is up to you.  It is meant to teach you how to help yourself.  The objective is to make a user self guided rather than looking for outside help as little as possible.  Then it will hopefully free up their time to be more productive and then help others.  Another in my series of self help guides...
 
This tutorial does NOT teach you to code by using a specific example or objective.  That is up to you.  It is meant to teach you how to help yourself.  The objective is to make a user self guided rather than looking for outside help as little as possible.  Then it will hopefully free up their time to be more productive and then help others.  Another in my series of self help guides...
 +
 +
  //** If there is a better way, please feel free to modify or correct this page **//
  
 
== By Reading ==
 
== By Reading ==
Line 73: Line 75:
  
 
  dir(Mesh_1)
 
  dir(Mesh_1)
 +
 +
['Add0DElement', 'AddEdge', 'AddFace', 'AddHypothesis', 'AddNode', 'AddPolygonalFace', 'AddPolyhedralVolume',
 +
'AddPolyhedralVolumeByFaces', 'AddVolume', 'AdvancedExtrusion', 'AutomaticHexahedralization', 'AutomaticTetrahedralization',
 +
'BaryCenter', 'BestSplit', 'ChangeElemNodes', 'Clear', 'ClearLog', 'ClearSubMesh', 'Compute', 'ConvertFromQuadratic',
 +
'ConvertToQuadratic', 'ConvertToStandalone', 'CreateDimGroup', 'CreateEmptyGroup', 'CutGroups', 'CutListOfGroups', 'DeleteDiag',
 +
'DoubleNode', 'DoubleNodeElem', 'DoubleNodeElemGroup', 'DoubleNodeElemGroupInRegion', 'DoubleNodeElemGroups',
 +
'DoubleNodeElemGroupsInRegion', 'DoubleNodeElemInRegion', 'DoubleNodeGroup', 'DoubleNodeGroups', 'DoubleNodes', 'Dump', 'ElemNbEdges',
 +
'ElemNbFaces', 'Evaluate', 'ExportDAT', 'ExportMED', 'ExportSTL', 'ExportToMED', 'ExportUNV', 'ExtrusionAlongPath',
 +
'ExtrusionAlongPathObject', 'ExtrusionAlongPathObject1D', 'ExtrusionAlongPathObject2D', 'ExtrusionAlongPathX', 'ExtrusionSweep',
 +
'ExtrusionSweepObject', 'ExtrusionSweepObject1D', 'ExtrusionSweepObject2D', 'FindCoincidentNodes', 'FindCoincidentNodesOnPart',
 +
'FindElementByNodes', 'FindElementsByPoint', 'FindEqualElements', 'FindNodeClosestTo', 'GetAlgoState', 'GetAutoColor',
 +
'GetElemFaceNodes', 'GetElemNbNodes', 'GetElemNode', 'GetElemNodes', 'GetElementGeomType', 'GetElementType', 'GetElementsByType',
 +
'GetElementsId', 'GetFreeBorders', 'GetGeometryByMeshElement', 'GetGroupNames', 'GetGroups', 'GetHypothesisList', 'GetId',
 +
'GetIdsFromFilter', 'GetLastCreatedElems', 'GetLastCreatedNodes', 'GetLog', 'GetMEDMesh', 'GetMesh', 'GetMeshEditor', 'GetMeshInfo',
 +
'GetMeshOrder', 'GetName', 'GetNodeInverseElements', 'GetNodePosition', 'GetNodeXYZ', 'GetNodesId', 'GetPointState', 'GetShape',
 +
'GetShapeID', 'GetShapeIDForElem', 'GetStudyId', 'GetSubMesh', 'GetSubMeshElementType', 'GetSubMeshElementsId', 'GetSubMeshNodesId',
 +
'Group', 'GroupOnGeom', 'HasDuplicatedGroupNamesMED', 'Hexahedron', 'IntersectGroups', 'IntersectListOfGroups', 'InverseDiag',
 +
'IsMediumNode', 'IsMediumNodeOfAnyElem', 'IsPoly', 'IsQuadratic', 'IsReadyToCompute', 'Make2DMeshFrom3D', 'MakeGroup',
 +
'MakeGroupByCriteria', 'MakeGroupByCriterion', 'MakeGroupByFilter', 'MakeGroupByIds', 'MergeElements', 'MergeEqualElements',
 +
'MergeNodes', 'MeshDimension', 'MeshToPassThroughAPoint', 'Mirror', 'MirrorMakeMesh', 'MirrorObject', 'MirrorObjectMakeMesh',
 +
'MoveClosestNodeToPoint', 'MoveNode', 'Nb0DElements', 'NbEdges', 'NbEdgesOfOrder', 'NbElements', 'NbFaces', 'NbFacesOfOrder',
 +
'NbGroups', 'NbHexas', 'NbHexasOfOrder', 'NbNodes', 'NbPolygons', 'NbPolyhedrons', 'NbPrisms', 'NbPrismsOfOrder', 'NbPyramids',
 +
'NbPyramidsOfOrder', 'NbQuadrangles', 'NbQuadranglesOfOrder', 'NbSubMesh', 'NbTetras', 'NbTetrasOfOrder', 'NbTriangles',
 +
'NbTrianglesOfOrder', 'NbVolumes', 'NbVolumesOfOrder', 'Netgen', 'Prism', 'Projection1D', 'Projection2D', 'Projection3D', 'QuadToTri',
 +
'QuadToTriObject', 'Quadrangle', 'RemoveElements', 'RemoveGlobalHypotheses', 'RemoveGroup', 'RemoveGroupWithContents',
 +
'RemoveHypothesis', 'RemoveNodes', 'RenumberElements', 'RenumberNodes', 'Reorient', 'ReorientObject', 'Rotate', 'RotateMakeMesh',
 +
'RotateObject', 'RotateObjectMakeMesh', 'RotationSweep', 'RotationSweepObject', 'RotationSweepObject1D', 'RotationSweepObject2D',
 +
'Scale', 'ScaleMakeMesh', 'Segment', 'SetAutoColor', 'SetMesh', 'SetMeshElementOnShape', 'SetMeshOrder', 'SetName', 'SetNodeInVolume',
 +
'SetNodeOnEdge', 'SetNodeOnFace', 'SetNodeOnVertex', 'SetShape', 'SewBorderToSide', 'SewConformFreeBorders', 'SewFreeBorders',
 +
'SewSideElements', 'Smooth', 'SmoothObject', 'SmoothParametric', 'SmoothParametricObject', 'SplitHexaToPrisms', 'SplitHexaToTetras',
 +
'SplitQuad', 'SplitQuadObject', 'SplitQuadsNearTriangularFacets', 'SplitVolumesIntoTetra', 'Tetrahedron', 'Translate',
 +
'TranslateMakeMesh', 'TranslateObject', 'TranslateObjectMakeMesh', 'TriToQuad', 'TriToQuadObject', 'Triangle', 'UnionGroups',
 +
'UnionListOfGroups', 'UseExistingFaces', 'UseExistingSegments', '__doc__', '__init__', '__module__', 'editor', 'geom', 'geompyD',
 +
'mesh', 'smeshpyD']
 +
 +
Copy and paste this output to a text editor and search for "MakeGroup"  which reults in:
 +
MakeGroup, MakeGroupByCriteria, MakeGroupByCriterion, MakeGroupByFilter and MakeGroupByIds
 +
 +
== By Coding ==
 +
So a command that should work (provided aCriterion has been previously defined) would be something like:
 +
 +
Load = Mesh_1.MakeGroupByCriterion('Load',aCriterion)
 +
 +
How does one create 'aCriterion'?.  This is how:
 +
 +
aCriterion = SMESH.Filter.Criterion(17,32,0,'Z_Load','',32,32,1e-06,SMESH.FACE,-1)
 +
 +
How does one find it?
 +
dir(SMESH.Filter)
 +
 +
Which outputs:
 +
 +
['Criteria', 'Criterion', '_NP_RepositoryId', '__doc__', '__init__', '__module__', '_ad_Criteria', '_d_Criteria', '_d_Criterion',
 +
'_d_Destroy', '_d_GetCriteria', '_d_GetElementType', '_d_GetElementsId', '_d_GetIDs', '_d_GetMeshInfo', '_d_GetPredicate',
 +
'_d_Register', '_d_SetCriteria', '_d_SetMesh', '_d_SetPredicate', '_nil', '_tc_Criteria', '_tc_Criterion']
 +
 +
Repeat the steps above namely, copy/paste into text editor, search for "Criteri" etc. resulting in many objects.
 +
 +
How did one know that we should type dir(SMESH.Filter).  Well, because:
 +
 +
1. There are examples listing such a command from conversations on the web forums, or
 +
2. There is an example shown in file:///opt/salome_5.1.4/SMESH_5.1.4/share/doc/salome/gui/SMESH/index.html
 +
3. A dump of your study (after you used a GUI method of creating mesh groups) has it in the *_SMESH.py file
 +
4. You just divined the knowledge
 +
5. You typed 'dir(SMESH)' as shown below:
 +
 +
dir(SMESH)
 +
 +
Then read the long list
 +
 +
['ADD_EDGE', 'ADD_ELEM0D', 'ADD_HEXAHEDRON', 'ADD_NODE', 'ADD_POLYGON', 'ADD_POLYHEDRON', 'ADD_PRISM', 'ADD_PYRAMID', 'ADD_QUADEDGE',
 +
'ADD_QUADHEXAHEDRON', 'ADD_QUADPENTAHEDRON', 'ADD_QUADPYRAMID', 'ADD_QUADQUADRANGLE', 'ADD_QUADRANGLE', 'ADD_QUADTETRAHEDRON',
 +
'ADD_QUADTRIANGLE', 'ADD_TETRAHEDRON', 'ADD_TRIANGLE', 'ALL', 'AlgoStateError', 'Area', 'AspectRatio', 'AspectRatio3D', 'AxisStruct',
 +
'BadOrientedVolume', 'BelongToCylinder', 'BelongToGenSurface', 'BelongToGeom', 'BelongToPlane', 'BelongToSurface',
 +
'CHANGE_ELEMENT_NODES', 'CHANGE_POLYHEDRON_NODES', 'CLEAR_MESH', 'COMPERR_ALGO_FAILED', 'COMPERR_BAD_INPUT_MESH', 'COMPERR_BAD_SHAPE',
 +
'COMPERR_EXCEPTION', 'COMPERR_MEMORY_PB', 'COMPERR_OCC_EXCEPTION', 'COMPERR_OK', 'COMPERR_SLM_EXCEPTION', 'COMPERR_STD_EXCEPTION',
 +
'Comparator', 'ComputeError', 'ComputeErrorName', 'DIM_0D', 'DIM_1D', 'DIM_2D', 'DIM_3D', 'DRS_EMPTY', 'DRS_FAIL', 'DRS_OK',
 +
'DRS_WARN_RENUMBER', 'DRS_WARN_SKIP_ELEM', 'Dimension', 'DirStruct', 'DriverMED_ReadStatus', 'EDGE', 'ELEM0D',
 +
'EXTRUSION_FLAG_BOUNDARY', 'EXTRUSION_FLAG_SEW', 'ElemGeomType', 'ElementOrder', 'ElementSubType', 'ElementType', 'EntityType',
 +
'Entity_0D', 'Entity_Edge', 'Entity_Hexa', 'Entity_Last', 'Entity_Node', 'Entity_Penta', 'Entity_Polygon', 'Entity_Polyhedra',
 +
'Entity_Pyramid', 'Entity_Quad_Edge', 'Entity_Quad_Hexa', 'Entity_Quad_Penta', 'Entity_Quad_Polygon', 'Entity_Quad_Polyhedra',
 +
'Entity_Quad_Pyramid', 'Entity_Quad_Quadrangle', 'Entity_Quad_Tetra', 'Entity_Quad_Triangle', 'Entity_Quadrangle', 'Entity_Tetra',
 +
'Entity_Triangle', 'EqualTo', 'FACE', 'FT_Area', 'FT_AspectRatio', 'FT_AspectRatio3D', 'FT_BadOrientedVolume', 'FT_BelongToCylinder',
 +
'FT_BelongToGenSurface', 'FT_BelongToGeom', 'FT_BelongToPlane', 'FT_ElemGeomType', 'FT_EqualTo', 'FT_FreeBorders', 'FT_FreeEdges',
 +
'FT_FreeFaces', 'FT_FreeNodes', 'FT_GroupColor', 'FT_Length', 'FT_Length2D', 'FT_LessThan', 'FT_LinearOrQuadratic', 'FT_LogicalAND',
 +
'FT_LogicalNOT', 'FT_LogicalOR', 'FT_LyingOnGeom', 'FT_MinimumAngle', 'FT_MoreThan', 'FT_MultiConnection', 'FT_MultiConnection2D',
 +
'FT_RangeOfIds', 'FT_Skew', 'FT_Taper', 'FT_Undefined', 'FT_Volume3D', 'FT_Warping', 'Filter', 'FilterLibrary', 'FilterManager',
 +
'FreeBorders', 'FreeEdges', 'FreeFaces', 'FreeNodes', 'Functor', 'FunctorType', 'Geom_EDGE', 'Geom_HEXA', 'Geom_PENTA', 'Geom_POINT',
 +
'Geom_POLYGON', 'Geom_POLYHEDRA', 'Geom_PYRAMID', 'Geom_QUADRANGLE', 'Geom_TETRA', 'Geom_TRIANGLE', 'GeometryType', 'GroupColor',
 +
'HYP_ALREADY_EXIST', 'HYP_BAD_DIM', 'HYP_BAD_GEOMETRY', 'HYP_BAD_PARAMETER', 'HYP_BAD_SUBSHAPE', 'HYP_CONCURENT', 'HYP_HIDDEN_ALGO',
 +
'HYP_HIDING_ALGO', 'HYP_INCOMPATIBLE', 'HYP_MISSING', 'HYP_NEED_SHAPE', 'HYP_NOTCONFORM', 'HYP_OK', 'HYP_UNKNOWN_FATAL',
 +
'Hypothesis_Status', 'Length', 'Length2D', 'LessThan', 'LinearOrQuadratic', 'ListOfGroups', 'ListOfHypothesis', 'ListOfHypothesisName',
 +
'ListOfParameters', 'Logical', 'LogicalAND', 'LogicalBinary', 'LogicalNOT', 'LogicalOR', 'LyingOnGeom', 'MED_V2_1', 'MED_V2_2',
 +
'MED_VERSION', 'MOVE_NODE', 'MeshPreviewStruct', 'MinimumAngle', 'MoreThan', 'MultiConnection', 'MultiConnection2D', 'NODE',
 +
'NodePosition', 'NumericalFunctor', 'ORDER_ANY', 'ORDER_LINEAR', 'ORDER_QUADRATIC', 'PointStruct', 'Predicate', 'REMOVE_ELEMENT',
 +
'REMOVE_NODE', 'RENUMBER', 'RangeOfIds', 'SMESH_0D_Algo', 'SMESH_1D_Algo', 'SMESH_2D_Algo', 'SMESH_3D_Algo', 'SMESH_Algo',
 +
'SMESH_Filter_idl', 'SMESH_Gen', 'SMESH_Gen_idl', 'SMESH_Group', 'SMESH_GroupBase', 'SMESH_GroupOnGeom', 'SMESH_Group_idl',
 +
'SMESH_Hypothesis', 'SMESH_Hypothesis_idl', 'SMESH_IDSource', 'SMESH_Mesh', 'SMESH_MeshEditor', 'SMESH_MeshEditor_idl',
 +
'SMESH_Mesh_idl', 'SMESH_Pattern', 'SMESH_Pattern_idl', 'SMESH_subMesh', 'Skew', 'Tag_AlgorithmsRoot', 'Tag_EdgeGroups',
 +
'Tag_FaceGroups', 'Tag_FirstGroup', 'Tag_FirstMeshRoot', 'Tag_FirstSubMesh', 'Tag_HypothesisRoot', 'Tag_LastGroup', 'Tag_LastSubMesh',
 +
'Tag_NodeGroups', 'Tag_RefOnAppliedAlgorithms', 'Tag_RefOnAppliedHypothesis', 'Tag_RefOnShape', 'Tag_SubMeshOnCompound',
 +
'Tag_SubMeshOnEdge', 'Tag_SubMeshOnFace', 'Tag_SubMeshOnShell', 'Tag_SubMeshOnSolid', 'Tag_SubMeshOnVertex', 'Tag_SubMeshOnWire',
 +
'Tag_VolumeGroups', 'Taper', 'VOLUME', 'Volume3D', 'Warping', '__builtins__', '__doc__', '__file__', '__name__', '__path__',
 +
'_ad_ListOfGroups', '_ad_ListOfHypothesis', '_ad_ListOfHypothesisName', '_ad_ListOfParameters', '_ad_algo_error_array',
 +
'_ad_array_of_long_array', '_ad_compute_error_array', '_ad_double_array', '_ad_log_array', '_ad_long_array', '_ad_mesh_array',
 +
'_ad_nodes_array', '_ad_object_array', '_ad_point_array', '_ad_string_array', '_ad_submesh_array', '_ad_submesh_array_array',
 +
'_ad_types_array', '_d_AlgoStateError', '_d_Area', '_d_AspectRatio', '_d_AspectRatio3D', '_d_AxisStruct', '_d_BadOrientedVolume',
 +
'_d_BelongToCylinder', '_d_BelongToGenSurface', '_d_BelongToGeom', '_d_BelongToPlane', '_d_BelongToSurface', '_d_Comparator',
 +
'_d_ComputeError', '_d_ComputeErrorName', '_d_Dimension', '_d_DirStruct', '_d_DriverMED_ReadStatus', '_d_ElemGeomType',
 +
'_d_ElementOrder', '_d_ElementSubType', '_d_ElementType', '_d_EntityType', '_d_EqualTo', '_d_Filter', '_d_FilterLibrary',
 +
'_d_FilterManager', '_d_FreeBorders', '_d_FreeEdges', '_d_FreeFaces', '_d_FreeNodes', '_d_Functor', '_d_FunctorType', '_d_GeometryType', '_d_GroupColor', '_d_Hypothesis_Status', '_d_Length', '_d_Length2D', '_d_LessThan', '_d_LinearOrQuadratic',
 +
'_d_ListOfGroups', '_d_ListOfHypothesis', '_d_ListOfHypothesisName', '_d_ListOfParameters', '_d_Logical', '_d_LogicalAND',
 +
'_d_LogicalBinary', '_d_LogicalNOT', '_d_LogicalOR', '_d_LyingOnGeom', '_d_MED_VERSION', '_d_MeshPreviewStruct', '_d_MinimumAngle',
 +
'_d_MoreThan', '_d_MultiConnection', '_d_MultiConnection2D', '_d_NodePosition', '_d_NumericalFunctor', '_d_PointStruct',
 +
'_d_Predicate', '_d_RangeOfIds', '_d_SMESH_0D_Algo', '_d_SMESH_1D_Algo', '_d_SMESH_2D_Algo', '_d_SMESH_3D_Algo', '_d_SMESH_Algo',
 +
'_d_SMESH_Gen', '_d_SMESH_Group', '_d_SMESH_GroupBase', '_d_SMESH_GroupOnGeom', '_d_SMESH_Hypothesis', '_d_SMESH_IDSource',
 +
'_d_SMESH_Mesh', '_d_SMESH_MeshEditor', '_d_SMESH_Pattern', '_d_SMESH_subMesh', '_d_Skew', '_d_Taper', '_d_Volume3D', '_d_Warping',
 +
'_d_algo_error_array', '_d_array_of_long_array', '_d_compute_error_array', '_d_double_array', '_d_log_array', '_d_log_block',
 +
'_d_log_command', '_d_long_array', '_d_mesh_array', '_d_nodes_array', '_d_object_array', '_d_point_array', '_d_string_array',
 +
'_d_submesh_array', '_d_submesh_array_array', '_d_types_array', '_objref_Area', '_objref_AspectRatio', '_objref_AspectRatio3D',
 +
'_objref_BadOrientedVolume', '_objref_BelongToCylinder', '_objref_BelongToGenSurface', '_objref_BelongToGeom', '_objref_BelongToPlane',
 +
'_objref_BelongToSurface', '_objref_Comparator', '_objref_ElemGeomType', '_objref_EqualTo', '_objref_Filter', '_objref_FilterLibrary',
 +
'_objref_FilterManager', '_objref_FreeBorders', '_objref_FreeEdges', '_objref_FreeFaces', '_objref_FreeNodes', '_objref_Functor',
 +
'_objref_GroupColor', '_objref_Length', '_objref_Length2D', '_objref_LessThan', '_objref_LinearOrQuadratic', '_objref_Logical',
 +
'_objref_LogicalAND', '_objref_LogicalBinary', '_objref_LogicalNOT', '_objref_LogicalOR', '_objref_LyingOnGeom',
 +
'_objref_MinimumAngle', '_objref_MoreThan', '_objref_MultiConnection', '_objref_MultiConnection2D', '_objref_NumericalFunctor',
 +
'_objref_Predicate', '_objref_RangeOfIds', '_objref_SMESH_0D_Algo', '_objref_SMESH_1D_Algo', '_objref_SMESH_2D_Algo',
 +
'_objref_SMESH_3D_Algo', '_objref_SMESH_Algo', '_objref_SMESH_Gen', '_objref_SMESH_Group', '_objref_SMESH_GroupBase',
 +
'_objref_SMESH_GroupOnGeom', '_objref_SMESH_Hypothesis', '_objref_SMESH_IDSource', '_objref_SMESH_Mesh', '_objref_SMESH_MeshEditor',
 +
'_objref_SMESH_Pattern', '_objref_SMESH_subMesh', '_objref_Skew', '_objref_Taper', '_objref_Volume3D', '_objref_Warping',
 +
'_tc_AlgoStateError', '_tc_Area', '_tc_AspectRatio', '_tc_AspectRatio3D', '_tc_AxisStruct', '_tc_BadOrientedVolume',
 +
'_tc_BelongToCylinder', '_tc_BelongToGenSurface', '_tc_BelongToGeom', '_tc_BelongToPlane', '_tc_BelongToSurface', '_tc_Comparator',
 +
'_tc_ComputeError', '_tc_ComputeErrorName', '_tc_Dimension', '_tc_DirStruct', '_tc_DriverMED_ReadStatus', '_tc_ElemGeomType',
 +
'_tc_ElementOrder', '_tc_ElementSubType', '_tc_ElementType', '_tc_EntityType', '_tc_EqualTo', '_tc_Filter', '_tc_FilterLibrary',
 +
'_tc_FilterManager', '_tc_FreeBorders', '_tc_FreeEdges', '_tc_FreeFaces', '_tc_FreeNodes', '_tc_Functor', '_tc_FunctorType',
 +
'_tc_GeometryType', '_tc_GroupColor', '_tc_Hypothesis_Status', '_tc_Length', '_tc_Length2D', '_tc_LessThan', '_tc_LinearOrQuadratic',
 +
'_tc_ListOfGroups', '_tc_ListOfHypothesis', '_tc_ListOfHypothesisName', '_tc_ListOfParameters', '_tc_Logical', '_tc_LogicalAND',
 +
'_tc_LogicalBinary', '_tc_LogicalNOT', '_tc_LogicalOR', '_tc_LyingOnGeom', '_tc_MED_VERSION', '_tc_MeshPreviewStruct',
 +
'_tc_MinimumAngle', '_tc_MoreThan', '_tc_MultiConnection', '_tc_MultiConnection2D', '_tc_NodePosition', '_tc_NumericalFunctor',
 +
'_tc_PointStruct', '_tc_Predicate', '_tc_RangeOfIds', '_tc_SMESH_0D_Algo', '_tc_SMESH_1D_Algo', '_tc_SMESH_2D_Algo',
 +
'_tc_SMESH_3D_Algo', '_tc_SMESH_Algo', '_tc_SMESH_Gen', '_tc_SMESH_Group', '_tc_SMESH_GroupBase', '_tc_SMESH_GroupOnGeom',
 +
'_tc_SMESH_Hypothesis', '_tc_SMESH_IDSource', '_tc_SMESH_Mesh', '_tc_SMESH_MeshEditor', '_tc_SMESH_Pattern', '_tc_SMESH_subMesh',
 +
'_tc_Skew', '_tc_Taper', '_tc_Volume3D', '_tc_Warping', '_tc_algo_error_array', '_tc_array_of_long_array', '_tc_compute_error_array',
 +
'_tc_double_array', '_tc_log_array', '_tc_log_block', '_tc_log_command', '_tc_long_array', '_tc_mesh_array', '_tc_nodes_array',
 +
'_tc_object_array', '_tc_point_array', '_tc_string_array', '_tc_submesh_array', '_tc_submesh_array_array', '_tc_types_array',
 +
'algo_error_array', 'array_of_long_array', 'compute_error_array', 'double_array', 'log_array', 'log_block', 'log_command',
 +
'long_array', 'mesh_array', 'nodes_array', 'object_array', 'omniORB', 'point_array', 'string_array', 'submesh_array',
 +
'submesh_array_array', 'types_array']
 +
 +
and meticulously and patiently typed 'dir(SMESH.ADD_EDGE)' examined the output; typed 'dir(SMESH.ADD_ELEM0D), examined its output, etc until you got to 'dir(SMESH.Filter') !!!
 +
 +
Where does one find details of this "aCriterion = SMESH.Filter.Criterion(17,32,0,'Z_Load','',32,32,1e-06,SMESH.FACE,-1)" command?
 +
 +
Here:
 +
http://docs.salome-platform.org/salome_5_1_4/smesh/dev/SMESH__Filter_8idl_source.html                    Salome Web Docs
 +
http://www.salome-platform.org/forum/forum_10/971846854#934110303                                        Salome Web Forum
 +
/opt/salome_5.1.4/DOCUMENTATION_SRC_5.1.4/SMESH/tui/SMESH/SMESH__Filter_8idl_source.html                  On your PC
 +
/opt/salome_5.1.4/SMESH_5.1.4/idl/salome/SMESH_Filter.idl                                                On your PC
 +
/opt/salome_5.1.4/SMESH_5.1.4/share/doc/salome/gui/SMESH/index.html (Grouping Elements)                  On your PC
 +
http://docs.salome-platform.org/salome_5_1_4/smesh/dev/structSMESH_1_1Filter_1_1Criterion.html            Salome Web Docs
 +
/opt/salome_5.1.4/DOCUMENTATION_SRC_5.1.4/SMESH/tui/SMESH/structSMESH_1_1Filter_1_1Criterion.html        On your PC
 +
 +
 +
== By Copying ==
 +
 +
By copying (meaning legally plagiarizing) code that others have published under the OSS umbrella.
 +
 +
== To be Continued ==
 +
 +
== Acknowledgements ==
 +
 +
This page was made possible by the help and advice of several individuals on the Salome Forum in particular: Christophe BOURCIER, Pete HALVERSON and Kees WOUTERS and many others. If I have missed mentioning somebody whose name should be added, please let me know or edit this section since it is a Wiki that anybody can add to, or correct.
 +
 +
Disclaimer: This page is still evolving and omissions or errors are a regrettable part of such a process. So user beware! -JMB

Latest revision as of 03:18, 23 October 2010

Salome Python Coding: Where to Start?

Under Construction !!!

This tutorial does NOT teach you to code by using a specific example or objective. That is up to you. It is meant to teach you how to help yourself. The objective is to make a user self guided rather than looking for outside help as little as possible. Then it will hopefully free up their time to be more productive and then help others. Another in my series of self help guides...

 //** If there is a better way, please feel free to modify or correct this page **//

By Reading

1. Look at some code that is already out there on your PC! Click on the Help button of Salome's specific module (say Help -> Geometry Module -> User's Guide) and then in the browser (after enabling scripts, if they are disabled) Click on the little "+" beside "Introduction to Geometry" then the little "+" beside "Python Interface geompy.py"; then the little "+" beside "Examples, generated from GEOM_SWIG test scripts" and finally "GEOM_TestAll.py" or

2. Use the GUI to create a study: Geometry and Mesh using available tutorials on the Salome, CAELinux websites.

 Salome:     http://www.salome-platform.org/user-section/salome-tutorials/copy_of_salome-tutorial
             http://www.salome-platform.org/user-section/tui-examples/examples-of-salome-use-from-tui
 CAELinux:   

Then dump the study so that a *.py, a *_GEOM.py and a *_SMESH.py are created, which you can become the basis of your python code.

Learn how to take these python scripts and covert them to your own running scripts. There are YouTube videos that teach you how to do that. Search words "Salome Tutorial".

3. Read the docs at

http://docs.salome-platform.org/salome_5_1_4/geom/dev/
/opt/salome_5.1.4/DOCUMENTATION_SRC_5.1.4/SMESH/tui/SMESH/index.html
http://docs.salome-platform.org/salome_5_1_4/smesh/dev/index.html
/opt/salome_5.1.4/DOCUMENTATION_SRC_5.1.4/SMESH/tui/SMESH/index.html

The docs in your PC are under:

GEOM Module

 galeon file:///opt/salome_5.1.4/DOCUMENTATION_SRC_5.1.4/GEOM/tui/GEOM/index.html
 galeon file:///opt/salome_5.1.4/DOCUMENTATION_SRC_5.1.4/GEOM/gui/GEOM/index.html

MESH Module:

 galeon file:///opt/salome_5.1.4/DOCUMENTATION_SRC_5.1.4/SMESH/tui/SMESH/index.html
 galeon file:///opt/salome_5.1.4/DOCUMENTATION_SRC_5.1.4/SMESH/gui/SMESH/index.html

etc.

By Probing

As a shotgun approach to having all the modules available to you, in the Salome command console type the following:

import GEOM, geompy
import salome, SALOMEDS
import sys, math, time, os
import VISU, visu_gui

Then type:

dir()

You will get a long list such as the one below. The objects shown here will differ from your list, because it is specific to the study I captured it from. But some objects will be common such as GEOM, geompy, salome, SALOMEDS, sys, math, time, os, VISU and visu_gui, since you imported them earlier. Many others such as Compound_1_Faces, DefParabola, Depth, ... Z-Axis, Z_Master, etc. came from the script file that I used in my study.

['Box_1', 'Compound_1', 'Compound_1_Faces', 'DefParabola', 'Depth', 'Extrusion_1', 'Face_1', 'FileName', 'GEOM', 'Height', 'Help',
'Length', 'Line', 'LineList', 'MEFISTO_2D_1', 'Max_Size_1', 'Mesh_1', 'NMax', 'Origin', 'PT_Fixed', 'PT_Load', 'PathName', 
'PlaneDim', 'Regular_1D_1', 'SALOMEDS', 'SMESH', 'SalomeDoc', 'SaveStudy', 'Start', 'StdMeshers', 'Tetrahedron_Netgen', 'VISU', 
'Vertex1', 'Vertex2', 'Vertex_Final', 'Vertex_Initial', 'Width', 'Wire_1', 'X_Axis', 'Y_Axis', 'Z_Axis', 'Z_Fixed', 'Z_Load', 
'Z_Master', '__builtins__', '__doc__', '__name__', 'aColor', 'aCriterion', 'aFace', 'aPoint', 'geompy', 'i', 'index', 'math', 
'myCellEntity', 'myMeshName', 'myNodeEntity', 'myView', 'myViewManager', 'myVisu', 'name', 'os', 'salome', 'smesh', 'smeshDC',
'sys', 'time', 'visu_gui', 'x']

Since the list above shows 'Compound_1', 'Mesh_1', etc. (along with all other modules and objects in the study) ,let us try getting information about some the objects/methods available in a couple of them. If you did not create a compound geometry object you may not have an object called 'Compound_1'; just try it with any other geometric object that you did create (say 'Box_1', 'Sphere_1', etc.)


Since 'Compound_1' is one of the GEOM objects type:

dir(Compound_1)

This list will be more like what you will get, because the GEOM module's compound object has inherited much of its properties from other objects defined in the various Salome modules you imported earlier.

['Destroy', 'GetAutoColor', 'GetColor', 'GetDependency', 'GetEntry', 'GetLastDependency', 'GetMainShape', 'GetMarkerSize',
'GetMarkerTexture', 'GetMarkerType', 'GetName', 'GetParameters', 'GetShapeStream', 'GetShapeType', 'GetStudyEntry', 'GetStudyID',
'GetSubShapeIndices', 'GetType', 'IsMainShape', 'IsShape', 'Register', 'SetAutoColor', 'SetColor', 'SetMarkerStd', 'SetMarkerTexture',
'SetName', 'SetParameters', 'SetStudyEntry', '_NP_RepositoryId', '_Object__release', '__del__', '__doc__', '__getstate__', '__init__',
'__methods__', '__module__', '__omni_obj', '__setstate__', '_duplicate', '_get_interface', '_hash', '_is_a', '_is_equivalent', '_narrow',
'_nil', '_non_existent', '_release', '_unchecked_narrow', 'getShape']

Since 'Mesh_1' is one of the MESH module's object type:

dir(Mesh_1)
['Add0DElement', 'AddEdge', 'AddFace', 'AddHypothesis', 'AddNode', 'AddPolygonalFace', 'AddPolyhedralVolume',
'AddPolyhedralVolumeByFaces', 'AddVolume', 'AdvancedExtrusion', 'AutomaticHexahedralization', 'AutomaticTetrahedralization',
'BaryCenter', 'BestSplit', 'ChangeElemNodes', 'Clear', 'ClearLog', 'ClearSubMesh', 'Compute', 'ConvertFromQuadratic',
'ConvertToQuadratic', 'ConvertToStandalone', 'CreateDimGroup', 'CreateEmptyGroup', 'CutGroups', 'CutListOfGroups', 'DeleteDiag',
'DoubleNode', 'DoubleNodeElem', 'DoubleNodeElemGroup', 'DoubleNodeElemGroupInRegion', 'DoubleNodeElemGroups',
'DoubleNodeElemGroupsInRegion', 'DoubleNodeElemInRegion', 'DoubleNodeGroup', 'DoubleNodeGroups', 'DoubleNodes', 'Dump', 'ElemNbEdges',
'ElemNbFaces', 'Evaluate', 'ExportDAT', 'ExportMED', 'ExportSTL', 'ExportToMED', 'ExportUNV', 'ExtrusionAlongPath',
'ExtrusionAlongPathObject', 'ExtrusionAlongPathObject1D', 'ExtrusionAlongPathObject2D', 'ExtrusionAlongPathX', 'ExtrusionSweep',
'ExtrusionSweepObject', 'ExtrusionSweepObject1D', 'ExtrusionSweepObject2D', 'FindCoincidentNodes', 'FindCoincidentNodesOnPart',
'FindElementByNodes', 'FindElementsByPoint', 'FindEqualElements', 'FindNodeClosestTo', 'GetAlgoState', 'GetAutoColor',
'GetElemFaceNodes', 'GetElemNbNodes', 'GetElemNode', 'GetElemNodes', 'GetElementGeomType', 'GetElementType', 'GetElementsByType',
'GetElementsId', 'GetFreeBorders', 'GetGeometryByMeshElement', 'GetGroupNames', 'GetGroups', 'GetHypothesisList', 'GetId',
'GetIdsFromFilter', 'GetLastCreatedElems', 'GetLastCreatedNodes', 'GetLog', 'GetMEDMesh', 'GetMesh', 'GetMeshEditor', 'GetMeshInfo',
'GetMeshOrder', 'GetName', 'GetNodeInverseElements', 'GetNodePosition', 'GetNodeXYZ', 'GetNodesId', 'GetPointState', 'GetShape',
'GetShapeID', 'GetShapeIDForElem', 'GetStudyId', 'GetSubMesh', 'GetSubMeshElementType', 'GetSubMeshElementsId', 'GetSubMeshNodesId',
'Group', 'GroupOnGeom', 'HasDuplicatedGroupNamesMED', 'Hexahedron', 'IntersectGroups', 'IntersectListOfGroups', 'InverseDiag',
'IsMediumNode', 'IsMediumNodeOfAnyElem', 'IsPoly', 'IsQuadratic', 'IsReadyToCompute', 'Make2DMeshFrom3D', 'MakeGroup',
'MakeGroupByCriteria', 'MakeGroupByCriterion', 'MakeGroupByFilter', 'MakeGroupByIds', 'MergeElements', 'MergeEqualElements',
'MergeNodes', 'MeshDimension', 'MeshToPassThroughAPoint', 'Mirror', 'MirrorMakeMesh', 'MirrorObject', 'MirrorObjectMakeMesh',
'MoveClosestNodeToPoint', 'MoveNode', 'Nb0DElements', 'NbEdges', 'NbEdgesOfOrder', 'NbElements', 'NbFaces', 'NbFacesOfOrder',
'NbGroups', 'NbHexas', 'NbHexasOfOrder', 'NbNodes', 'NbPolygons', 'NbPolyhedrons', 'NbPrisms', 'NbPrismsOfOrder', 'NbPyramids',
'NbPyramidsOfOrder', 'NbQuadrangles', 'NbQuadranglesOfOrder', 'NbSubMesh', 'NbTetras', 'NbTetrasOfOrder', 'NbTriangles',
'NbTrianglesOfOrder', 'NbVolumes', 'NbVolumesOfOrder', 'Netgen', 'Prism', 'Projection1D', 'Projection2D', 'Projection3D', 'QuadToTri',
'QuadToTriObject', 'Quadrangle', 'RemoveElements', 'RemoveGlobalHypotheses', 'RemoveGroup', 'RemoveGroupWithContents',
'RemoveHypothesis', 'RemoveNodes', 'RenumberElements', 'RenumberNodes', 'Reorient', 'ReorientObject', 'Rotate', 'RotateMakeMesh',
'RotateObject', 'RotateObjectMakeMesh', 'RotationSweep', 'RotationSweepObject', 'RotationSweepObject1D', 'RotationSweepObject2D',
'Scale', 'ScaleMakeMesh', 'Segment', 'SetAutoColor', 'SetMesh', 'SetMeshElementOnShape', 'SetMeshOrder', 'SetName', 'SetNodeInVolume',
'SetNodeOnEdge', 'SetNodeOnFace', 'SetNodeOnVertex', 'SetShape', 'SewBorderToSide', 'SewConformFreeBorders', 'SewFreeBorders',
'SewSideElements', 'Smooth', 'SmoothObject', 'SmoothParametric', 'SmoothParametricObject', 'SplitHexaToPrisms', 'SplitHexaToTetras',
'SplitQuad', 'SplitQuadObject', 'SplitQuadsNearTriangularFacets', 'SplitVolumesIntoTetra', 'Tetrahedron', 'Translate',
'TranslateMakeMesh', 'TranslateObject', 'TranslateObjectMakeMesh', 'TriToQuad', 'TriToQuadObject', 'Triangle', 'UnionGroups',
'UnionListOfGroups', 'UseExistingFaces', 'UseExistingSegments', '__doc__', '__init__', '__module__', 'editor', 'geom', 'geompyD',
'mesh', 'smeshpyD']

Copy and paste this output to a text editor and search for "MakeGroup" which reults in:

MakeGroup, MakeGroupByCriteria, MakeGroupByCriterion, MakeGroupByFilter and MakeGroupByIds

By Coding

So a command that should work (provided aCriterion has been previously defined) would be something like:

Load = Mesh_1.MakeGroupByCriterion('Load',aCriterion)

How does one create 'aCriterion'?. This is how:

aCriterion = SMESH.Filter.Criterion(17,32,0,'Z_Load',,32,32,1e-06,SMESH.FACE,-1)

How does one find it?

dir(SMESH.Filter)

Which outputs:

['Criteria', 'Criterion', '_NP_RepositoryId', '__doc__', '__init__', '__module__', '_ad_Criteria', '_d_Criteria', '_d_Criterion',
'_d_Destroy', '_d_GetCriteria', '_d_GetElementType', '_d_GetElementsId', '_d_GetIDs', '_d_GetMeshInfo', '_d_GetPredicate',
'_d_Register', '_d_SetCriteria', '_d_SetMesh', '_d_SetPredicate', '_nil', '_tc_Criteria', '_tc_Criterion']

Repeat the steps above namely, copy/paste into text editor, search for "Criteri" etc. resulting in many objects.

How did one know that we should type dir(SMESH.Filter). Well, because:

1. There are examples listing such a command from conversations on the web forums, or
2. There is an example shown in file:///opt/salome_5.1.4/SMESH_5.1.4/share/doc/salome/gui/SMESH/index.html
3. A dump of your study (after you used a GUI method of creating mesh groups) has it in the *_SMESH.py file
4. You just divined the knowledge
5. You typed 'dir(SMESH)' as shown below:
dir(SMESH)

Then read the long list

['ADD_EDGE', 'ADD_ELEM0D', 'ADD_HEXAHEDRON', 'ADD_NODE', 'ADD_POLYGON', 'ADD_POLYHEDRON', 'ADD_PRISM', 'ADD_PYRAMID', 'ADD_QUADEDGE',
'ADD_QUADHEXAHEDRON', 'ADD_QUADPENTAHEDRON', 'ADD_QUADPYRAMID', 'ADD_QUADQUADRANGLE', 'ADD_QUADRANGLE', 'ADD_QUADTETRAHEDRON',
'ADD_QUADTRIANGLE', 'ADD_TETRAHEDRON', 'ADD_TRIANGLE', 'ALL', 'AlgoStateError', 'Area', 'AspectRatio', 'AspectRatio3D', 'AxisStruct',
'BadOrientedVolume', 'BelongToCylinder', 'BelongToGenSurface', 'BelongToGeom', 'BelongToPlane', 'BelongToSurface',
'CHANGE_ELEMENT_NODES', 'CHANGE_POLYHEDRON_NODES', 'CLEAR_MESH', 'COMPERR_ALGO_FAILED', 'COMPERR_BAD_INPUT_MESH', 'COMPERR_BAD_SHAPE',
'COMPERR_EXCEPTION', 'COMPERR_MEMORY_PB', 'COMPERR_OCC_EXCEPTION', 'COMPERR_OK', 'COMPERR_SLM_EXCEPTION', 'COMPERR_STD_EXCEPTION',
'Comparator', 'ComputeError', 'ComputeErrorName', 'DIM_0D', 'DIM_1D', 'DIM_2D', 'DIM_3D', 'DRS_EMPTY', 'DRS_FAIL', 'DRS_OK',
'DRS_WARN_RENUMBER', 'DRS_WARN_SKIP_ELEM', 'Dimension', 'DirStruct', 'DriverMED_ReadStatus', 'EDGE', 'ELEM0D',
'EXTRUSION_FLAG_BOUNDARY', 'EXTRUSION_FLAG_SEW', 'ElemGeomType', 'ElementOrder', 'ElementSubType', 'ElementType', 'EntityType',
'Entity_0D', 'Entity_Edge', 'Entity_Hexa', 'Entity_Last', 'Entity_Node', 'Entity_Penta', 'Entity_Polygon', 'Entity_Polyhedra',
'Entity_Pyramid', 'Entity_Quad_Edge', 'Entity_Quad_Hexa', 'Entity_Quad_Penta', 'Entity_Quad_Polygon', 'Entity_Quad_Polyhedra',
'Entity_Quad_Pyramid', 'Entity_Quad_Quadrangle', 'Entity_Quad_Tetra', 'Entity_Quad_Triangle', 'Entity_Quadrangle', 'Entity_Tetra',
'Entity_Triangle', 'EqualTo', 'FACE', 'FT_Area', 'FT_AspectRatio', 'FT_AspectRatio3D', 'FT_BadOrientedVolume', 'FT_BelongToCylinder',
'FT_BelongToGenSurface', 'FT_BelongToGeom', 'FT_BelongToPlane', 'FT_ElemGeomType', 'FT_EqualTo', 'FT_FreeBorders', 'FT_FreeEdges',
'FT_FreeFaces', 'FT_FreeNodes', 'FT_GroupColor', 'FT_Length', 'FT_Length2D', 'FT_LessThan', 'FT_LinearOrQuadratic', 'FT_LogicalAND',
'FT_LogicalNOT', 'FT_LogicalOR', 'FT_LyingOnGeom', 'FT_MinimumAngle', 'FT_MoreThan', 'FT_MultiConnection', 'FT_MultiConnection2D',
'FT_RangeOfIds', 'FT_Skew', 'FT_Taper', 'FT_Undefined', 'FT_Volume3D', 'FT_Warping', 'Filter', 'FilterLibrary', 'FilterManager',
'FreeBorders', 'FreeEdges', 'FreeFaces', 'FreeNodes', 'Functor', 'FunctorType', 'Geom_EDGE', 'Geom_HEXA', 'Geom_PENTA', 'Geom_POINT',
'Geom_POLYGON', 'Geom_POLYHEDRA', 'Geom_PYRAMID', 'Geom_QUADRANGLE', 'Geom_TETRA', 'Geom_TRIANGLE', 'GeometryType', 'GroupColor',
'HYP_ALREADY_EXIST', 'HYP_BAD_DIM', 'HYP_BAD_GEOMETRY', 'HYP_BAD_PARAMETER', 'HYP_BAD_SUBSHAPE', 'HYP_CONCURENT', 'HYP_HIDDEN_ALGO',
'HYP_HIDING_ALGO', 'HYP_INCOMPATIBLE', 'HYP_MISSING', 'HYP_NEED_SHAPE', 'HYP_NOTCONFORM', 'HYP_OK', 'HYP_UNKNOWN_FATAL',
'Hypothesis_Status', 'Length', 'Length2D', 'LessThan', 'LinearOrQuadratic', 'ListOfGroups', 'ListOfHypothesis', 'ListOfHypothesisName',
'ListOfParameters', 'Logical', 'LogicalAND', 'LogicalBinary', 'LogicalNOT', 'LogicalOR', 'LyingOnGeom', 'MED_V2_1', 'MED_V2_2',
'MED_VERSION', 'MOVE_NODE', 'MeshPreviewStruct', 'MinimumAngle', 'MoreThan', 'MultiConnection', 'MultiConnection2D', 'NODE',
'NodePosition', 'NumericalFunctor', 'ORDER_ANY', 'ORDER_LINEAR', 'ORDER_QUADRATIC', 'PointStruct', 'Predicate', 'REMOVE_ELEMENT',
'REMOVE_NODE', 'RENUMBER', 'RangeOfIds', 'SMESH_0D_Algo', 'SMESH_1D_Algo', 'SMESH_2D_Algo', 'SMESH_3D_Algo', 'SMESH_Algo',
'SMESH_Filter_idl', 'SMESH_Gen', 'SMESH_Gen_idl', 'SMESH_Group', 'SMESH_GroupBase', 'SMESH_GroupOnGeom', 'SMESH_Group_idl',
'SMESH_Hypothesis', 'SMESH_Hypothesis_idl', 'SMESH_IDSource', 'SMESH_Mesh', 'SMESH_MeshEditor', 'SMESH_MeshEditor_idl',
'SMESH_Mesh_idl', 'SMESH_Pattern', 'SMESH_Pattern_idl', 'SMESH_subMesh', 'Skew', 'Tag_AlgorithmsRoot', 'Tag_EdgeGroups',
'Tag_FaceGroups', 'Tag_FirstGroup', 'Tag_FirstMeshRoot', 'Tag_FirstSubMesh', 'Tag_HypothesisRoot', 'Tag_LastGroup', 'Tag_LastSubMesh',
'Tag_NodeGroups', 'Tag_RefOnAppliedAlgorithms', 'Tag_RefOnAppliedHypothesis', 'Tag_RefOnShape', 'Tag_SubMeshOnCompound',
'Tag_SubMeshOnEdge', 'Tag_SubMeshOnFace', 'Tag_SubMeshOnShell', 'Tag_SubMeshOnSolid', 'Tag_SubMeshOnVertex', 'Tag_SubMeshOnWire',
'Tag_VolumeGroups', 'Taper', 'VOLUME', 'Volume3D', 'Warping', '__builtins__', '__doc__', '__file__', '__name__', '__path__',
'_ad_ListOfGroups', '_ad_ListOfHypothesis', '_ad_ListOfHypothesisName', '_ad_ListOfParameters', '_ad_algo_error_array',
'_ad_array_of_long_array', '_ad_compute_error_array', '_ad_double_array', '_ad_log_array', '_ad_long_array', '_ad_mesh_array',
'_ad_nodes_array', '_ad_object_array', '_ad_point_array', '_ad_string_array', '_ad_submesh_array', '_ad_submesh_array_array',
'_ad_types_array', '_d_AlgoStateError', '_d_Area', '_d_AspectRatio', '_d_AspectRatio3D', '_d_AxisStruct', '_d_BadOrientedVolume',
'_d_BelongToCylinder', '_d_BelongToGenSurface', '_d_BelongToGeom', '_d_BelongToPlane', '_d_BelongToSurface', '_d_Comparator',
'_d_ComputeError', '_d_ComputeErrorName', '_d_Dimension', '_d_DirStruct', '_d_DriverMED_ReadStatus', '_d_ElemGeomType',
'_d_ElementOrder', '_d_ElementSubType', '_d_ElementType', '_d_EntityType', '_d_EqualTo', '_d_Filter', '_d_FilterLibrary',
'_d_FilterManager', '_d_FreeBorders', '_d_FreeEdges', '_d_FreeFaces', '_d_FreeNodes', '_d_Functor', '_d_FunctorType', '_d_GeometryType', '_d_GroupColor', '_d_Hypothesis_Status', '_d_Length', '_d_Length2D', '_d_LessThan', '_d_LinearOrQuadratic',
'_d_ListOfGroups', '_d_ListOfHypothesis', '_d_ListOfHypothesisName', '_d_ListOfParameters', '_d_Logical', '_d_LogicalAND',
'_d_LogicalBinary', '_d_LogicalNOT', '_d_LogicalOR', '_d_LyingOnGeom', '_d_MED_VERSION', '_d_MeshPreviewStruct', '_d_MinimumAngle',
'_d_MoreThan', '_d_MultiConnection', '_d_MultiConnection2D', '_d_NodePosition', '_d_NumericalFunctor', '_d_PointStruct',
'_d_Predicate', '_d_RangeOfIds', '_d_SMESH_0D_Algo', '_d_SMESH_1D_Algo', '_d_SMESH_2D_Algo', '_d_SMESH_3D_Algo', '_d_SMESH_Algo',
'_d_SMESH_Gen', '_d_SMESH_Group', '_d_SMESH_GroupBase', '_d_SMESH_GroupOnGeom', '_d_SMESH_Hypothesis', '_d_SMESH_IDSource',
'_d_SMESH_Mesh', '_d_SMESH_MeshEditor', '_d_SMESH_Pattern', '_d_SMESH_subMesh', '_d_Skew', '_d_Taper', '_d_Volume3D', '_d_Warping',
'_d_algo_error_array', '_d_array_of_long_array', '_d_compute_error_array', '_d_double_array', '_d_log_array', '_d_log_block',
'_d_log_command', '_d_long_array', '_d_mesh_array', '_d_nodes_array', '_d_object_array', '_d_point_array', '_d_string_array',
'_d_submesh_array', '_d_submesh_array_array', '_d_types_array', '_objref_Area', '_objref_AspectRatio', '_objref_AspectRatio3D',
'_objref_BadOrientedVolume', '_objref_BelongToCylinder', '_objref_BelongToGenSurface', '_objref_BelongToGeom', '_objref_BelongToPlane',
'_objref_BelongToSurface', '_objref_Comparator', '_objref_ElemGeomType', '_objref_EqualTo', '_objref_Filter', '_objref_FilterLibrary',
'_objref_FilterManager', '_objref_FreeBorders', '_objref_FreeEdges', '_objref_FreeFaces', '_objref_FreeNodes', '_objref_Functor',
'_objref_GroupColor', '_objref_Length', '_objref_Length2D', '_objref_LessThan', '_objref_LinearOrQuadratic', '_objref_Logical',
'_objref_LogicalAND', '_objref_LogicalBinary', '_objref_LogicalNOT', '_objref_LogicalOR', '_objref_LyingOnGeom',
'_objref_MinimumAngle', '_objref_MoreThan', '_objref_MultiConnection', '_objref_MultiConnection2D', '_objref_NumericalFunctor',
'_objref_Predicate', '_objref_RangeOfIds', '_objref_SMESH_0D_Algo', '_objref_SMESH_1D_Algo', '_objref_SMESH_2D_Algo',
'_objref_SMESH_3D_Algo', '_objref_SMESH_Algo', '_objref_SMESH_Gen', '_objref_SMESH_Group', '_objref_SMESH_GroupBase',
'_objref_SMESH_GroupOnGeom', '_objref_SMESH_Hypothesis', '_objref_SMESH_IDSource', '_objref_SMESH_Mesh', '_objref_SMESH_MeshEditor',
'_objref_SMESH_Pattern', '_objref_SMESH_subMesh', '_objref_Skew', '_objref_Taper', '_objref_Volume3D', '_objref_Warping',
'_tc_AlgoStateError', '_tc_Area', '_tc_AspectRatio', '_tc_AspectRatio3D', '_tc_AxisStruct', '_tc_BadOrientedVolume',
'_tc_BelongToCylinder', '_tc_BelongToGenSurface', '_tc_BelongToGeom', '_tc_BelongToPlane', '_tc_BelongToSurface', '_tc_Comparator',
'_tc_ComputeError', '_tc_ComputeErrorName', '_tc_Dimension', '_tc_DirStruct', '_tc_DriverMED_ReadStatus', '_tc_ElemGeomType',
'_tc_ElementOrder', '_tc_ElementSubType', '_tc_ElementType', '_tc_EntityType', '_tc_EqualTo', '_tc_Filter', '_tc_FilterLibrary',
'_tc_FilterManager', '_tc_FreeBorders', '_tc_FreeEdges', '_tc_FreeFaces', '_tc_FreeNodes', '_tc_Functor', '_tc_FunctorType',
'_tc_GeometryType', '_tc_GroupColor', '_tc_Hypothesis_Status', '_tc_Length', '_tc_Length2D', '_tc_LessThan', '_tc_LinearOrQuadratic',
'_tc_ListOfGroups', '_tc_ListOfHypothesis', '_tc_ListOfHypothesisName', '_tc_ListOfParameters', '_tc_Logical', '_tc_LogicalAND',
'_tc_LogicalBinary', '_tc_LogicalNOT', '_tc_LogicalOR', '_tc_LyingOnGeom', '_tc_MED_VERSION', '_tc_MeshPreviewStruct',
'_tc_MinimumAngle', '_tc_MoreThan', '_tc_MultiConnection', '_tc_MultiConnection2D', '_tc_NodePosition', '_tc_NumericalFunctor',
'_tc_PointStruct', '_tc_Predicate', '_tc_RangeOfIds', '_tc_SMESH_0D_Algo', '_tc_SMESH_1D_Algo', '_tc_SMESH_2D_Algo',
'_tc_SMESH_3D_Algo', '_tc_SMESH_Algo', '_tc_SMESH_Gen', '_tc_SMESH_Group', '_tc_SMESH_GroupBase', '_tc_SMESH_GroupOnGeom',
'_tc_SMESH_Hypothesis', '_tc_SMESH_IDSource', '_tc_SMESH_Mesh', '_tc_SMESH_MeshEditor', '_tc_SMESH_Pattern', '_tc_SMESH_subMesh',
'_tc_Skew', '_tc_Taper', '_tc_Volume3D', '_tc_Warping', '_tc_algo_error_array', '_tc_array_of_long_array', '_tc_compute_error_array',
'_tc_double_array', '_tc_log_array', '_tc_log_block', '_tc_log_command', '_tc_long_array', '_tc_mesh_array', '_tc_nodes_array',
'_tc_object_array', '_tc_point_array', '_tc_string_array', '_tc_submesh_array', '_tc_submesh_array_array', '_tc_types_array',
'algo_error_array', 'array_of_long_array', 'compute_error_array', 'double_array', 'log_array', 'log_block', 'log_command',
'long_array', 'mesh_array', 'nodes_array', 'object_array', 'omniORB', 'point_array', 'string_array', 'submesh_array',
'submesh_array_array', 'types_array']

and meticulously and patiently typed 'dir(SMESH.ADD_EDGE)' examined the output; typed 'dir(SMESH.ADD_ELEM0D), examined its output, etc until you got to 'dir(SMESH.Filter') !!!

Where does one find details of this "aCriterion = SMESH.Filter.Criterion(17,32,0,'Z_Load',,32,32,1e-06,SMESH.FACE,-1)" command?

Here:

http://docs.salome-platform.org/salome_5_1_4/smesh/dev/SMESH__Filter_8idl_source.html                     Salome Web Docs
http://www.salome-platform.org/forum/forum_10/971846854#934110303                                         Salome Web Forum
/opt/salome_5.1.4/DOCUMENTATION_SRC_5.1.4/SMESH/tui/SMESH/SMESH__Filter_8idl_source.html                  On your PC
/opt/salome_5.1.4/SMESH_5.1.4/idl/salome/SMESH_Filter.idl                                                 On your PC
/opt/salome_5.1.4/SMESH_5.1.4/share/doc/salome/gui/SMESH/index.html (Grouping Elements)                   On your PC
http://docs.salome-platform.org/salome_5_1_4/smesh/dev/structSMESH_1_1Filter_1_1Criterion.html            Salome Web Docs
/opt/salome_5.1.4/DOCUMENTATION_SRC_5.1.4/SMESH/tui/SMESH/structSMESH_1_1Filter_1_1Criterion.html         On your PC


By Copying

By copying (meaning legally plagiarizing) code that others have published under the OSS umbrella.

To be Continued

Acknowledgements

This page was made possible by the help and advice of several individuals on the Salome Forum in particular: Christophe BOURCIER, Pete HALVERSON and Kees WOUTERS and many others. If I have missed mentioning somebody whose name should be added, please let me know or edit this section since it is a Wiki that anybody can add to, or correct.

Disclaimer: This page is still evolving and omissions or errors are a regrettable part of such a process. So user beware! -JMB