Update TUI doc on groups

+ Correct export of polyhedra in DAT format (to make them readable)
This commit is contained in:
eap 2017-01-23 20:08:38 +03:00
parent 21af9b3a2c
commit dfcca981be
22 changed files with 45 additions and 36 deletions

View File

@ -69,13 +69,13 @@ Ginf2=Mesh_sup.Group(Finf2, "Inf")
## create compounds
# create a compound of two meshes with renaming namesake groups and
# merging of elements with the given tolerance
# merging elements with the given tolerance
Compound1 = smesh.Concatenate([Mesh_inf, Mesh_sup], 0, 1, 1e-05,
name='Compound_with_RenamedGrps_and_MergeElems')
name='Compound with RenamedGrps and MergeElems')
# create a compound of two meshes with uniting namesake groups and
# creating groups of all elements
Compound2 = smesh.Concatenate([Mesh_inf, Mesh_sup], 1, 0, 1e-05, True,
name='Compound_with_UniteGrps_and_GrpsOfAllElems')
name='Compound with UniteGrps and GrpsOfAllElems')
if salome.sg.hasDesktop():
salome.sg.updateObjBrowser(True)

View File

@ -27,6 +27,7 @@ print "Criterion: Area > 40, Nb = ", len(anIds)
# create a group of elements with area [35; 40] by removing elements with area > 40 from group aGroup
aGroup.Remove(anIds)
aGroup.SetName("35 < Area < 40")
# print the result
aGroupElemIDs = aGroup.GetListOfID()

View File

@ -32,6 +32,7 @@ aGroup2.Add(anIds)
# create union group : area >= 20
aGroup3 = mesh.UnionListOfGroups([aGroup1, aGroup2], "Area >= 20")
aGroup3.SetColor( SALOMEDS.Color(1.,1.,0.));
print "Criterion: Area >= 20, Nb = ", len(aGroup3.GetListOfID())
# Please note that also there is UnionGroups() method which works with two groups only
@ -45,6 +46,7 @@ print "Criterion: Area < 20, Nb = ", len(anIds)
# create a group by adding elements with area < 20
aGroup4 = mesh.CreateEmptyGroup(SMESH.FACE, "Area < 20")
aGroup4.Add(anIds)
aGroup4.SetColor( SALOMEDS.Color(1.,0.,0.));
# create union group : area >= 20 and area < 20
aGroup5 = mesh.UnionListOfGroups([aGroup3, aGroup4], "Any Area")

View File

@ -12,6 +12,7 @@ aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_Area, SMESH.FT_MoreThan, 100.)
# create a group by adding elements with area > 100
aSrcGroup1 = mesh.GroupOnFilter(SMESH.FACE, "Area > 100", aFilter)
aSrcGroup1.SetColor( SALOMEDS.Color(1.,1.,0.))
print "Criterion: Area > 100, Nb = ", aSrcGroup1.Size()
# Criterion : AREA < 30
@ -19,6 +20,7 @@ aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_Area, SMESH.FT_LessThan, 30.)
# create a group by adding elements with area < 30
aSrcGroup2 = mesh.GroupOnFilter(SMESH.FACE, "Area < 30", aFilter)
aSrcGroup2.SetColor( SALOMEDS.Color(1.,0.,0.))
print "Criterion: Area < 30, Nb = ", aSrcGroup2.Size()

BIN
doc/salome/gui/SMESH/images/create_group.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

BIN
doc/salome/gui/SMESH/images/cut_groups1.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

BIN
doc/salome/gui/SMESH/images/editing_groups1.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

BIN
doc/salome/gui/SMESH/images/intersect_groups1.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

BIN
doc/salome/gui/SMESH/images/union_groups1.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

View File

@ -24,7 +24,7 @@
\tui_script{a3DmeshOnModified2Dmesh.py}
<br>
\section tui_editing_mesh Editing a mesh
\section tui_editing_mesh Editing a mesh (i.e. changing hypotheses)
\tui_script{creating_meshes_ex04.py}
<br>

View File

