In most of the scripts here, we use the string format {var=}
, hence python3.8
or later is needed.
Two main libraries are used, both are available on GitHub
under the MIT license:
meshio
for reading and exporting meshes in various formatsdualGPy
for building the dual graph of a mesh
All the examples in the directory have, roughly speaking, the same structure:
- Create / Read a mesh
- Prepare the mesh with
dualGPy
- Agglomerate with
CoMMA
- Export the results to
.vtu
thanks tomeshio
A brief description of the scripts in this directory:
ex_default_dualGPy.py
: Build a Cartesian 2D mesh withdualGPy
default constructor. Simple switches enable the user to choose anisotropy, dimension and other parameters forCoMMA
. Useful for familiarizing with:- Prepare a mesh with
dualGPy
so that it can be handled byCoMMA
- Arguments and outputs of
CoMMA
call - Preparing the output (subdivision in classes) for
meshio
- Prepare a mesh with
ex_read_mesh.py
: Read an existing mesh viameshio
and agglomerate it. Simple switches enable the user to choose anisotropy, dimension and other parameters forCoMMA
. Useful for familiarizing with:- Reading a mesh with
meshio
and preparing it withdualGPy
- Preparing the output (subdivision in classes and/or in cell types) for
meshio
- Reading a mesh with
ex_aniso_lines.py
: Show how to draw anisotropic lines obtained fromCoMMA
. Useful for familiarizing with:CoMMA
's definition of anisotropic lines- Drawing anisotropic lines with
dualGPy
ex_several_agglo_levels.py
: Show how to agglomerate several times the same mesh usingCoMMA
. Useful for familiarizing with:- Running several agglomeration steps on the same mesh, each time preparing the result of the previous step for the following one
- Outputting more than one field via
meshio
ex_rae.py
: Agglomeration of a 2D RAE2822 mesh. We use here different features:- Perfectly selection of the BL by looking at the cell-type (only squares)
- Computation of the (reciprocal) of the wall-distance to be used as weights to give higher priority to cells near the wall
- Several agglomeration levels
- Modification of the anisotropic lines after the first level
Some old deprecated examples:
test_from_comma_source.py
: Build a hand-picked 2D mesh, agglomerate it withCoMMA
and export the resulttest_dualGPy.py
: Build a hand-picked 2D mesh of quads and triangles withdualGPy
, agglomerate it withCoMMA
and export the resulttest_square.py
: Build a Cartesian 2D mesh withdualGPy
default constructor, agglomerate it withCoMMA
and export the result
The python files are formatted with Black and isort
. A configuration file is available, see pyproject.toml
.