.. image:: images/intro_31.png
:align: center
-Two answers must be given: the directory that will contain the files produced by the further adaptations and the MED file from the initial calculation. In this case, the default options are left unchanged: conformity of the mesh and no curved boundaries. Validate by "Apply and close".
+Two answers must be given: the directory that will contain the files produced by the further adaptations and the MED file from the initial calculation. In this case, the default options are left unchanged: conformity of the mesh and no curved boundaries. Validate by "OK".
.. image:: images/intro_32.png
:align: center
.. image:: images/intro_36.png
:align: center
-The creation of the hypothesis is validated by "Apply and close"; the creation of the new iteration is validated too. The object browser is enriched by the description of this hypothesis and this iteration. The iteration can be seen with a specific icon "waiting".
+The creation of the hypothesis is validated by "OK"; the creation of the new iteration is validated too. The object browser is enriched by the description of this hypothesis and this iteration. The iteration can be seen with a specific icon "waiting".
The adaptation is launched by the selection of the iteration. "*Compute*" is choosen either in the menu, or with the mouse. The MED file of the new mesh, ``maill.01.med``, and some files for information are included into the object browser. Note that the MED file of the new mesh is located into the directory of the case.
############
.. index:: single: boundary
.. index:: single: frontière
+.. index:: single: CAO
The object boundary contains all the geometrical definitions allowing to describe a curved boundary to be followed.
There are two modes of description of a boundary:
- - Discrete: this mode is used to describe a curve 1D
- - Analytics: this mode is used to describe a surface
+ - CAO: the boundary comes from the geometry of the domain
+ - Non CAO: if the CAO is not available, the boundary can be approxaimted by its descriptions:
+ * Discrete: to describe the set of 1D curves that defines the boundary
+ * Analytics: to describe every surface that defines the boundary
+
+This choice is:
+
+.. image:: images/create_boundary_1.png
+ :align: center
+
+CAO boundary
+************
+
+The follow-up of a CAO boundary will be made by selecting a boundary chosen in the list of the existing CAO boundaries.
+
+In the starting up, the list is empty. It is necessary to create a first CAO boundary by activation of the button "*New*":
+
+.. image:: images/create_boundary_cao_1.png
+ :align: center
+
+The window invites in the choice of a file that contains the CAO with XAO format. This CAO is the one that is the basis for the initial mesh. A name of boundary is automatically proposed: Boun_1, Boun_2, etc. This name can be modified. It must not already have been used for another boundary, whatever its type.
+
+.. image:: images/create_boundary_cao_2.png
+ :align: center
+
+.. note::
+ The coherence between this CAO and the initial mesh is not checked.
Discrete boundary
*****************
The follow-up of a discrete boundary will be made by selecting a boundary chosen in the list of the existing discrete boundaries.
-In the starting up, the list is empty. It is necessary to create a first discrete boundary by activation of the button "*New*" :
+In the starting up, the list is empty. It is necessary to create a first discrete boundary by activation of the button "*New*":
.. image:: images/create_boundary_di_1.png
:align: center
-The window invites in the choice of a file of mesh. This mesh is the one of all the lines constituting the boundary. A name of boundary is automatically proposed: Boun_1, Boun_2, etc. This name can be modified. It must not already have been used for another boundary.
+The window invites in the choice of a file of mesh. This mesh is the one of all the lines constituting the boundary. A name of boundary is automatically proposed: Boun_1, Boun_2, etc. This name can be modified. It must not already have been used for another boundary, whatever its type.
.. image:: images/create_boundary_di_2.png
:align: center
========
.. index:: single: cylindre
-The cylinder is defined by a point of the axis, its axis and its radius. The axis is defined by a vector. The standard of this vector is not inevitably equal to 1; also, its orientation has no importance. A name of boundary is automatically proposed: Boun_1, Boun_2, etc. This name can be modified. It must not already have been used for another boundary.
+The cylinder is defined by a point of the axis, its axis and its radius. The axis is defined by a vector. The standard of this vector is not inevitably equal to 1; also, its orientation has no importance. A name of boundary is automatically proposed: Boun_1, Boun_2, etc. This name can be modified. It must not already have been used for another boundary, whatever its type.
.. image:: images/create_boundary_an_cy.png
:align: center
======
.. index:: single: sphere
-The sphere is defined by its center and its radius. A name of boundary is automatically proposed: Boun_1, Boun_2, etc. This name can be modified. It must not already have been used for another boundary.
+The sphere is defined by its center and its radius. A name of boundary is automatically proposed: Boun_1, Boun_2, etc. This name can be modified. It must not already have been used for another boundary, whatever its type.
.. image:: images/create_boundary_an_sp.png
:align: center
====
.. index:: single: cone
-A cone is defined by two different manners: the center, the axis and the angle of opening in degree or by two points centered on the axis and the associated radius. A name of boundary is automatically proposed: Boun_1, Boun_2, etc. This name can be modified. It must not already have been used for another boundary.
+A cone is defined by two different manners: the center, the axis and the angle of opening in degree or by two points centered on the axis and the associated radius. A name of boundary is automatically proposed: Boun_1, Boun_2, etc. This name can be modified. It must not already have been used for another boundary, whatever its type.
Creation by an origin, an axis and an angle of opening:
=====
.. index:: single: torus
-The torus is defined by its centre, its axis, the revolution radius and the primary radius. The axis is defined by a vector. The standard of this vector is not inevitably equal to 1; also, its orientation has no importance. A name of boundary is automatically proposed: Boun_1, Boun_2, etc. This name can be modified. It must not already have been used for another boundary.
+The torus is defined by its centre, its axis, the revolution radius and the primary radius. The axis is defined by a vector. The standard of this vector is not inevitably equal to 1; also, its orientation has no importance. A name of boundary is automatically proposed: Boun_1, Boun_2, etc. This name can be modified. It must not already have been used for another boundary, whatever its type.
.. image:: images/create_boundary_an_to.png
:align: center
**************
At the end of this creation of boundaries, the object browser was enriched. We find all the boundaries created, identified there by their name, with the possibility of editing them.
-.. image:: images/create_boundary_1.png
+.. image:: images/create_boundary.png
:align: center
Corresponding python functions
Two situations:
-* 1D curve: this curve may be defined into a plane, for example for a 2D calculation. It can also be defined into the 3D space, for example to describe the intersection of two surfaces. Such a line is defined with a discrete desription.
-* a surface: such a surface is defined with an analytical description.
+- CAO: the CAO of the domain is available. The computtion will rely on it to project the nodes.
+- No CAO: if no CAO is available, an approximative approach is possible:
+
+ * 1D curve: this curve may be defined into a plane, for example for a 2D calculation. It can also be defined into the 3D space, for example to describe the intersection of two surfaces. Such a line is defined with a discrete desription.
+ * a surface: such a surface is defined with an analytical description.
Check the button:
-.. image:: images/create_case_5.png
+.. image:: images/create_boundary_1.png
:align: center
The definition of the boundaries is described in :doc:`gui_create_boundary`.
+----------------------------------------------------------------------------------------+
+----------------------------------------------------------------------------------------+
+| .. module:: CreateBoundaryCAO |
+| |
+| **CreateBoundaryCAO(boundary_name, xao_file)** |
+| Returns an instance of the class ``boundary``, type CAO after its creation |
+| |
+| - ``boundary_name``: the name of the CAO boundary |
+| - ``xao_file``: the name of the file for this CAO, with format XAO |
++----------------------------------------------------------------------------------------+
| .. module:: CreateBoundaryDi |
| |
| **CreateBoundaryDi(boundary_name, mesh_name, mesh_file)** |
| |
| - ``boundary_name``: the name of the discrete boundary |
| - ``mesh_name``: the name of the mesh of the boundary |
-| - ``mesh_file``: the name of the file for this mesh |
+| - ``mesh_file``: the name of the file for this mesh, with format MED |
+----------------------------------------------------------------------------------------+
| .. module:: CreateBoundaryCylinder |
| |
+---------------------------------------------------------------+
+---------------------------------------------------------------+
-| .. module:: AddBoundaryGroup |
+| .. module:: AddBoundary |
| |
-| **AddBoundaryGroup(boundary, group)** |
+| **AddBoundary(boundary)** |
| Add a boundary to the definition of a case |
| |
| - ``boundary``: name of the curved boundary |
++---------------------------------------------------------------+
+| .. module:: AddBoundaryGroup |
+| |
+| **AddBoundaryGroup(boundary, group)** |
+| Add a boundary to the definition of a case with a |
+| filtering by groups |
| |
-| Discrete boundary: |
+| - ``boundary``: name of the curved boundary |
| |
-| . if all the curved lines are involved, the second |
-| argument is an empty string. |
+| Discrete or CAO boundary: |
| |
-| . if only some curved lines are involved, ``group`` is |
-| the name of the group of segments |
+| - ``group``: the name of a group of meshes |
| |
| Analytical boundary: |
| |
-| - ``group``: name of the groupe of faces located on the |
+| - ``group``: name of the groups of faces located on the |
| boundary |
+---------------------------------------------------------------+
| **GetType()** |
| Returns the type of the boundary: |
| |
+| * -1: CAO |
| * 0: discrete |
| * 1: cylinder |
| * 2: sphere |
| **Delete()** |
| Deletes the boundary. |
| If the boundary is discrete, the file of the mesh is kept.|
+| If the boundary is CAO, the xao file of the geometry is |
+| kept. |
| |
| Returns an integer: |
| * 0: the destruction is done |
Example
*******
+Creation of a CAO boundary: ::
+
+ la_cao = homard.CreateBoundaryCAO("BLOC", dircase+'/tutorial_6.xao')
+
Creation of a discrete boundary, a spherical boundary, and a cylindrical boundary:
::
import HOMARD
homard = salome.lcc.FindOrLoadComponent('FactoryServer','HOMARD')
+ homard.UpdateStudy()
To use the module HOMARD within a distributed scheme YACS, the loading is made as follows:
import HOMARD
my_container.load_component_Library('HOMARD')
homard = my_container.create_component_instance('HOMARD',0)
+ homard.UpdateStudy()
Uniform refinement
******************
.. literalinclude:: ../files/tutorial_1.py
- :lines: 52-85
+ :start-after: Début des commandes
+ :end-before: Fin des commandes
.. note::
Download the files
One proceeds here to refinement according to zones. To pass from the initial mesh to the mesh 'M_1', one uses a box framing the z=1 plane and a sphere centered on the origin with radius 1.05. Then to pass from the mesh 'M_1' to the mesh 'M_2', one replaces the sphere by a box framing the cube on side 0.5, pointing on the origin and the meshes in the very first zone are unrefined.
.. literalinclude:: ../files/tutorial_2.py
- :lines: 52-95
+ :start-after: Début des commandes
+ :end-before: Fin des commandes
.. note::
Download the files
To adapt the H_1 mesh resulting from the Iter_1 iteration, two alternatives are applied. In the first, Iter_2, the field is a scalar field of indicators of error and one cuts out the 1.5% of elements where the error is largest. In the second alternative, Iter_2_bis, one is based on a vector field and one examines the jump of this vector between an element and its neighbors: one will cut out where the infinite standard of this jump is higher than the absolute threshold of 0.0001.
.. literalinclude:: ../files/tutorial_3.py
- :lines: 52-124
+ :start-after: Début des commandes
+ :end-before: Fin des commandes
.. note::
Download the files
Non plane boundaries
********************
-.. index:: single: field
+.. index:: single: boundary
+.. index:: single: CAO
.. index:: single: YACS
-One tests the follow-up of the curved borders here: analytical borders to describe various surfaces of the pipes and a discrete border to describe the intersecting lines of the two pipes. The driving of refinement is the following: uniform refinement of all the elements contained in indicated groups. One starts by refining the inner faces with the pipes; then, one refines continuation twice the external faces with the pipes.
+One tests the follow-up of the curved borders here, giving the representation of the domain by its CAO. That CAO is given in a XAO format file.
+The driving of refinement is the following: uniform refinement of all the elements contained in indicated groups. One starts by refining the inner faces with the pipes; then, one refines continuation twice the external faces with the pipes.
Scheme YACS carrying out this adaptation is downloadable.
.. literalinclude:: ../files/tutorial_4.py
- :lines: 52-111
+ :start-after: Début des commandes
+ :end-before: Fin des commandes
.. note::
- Download the files
+ Téléchargement des fichiers
* :download:`initial mesh<../files/tutorial_4.00.med.gz>`
- * :download:`mesh of the discrete boundary<../files/tutorial_4.fr.med.gz>`
- * :download:`python script<../files/tutorial_4.py>`
+ * :download:`CAO<../files/tutorial_4.xao.gz>`
+ * :download:`python scrip<../files/tutorial_4.py>`
* :download:`python script for the compression<../files/tutorial_util.py>`
* :download:`YACS scheme<../files/tutorial_4.xml>`
+If the CAO is not available, the boundaries can be approximated: analytical borders to describe various surfaces of the pipes and a discrete border to describe the intersecting lines of the two pipes. Only the definition of the boundaries has to be modified.
+
+.. literalinclude:: ../files/tutorial_6.py
+ :start-after: Début des commandes
+ :end-before: Fin des commandes
+
+.. note::
+ Download the files
+
+ * :download:`initial mesh<../files/tutorial_4.00.med.gz>`
+ * :download:`mesh of the discrete boundary<../files/tutorial_6.fr.med.gz>`
+ * :download:`python script<../files/tutorial_6.py>`
+ * :download:`python script for the compression<../files/tutorial_util.py>`
+ * :download:`YACS scheme<../files/tutorial_6.xml>`
+
Specific instructions for a 2D mesh
***********************************
In the case presented here, one for the first time refines all the elements contained in a bored disk, then in one second iteration, all the elements contained in a rectangle. One will note the use of the follow-up of the circular borders of the field.
.. literalinclude:: ../files/tutorial_5.py
- :lines: 52-95
+ :start-after: Début des commandes
+ :end-before: Fin des commandes
.. note::
Download the files
.. toctree::
:maxdepth: 2
+