@ -24,47 +24,29 @@
\image html editing_groups1.png
\image html editing_groups2.png
<br>
\section tui_union_of_groups Union of groups
\tui_script{grouping_elements_ex05.py}
\image html union_groups1.png
\image html union_groups2.png
\image html union_groups3.png
<br>
\section tui_intersection_of_groups Intersection of groups
\tui_script{grouping_elements_ex06.py}
\image html intersect_groups1.png
\image html intersect_groups2.png
\image html intersect_groups3.png
<br>
\section tui_cut_of_groups Cut of groups
\tui_script{grouping_elements_ex07.py}
\image html cut_groups1.png
\image html cut_groups2.png
\image html cut_groups3.png
<br>
\section tui_create_dim_group Creating groups of entities from existing groups of superior dimensions
\section tui_create_dim_group Creating groups of entities basing on nodes of other groups
\tui_script{grouping_elements_ex08.py}
\image html dimgroup_tui1.png
<center>Source groups of faces</center>
\image html dimgroup_tui2.png
<center>Result groups of edges and nodes</center>

View File

@ -41,7 +41,8 @@ Driver_Mesh::Status DriverDAT_W_SMDS_Mesh::Perform()
char *file2Read = (char *)myFile.c_str();
FILE* aFileId = fopen(file2Read, "w+");
if ( !aFileId ) {
if ( !aFileId )
{
fprintf(stderr, ">> ERREUR : ouverture du fichier %s \n", file2Read);
return DRS_FAIL;
}
@ -71,20 +72,23 @@ Driver_Mesh::Status DriverDAT_W_SMDS_Mesh::Perform()
****************************************************************************/
SMDS_NodeIteratorPtr itNodes=myMesh->nodesIterator();
while(itNodes->more()){
while(itNodes->more())
{
const SMDS_MeshNode * node = itNodes->next();
fprintf(aFileId, "%d %.14e %.14e %.14e\n", node->GetID(), node->X(), node->Y(), node->Z());
}
/****************************************************************************
* ECRITURE DES ELEMENTS *
****************************************************************************/
/* Ecriture des connectivites, noms, numeros des mailles */
SMDS_EdgeIteratorPtr itEdges=myMesh->edgesIterator();
while(itEdges->more()){
while(itEdges->more())
{
const SMDS_MeshElement * elem = itEdges->next();
switch (elem->NbNodes()) {
switch (elem->NbNodes())
{
case 2:
fprintf(aFileId, "%d %d ", elem->GetID(), 102);
break;
@ -93,33 +97,51 @@ Driver_Mesh::Status DriverDAT_W_SMDS_Mesh::Perform()
break;
}
SMDS_ElemIteratorPtr it=elem->nodesIterator();
while(it->more())
while(it->more())
fprintf(aFileId, "%d ", it->next()->GetID());
fprintf(aFileId, "\n");
}
SMDS_FaceIteratorPtr itFaces=myMesh->facesIterator();
while(itFaces->more()){
while(itFaces->more())
{
const SMDS_MeshElement * elem = itFaces->next();
if ( elem->IsPoly() )
fprintf(aFileId, "%d %d ", elem->GetID(), 400+elem->NbNodes());
else
fprintf(aFileId, "%d %d ", elem->GetID(), 200+elem->NbNodes());
SMDS_ElemIteratorPtr it=elem->nodesIterator();
while(it->more())
while(it->more())
fprintf(aFileId, "%d ", it->next()->GetID());
fprintf(aFileId, "\n");
}
SMDS_VolumeIteratorPtr itVolumes=myMesh->volumesIterator();
while(itVolumes->more()){
const SMDS_VtkVolume* v;
while(itVolumes->more())
{
const SMDS_MeshElement * elem = itVolumes->next();
if ( elem->IsPoly() )
{
fprintf(aFileId, "%d %d ", elem->GetID(), 500+elem->NbNodes());
if (( v = dynamic_cast< const SMDS_VtkVolume*>( elem )))
{
std::vector<int> quant = v->GetQuantities();
if ( !quant.empty() )
{
fprintf(aFileId, "%d %d ", quant.size(), quant[0]);
for ( size_t i = 1; i < quant.size(); ++i )
fprintf(aFileId, "%d ", quant[i]);
}
}
}
else
{
fprintf(aFileId, "%d %d ", elem->GetID(), 300+elem->NbNodes());
}
SMDS_ElemIteratorPtr it=elem->nodesIterator();
while(it->more())
while(it->more())
fprintf(aFileId, "%d ", it->next()->GetID());
fprintf(aFileId, "\n");

View File

@ -329,7 +329,7 @@ const std::vector<UVPtStruct>& StdMeshers_FaceSide::GetUVPtStruct(bool isXCons
SMESH_MesherHelper eHelper( *myProxyMesh->GetMesh() );
SMESH_MesherHelper fHelper( *myProxyMesh->GetMesh() );
fHelper.SetSubShape( myFace );
bool paramOK;
bool paramOK = true;
double eps = 1e-100;
// sort nodes of all edges by putting them into a map