MeshSelection
MeshSelection_
class is designed for selecting the parts of the domain (mesh).
MeshSelection
is often used when we need to assign a material to a part of domain. Also, it is used to select boundary of the domain.
Currently, we have following ways select a mesh.
- Mesh selection by
meshID
- Mesh selection by node numbers
- Mesh selection by element numbers
- Mesh selection by bounding box
Constructor methodsβ
We will use the following example to understand the API of MeshSelection_
.
Click here to see the example
This example shows how to use MeshSelection_
with meshSelectionByID
option.
PROGRAM main
USE easifemBase
USE easifemClasses
IMPLICIT NONE
TYPE( MeshSelection_ ) :: obj
type(ParameterList_) :: param
Let us initiate an instance of MeshSelection_
wherein we will select the mesh by using mesh-ids.
CALL FPL_INIT(); call param%Initiate()
CALL SetMeshSelectionParam(param=param, isSelectionByMeshID=.TRUE., prefix=obj%GetPrefix())
CALL obj%Initiate( param=param )
Adding mesh regions:
CALL obj%Add( dim=0, meshID=[1,2,3,4,5,6])
CALL obj%Add( dim=1, meshID=[2,5,6,7])
CALL obj%Add( dim=2, meshID=[1,3,5,6,8])
CALL obj%Add( dim=3, meshID=[1,8])
After adding the regions in the MeshSelection_
, we should call set()
method. This call will do all the necessary steps.
CALL obj%Set()
Display the content.
CALL obj%Display( "" )
cleanup
CALL obj%Deallocate()
CALL param%Deallocate()
CALL FPL_FINALIZE
END PROGRAM main
Click here to see the results
IsInitiated : TRUE
IsSelectionByMeshID : TRUE
IsSelectionByElemNum : FALSE
IsSelectionByNodeNum : FALSE
IsSelectionByBox : FALSE
PointMeshID ALLOCATED : TRUE
CurveMeshID ALLOCATED : TRUE
SurfaceMeshID ALLOCATED : TRUE
VolumeMeshID ALLOCATED : TRUE
PointElemNum ALLOCATED : FALSE
CurveElemNum ALLOCATED : FALSE
SurfaceElemNum ALLOCATED : FALSE
VolumeElemNum ALLOCATED : FALSE
PointNodeNum ALLOCATED : FALSE
CurveNodeNum ALLOCATED : FALSE
SurfaceNodeNum ALLOCATED : FALSE
VolumeNodeNum ALLOCATED : FALSE
PointBox ALLOCATED : FALSE
CurveBox ALLOCATED : FALSE
SurfaceBox ALLOCATED : FALSE
VolumeBox ALLOCATED : FALSE
# PointMeshID :
# size : 6
1
2
3
4
5
6
# CurveMeshID :
# size : 4
2
5
6
7
# SurfaceMeshID :
# size : 5
1
3
5
6
8
# VolumeMeshID :
# size : 2
1
8
-
To construct an instance of
MeshSelection
first we set the parameters inParameterList_
by calling the method called SetMeshSelectionParam. -
After setting the parameters you should call Initiate method.
-
Now we will add mesh region to
MeshSelection_
. See Add method. -
After you are done adding the mesh parts, do not forget to call Set method.
You can Display the content of MeshSelection
by using Display method.
Get methodsβ
- To get the
meshid
you should you GetMeshID method - To get the element number, use the GetElemNum method
- To get the node number, you should use the GetNodeNum method.
All methodsβ
ποΈ SetMeshSelectionParam
Set the parameters to initiate an instance of MeshSelection_.
ποΈ Initiate
Initiate an instance of MeshSelection_.
ποΈ Add
This routine adds mesh regions to the instance of MeshSelection_.
ποΈ Copy
Copy one instance of MeshSelection into another meshselection instance.
ποΈ Deallocate
Deallocate an instance of MeshSelection.
ποΈ Display
Display the contents of an instance of MeshSelection_.
ποΈ Export
Export an instance of MeshSelection in HDF5File format.
ποΈ GetElemNum
This method returns the element numbers stored inside the mesh selection instance.
ποΈ GetMeshID
This routine returns the mesh-ids of the domain region defined in an instance of MeshSelection.
ποΈ GetNodeNum
Returns the node number.
ποΈ GetQuery
This routine returns the isInitiated, isSelectionByBox, isSelectionByMeshID etc. queries.
ποΈ Import
Import an instance of MeshSelection_ from hdf5 file.
ποΈ IsElemNumAllocated
This routine returns true if element numbers of a given dim are allocated.
ποΈ IsMeshIDAllocated
This routine returns true if meshID of given dim is allocated
ποΈ IsNodeNumAllocated
This routine returns true if node numbers are allocated.
ποΈ Structure
MeshSelection class is designed to select parts of domain object.
ποΈ Set
This method should be called when we are done adding entries into MeshSelection_.