Skip to content

Commit

Permalink
Doc/match morph (#506)
Browse files Browse the repository at this point in the history
Co-authored-by: srpyprime <[email protected]>
Co-authored-by: Hao Lee <[email protected]>
Co-authored-by: Hao Lee <[email protected]>
  • Loading branch information
4 people authored Jul 10, 2023
1 parent 16825ee commit 7eb576d
Show file tree
Hide file tree
Showing 7 changed files with 108 additions and 8 deletions.
Binary file added doc/source/images/matchmorph_source.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/source/images/matchmorph_target.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/source/images/matchmorphafter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions doc/source/user_guide/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ This section provides an overview of how you use PyPrimeMesh for mesh preparatio
wrapper
automesh
stacker
matchmorph
sizing
connections
mesh_diagnostics
Expand Down
89 changes: 89 additions & 0 deletions doc/source/user_guide/matchmorph.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
.. _ref_index_matchmorph:


**************
Match morphing
**************

:func:`Morpher.match_morph() <ansys.meshing.prime.Morpher.match_morph>` method performs face to face entity matching, providing the ability to match face pairs using match pairs.
The method allows the source face to match with the corresponding target face. :class:`MatchPair <ansys.meshing.prime.MatchPair>` allows you to specify sources and targets for
match morphing.

.. note::
Match pairs should have the same type of entities for matching.

:func:`Morpher.match_morph() <ansys.meshing.prime.Morpher.match_morph>` performs the following:

- Matches the boundaries of the source and targets using the specified boundary condition pairs.
- Matches the source entities to the target entities using the specified match pairs.
- Ensures the adjacent entities to the boundaries of the matched entities are adjusted to provide a quality mesh.

The below example shows how to match morph a cube of hexahedral mesh with quadratic elements to the shape of a sphere:

Get the source and target faces from the source part and target part respectively.

.. code-block:: python
source_part = model.get_part_by_name("hex-mesh")
target_part = model.get_part_by_name("sphere-topo")
source = target_part.get_face_zonelets()
target = source_part.get_topo_faces()
.. figure:: ../images/matchmorph_source.png
:width: 800pt
:align: center

**Source part (mesh)**

.. figure:: ../images/matchmorph_target.png
:width: 800pt
:align: center

**Target part (topology)**

Initialize match morph parameters, morpher boundary condition parameters and morpher solver parameters.

.. code-block:: python
match_morph_params = prime.MatchMorphParams(model=model)
bc_params = prime.MorphBCParams(
model=model,
morph_region_method=prime.BCsVolumetricModality.ALL,
morphable_layers=1,
morph_region_box_extension=0,
)
solver_params = prime.MorphSolveParams(model=model)
Set the source and target pairs for matching and specify the entity type of target surfaces.

.. code-block:: python
match_pairs = []
match_pair = prime.MatchPair(
model=model,
source_surfaces=source,
target_surfaces=target,
target_type=prime.MatchPairTargetType.TOPOFACE,
)
match_pairs = [match_pair]
Perform match morphing using the match pairs, match morph parameters, boundary condition parameters and solver parameters.

.. code-block:: python
morpher = prime.Morpher(model=model)
morpher.match_morph(
part_id=source_part.id,
match_pairs=match_pairs,
match_morph_params=match_morph_params,
bc_params=bc_params,
solve_params=solver_params,
)
.. figure:: ../images/matchmorphafter.png
:width: 800pt
:align: center

**Mesh morphed and displayed (topology deleted)**


16 changes: 8 additions & 8 deletions doc/source/user_guide/stacker.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
***************
Volume sweeping
***************
.. vale off


The :class:`VolumeSweeper <ansys.meshing.prime.VolumeSweeper>` class creates a volume mesh on 2.5D models, stacking faces
or edge zonelets one above the other in layers. This volume sweeping technology stacks each of the input topovolumes individually.
.. vale on


.. note::
A 2.5D or stackable geometry is any closed volume or set of closed volumes that can be obtained by successive extrusion of a series of 2D geometries, along the area normal of the 2D geometries.

A geometry is stackable only when there is a direction called stacking direction, to which all surfaces are either perpendicular or parallel.

.. warning::
The hex-dominant mesh created by this "Stacker" method can only be applied to 2.5D models. Only conformal mesh within a part is supported.
The hex-dominant mesh created by volume sweeper can only be applied to 2.5D models. Only conformal mesh within a part is supported.


"Stacker" workflow involves the following:
Volume sweeping workflow involves the following:

- Create imprints of model edges on the base face.
- Surface mesh the imprinted base face.
Expand All @@ -30,13 +30,13 @@ or edge zonelets one above the other in layers. This volume sweeping technology
:width: 800pt
:align: center

**Example of Stacker Workflow**
**Example of Volume Sweeping Workflow**


Hex-dominant meshing for 2.5D geometry
---------------------------------------

The following example shows how to mesh a thin disc using "Stacker" method:
The following example shows how to mesh a thin disc using volume sweeper:

.. code-block:: python
Expand All @@ -47,7 +47,7 @@ The following example shows how to mesh a thin disc using "Stacker" method:
model.delete_volumetric_size_fields(model.get_active_volumetric_size_fields())
part = model.parts[0]
Define stacker parameters:
Define stacking parameters:

* Set origin and direction vector for stacking orientation
* Option to set defeaturing tolerance for edge imprints
Expand All @@ -66,7 +66,7 @@ Define stacker parameters:
model=model, direction=[0.0, 1.0, 0.0], max_offset_size=0.5, delete_base=True
)
Print the results of stacker parameters so that you can review them:
Print the results of stacking parameters so that you can review them:

.. code-block:: pycon
Expand Down
10 changes: 10 additions & 0 deletions doc/styles/Vocab/ANSYS/accept.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ Material Point Manager
Meshedgeodesic
meshedgeodesic
Meshing's
Morpher
morpher
multithreading
Octree
polyhedra
Expand All @@ -34,14 +36,22 @@ remesh
remeshing
Server
server
Stacker
stacker
stackable
Sweeper
sweeper
tetrahedra
Topo
topo
TopoEdges
topoedges
TopoEntities
topoentities
TopoFaces
topofaces
TopoVolumes
topovolumes
Zonelet
zonelet
Zonelets
Expand Down

0 comments on commit 7eb576d

Please sign in to comment.