magnet.lymphcomm#
Lymph interface script.
Handles calls from the MATLAB ‘lymph’ library, returning a polytopal mesh obtained by agglomeration.
Calls to this script should be done using MATLAB pyrunfile with the following signature:
The parameters are passed to pyrunfile as keyword arguments.
- param meshpath:
Input mesh file path.
- type meshpath:
str
- param aggmodel:
The agglomeration model to be used. The supported options are: ‘METIS’ : Metis graph partitioning algorithm. ‘KMEANS’ : Kmeans algorithm. ‘SageBase2D’ : Graph Neural Network based strategy.
- type aggmodel:
{‘METIS’, ‘KMEANS’, ‘SageBase2D’}
- param mode:
Agglomeration mode. ‘Nref’ : bisect the mesh recursively a set number of times. ‘mult_factor’ : bisect the mesh until the agglomerated elements are small enough.
- type mode:
{‘Nref’, ‘mult_factor’}
- param agg_parameter:
If agglomeration_mode is ‘Nref’, then this is an integer corresponding to the number of refinements; if it is ‘mult_factor’then this is a float corresponding to the ratio between the the desired agglomerted elements diameter and that of the entire mesh. Must be between 0 and 1.
- type agg_parameter:
int | float
- param b_tags:
The tags of the elements to insert in the boundary. By default, insert in the boundary all elements of suitable dimension (i.e. all lines in 2D), and assign them tag 1.
- type b_tags:
Array_like of int, optional.
- param b_tag_name:
Field name of the tags to be used in meshio.Mesh.cell_data dictionary for boundary extraction.
- type b_tag_name:
str, optional
Notes
The input mesh is first loaded using meshio and may be in any format compatible with it.
Regarding the boundary:
See also
magnet.aggmodels.AgglomerationModel.agglomerate
agglomerate a mesh.
magnet.io.load_mesh
load mesh from file.
magnet.io.get_boundary
extract boundary of the mesh.