Difference between revisions of "Contrib:KeesWouters/partition"

From CAELinuxWiki
Jump to: navigation, search
('''Partitioning the various parts''')
('''Partitioning the various parts''')
Line 27: Line 27:
 
[[Image:Kw_surface400.jpg]]
 
[[Image:Kw_surface400.jpg]]
  
Now the partition can be calculated by MakePartition. The first argument is the fused body (Fassembl), the second argument are the dividing planes determined above. It is possible here to define multiple dividing planes, so the partition can be made in one go: Partit=geompy.MakePartition([Fassembl],[P12,PCyl1,PCyl2],[],[],geompy.ShapeType["SOLID"],0,[],0)
+
The partition can be calculated by MakePartition. The first argument is the fused body (Fassembl), the second argument are the dividing planes determined above. It is possible here to define multiple dividing planes, so the partition can be made in one go: Partit=geompy.MakePartition([Fassembl],[P12,PCyl1,PCyl2],[],[],geompy.ShapeType["SOLID"],0,[],0)
 
+
Now most of the work has been done. We still need to create the groups under the entity Partit by CreateGroup(), UnionIDs() and GetMainShape(). See the attached Python script for more details.
+
  
 +
Most of the work has been done. We still need to create the groups under the entity Partit by CreateGroup(), UnionIDs() and GetMainShape(). See the attached Python script for more details.
  
 +
==='''Result of the partitioning'''===
 +
In the object browser the following tree is now visible:
 
[[Image:Kw_partit.png]]
 
[[Image:Kw_partit.png]]
 +
 +
Under the Partition Partit the fuse Fassembl is given, together with the three dividing surfaces: P12. Pcyl1 and Pcyl2. In black the partitions BPshoe, BPtop, BPcyl1 and BPcyl2 are defined. These four blocks are now available to be transfered to the mesh and to Code Aster. Seperate material properties can be given to them.
 +
 +
Note the now four partions are available, because the two cylinders are now seperated by the partition operation.
 +
 +
Of course there are many ways to create the fuses and the partition. This is one way that works for me. Hope that this is usefull for you as well. And, pls do not hesitate to add improvements here ;-)

Revision as of 15:24, 26 May 2009

Defining a construction with four bodies in Salome

The construction consists of a shoe box, a plate on top of it and two cylinders inside the top plate. In total four different bodies are created by partitioning the main body. Each body can have different materials applied to it in the C-Aster command file.

Kw part400.jpg * Kw part400t.jpg


General definition of the construction with Salome

First a solid block is defined by the geompy.MakeBoxDXDYDZ(3,5,2). The internal block to cut away a apart of this block is defined by the four outside nodes, linking the nodes by lines and defining. A face is defined by the four lines. Extruding the face up to 1.8 mm high then defines a solid block. After this a shoe box remains with wallthickness of 0.2 mm.

On top of this shoebox a top plate is defined. It outer dimensions are 0.2 mm less than the shoebox and height is 0.8 mm.

Inside the top plate two cylinders are defined, radii 0.7 and 0.5 and height 1.0 mm. These two cylinders consist of one solid only within Salome because they are defined at once using the two axial areas of the cylinders.

Fusing the various parts

Now all parts are defined and we can fuse the three parts together. This is necessary if we want a mesh that is 'glued' together between the various parts. So we fuse:

# Fshoecyl <-- shoebox and cylinders and use the result together with top plate
# Fassembl <-- Fshoecyl and Btop

Now one solid part exists. To be able to apply different material properties to the various parts, we need to partition them again.

Partitioning the various parts

In order to partition the parts we need to define the boundaries between the parts.

  • Between the shoebox on the one hand and the top plate and cylinders on the other hand, we define a plane P12, that coincides with the top plane of the shoe box. We generate a centre point, a vector in z direction and define a size for this plane: P12 = geompy.MakePlane(centre point, direction vector, plane size). Make sure that the size Psize is large enough to cover the whole top plane of the shoe box. If this is not the case, Salome fails to partition the bottom and top parts.
  • Between the cylinders and the top plate the areas of cylinders can be used as a boundary between these parts. Again, make sure that the height of the area is enough to cover the cylinders, otherwise Salome fails to generate the partition.

Kw surface400.jpg

The partition can be calculated by MakePartition. The first argument is the fused body (Fassembl), the second argument are the dividing planes determined above. It is possible here to define multiple dividing planes, so the partition can be made in one go: Partit=geompy.MakePartition([Fassembl],[P12,PCyl1,PCyl2],[],[],geompy.ShapeType["SOLID"],0,[],0)

Most of the work has been done. We still need to create the groups under the entity Partit by CreateGroup(), UnionIDs() and GetMainShape(). See the attached Python script for more details.

Result of the partitioning

In the object browser the following tree is now visible: Kw partit.png

Under the Partition Partit the fuse Fassembl is given, together with the three dividing surfaces: P12. Pcyl1 and Pcyl2. In black the partitions BPshoe, BPtop, BPcyl1 and BPcyl2 are defined. These four blocks are now available to be transfered to the mesh and to Code Aster. Seperate material properties can be given to them.

Note the now four partions are available, because the two cylinders are now seperated by the partition operation.

Of course there are many ways to create the fuses and the partition. This is one way that works for me. Hope that this is usefull for you as well. And, pls do not hesitate to add improvements here ;-)