Skip to main content

GmshModel

STATUS

  • Add
  • Remove
  • List
  • GetCurrent
  • SetCurrent
  • GetFileName
  • SetFileName
  • GetEntities
  • SetEntityName
  • GetEntityName
  • GetPhysicalGroups
  • GetEntitiesForPhysicalGroup
  • GetPhysicalGroupsForEntity
  • AddPhysicalGroup
  • RemovePhysicalGroups
  • SetPhysicalName
  • RemovePhysicalName
  • GetPhysicalName
  • SetTag
  • GetBoundary
  • GetAdjacencies
  • GetEntitiesInBoundingBox
  • GetBoundingBox
  • GetDimension
  • AddDiscreteEntity
  • RemoveEntities
  • RemoveEntityName
  • GetType
  • GetParent
  • GetPartitions
  • GetValue
  • GetDerivative
  • GetSecondDerivative
  • GetCurvature
  • GetPrincipalCurvatures
  • GetNormal
  • GetParametrization
  • GetParametrizationBounds
  • IsInside
  • GetClosestPoint
  • ReparametrizeOnSurface
  • SetVisibility
  • GetVisibility
  • SetVisibilityPerWindow
  • SetColor
  • GetColor
  • SetCoordinates
  • GetAttributeNames
  • SetAttribute
  • GetAttribute
  • RemoveAttribute

Introduction

Getting Started

Structure

TYPE :: GmshModel_
PRIVATE
TYPE(GmshModelGeo_), PUBLIC, POINTER :: Geo => NULL()
TYPE(GmshModelOcc_), PUBLIC, POINTER :: Occ => NULL()
TYPE(GmshModelMesh_), PUBLIC, POINTER :: Mesh => NULL()

Methods

Add

!> Add a new model, with name `name', and set it as the current model.

Remove

!> Remove the current model.

List

!> List the names of all models.

GetCurrent

!> Get the name of the current model.

SetCurrent

!> Set the current model to the model with name `name'. If several models have !! the same name, select the one that was added first.

GetFileName

!> Get the file name (if any) associated with the current model. A file name !! is associated when a model is read from a file on disk.

SetFileName

!> Set the file name associated with the current model.

GetEntities

!> Get all the entities in the current model. If dim' is >= 0, return only !! the entities of the specified dimension (e.g. points ifdim' == 0). The !! entities are returned as a vector of (dim, tag) pairs.

SetEntityName

!> Set the name of the entity of dimension dim' and tagtag'.

GetEntityName

!> Get the name of the entity of dimension dim' and tagtag'.

GetPhysicalGroups

!> Get all the physical groups in the current model. If dim' is >= 0, return !! only the entities of the specified dimension (e.g. physical points ifdim' !! == 0). The entities are returned as a vector of (dim, tag) pairs.

GetEntitiesForPhysicalGroup

!> Get the tags of the model entities making up the physical group of !! dimension dim' and tagtag'.

GetPhysicalGroupsForEntity

!> Get the tags of the physical groups (if any) to which the model entity of !! dimension dim' and tagtag' belongs.

AddPhysicalGroup

!> Add a physical group of dimension dim', grouping the model entities with !! tagstags'. Return the tag of the physical group, equal to tag' iftag' !! is positive, or a new tag if tag' < 0. Set the name of the physical group !! ifname' is not empty.

RemovePhysicalGroups

!> Remove the physical groups dimTags' (given as a vector of (dim, tag) !! pairs) from the current model. IfdimTags' is empty, remove all groups.

SetPhysicalName

!> Set the name of the physical group of dimension dim' and tagtag'.

RemovePhysicalName

!> Remove the physical name `name' from the current model.

GetPhysicalName

!> Get the name of the physical group of dimension dim' and tagtag'.

SetTag

!> Set the tag of the entity of dimension dim' and tagtag' to the new value !! `newTag'.

GetBoundary

!> Get the boundary of the model entities dimTags', given as a vector of !! (dim, tag) pairs. Return inoutDimTags' the boundary of the individual !! entities (if combined' is false) or the boundary of the combined !! geometrical shape formed by all input entities (ifcombined' is true). !! Return tags multiplied by the sign of the boundary entity if oriented' is !! true. Apply the boundary operator recursively down to dimension 0 (i.e. to !! points) ifrecursive' is true.

GetAdjacencies

!> Get the upward and downward adjacencies of the model entity of dimension !! dim' and tagtag'. The upward' vector returns the tags of adjacent !! entities of dimensiondim' + 1; the downward' vector returns the tags of !! adjacent entities of dimensiondim' - 1.

GetEntitiesInBoundingBox

!> Get the model entities in the bounding box defined by the two points !! (xmin',ymin', zmin') and (xmax', ymax',zmax'). If dim' is >= 0, !! return only the entities of the specified dimension (e.g. points ifdim' !! == 0).

GetBoundingBox

!> Get the bounding box (xmin',ymin', zmin'), (xmax', ymax',zmax') of !! the model entity of dimension dim' and tagtag'. If dim' andtag' are !! negative, get the bounding box of the whole model.

GetDimension

!> Return the geometrical dimension of the current model.

AddDiscreteEntity

!> Add a discrete model entity (defined by a mesh) of dimension dim' in the !! current model. Return the tag of the new discrete entity, equal totag' if !! tag' is positive, or a new tag iftag' < 0. boundary' specifies the tags !! of the entities on the boundary of the discrete entity, if any. Specifying !!boundary' allows Gmsh to construct the topology of the overall model.

RemoveEntities

!> Remove the entities dimTags' (given as a vector of (dim, tag) pairs) of !! the current model, provided that they are not on the boundary of (or !! embedded in) higher-dimensional entities. Ifrecursive' is true, remove !! all the entities on their boundaries, down to dimension 0.

RemoveEntityName

!> Remove the entity name `name' from the current model.

GetType

!> Get the type of the entity of dimension dim' and tagtag'.

GetParent

!> In a partitioned model, get the parent of the entity of dimension dim' and !! tagtag', i.e. from which the entity is a part of, if any. parentDim' and !!parentTag' are set to -1 if the entity has no parent.

GetNumberOfPartitions

!> Return the number of partitions in the model.

GetPartitions

!> In a partitioned model, return the tags of the partition(s) to which the !! entity belongs.

GetValue

!> Evaluate the parametrization of the entity of dimension dim' and tagtag' !! at the parametric coordinates parametricCoord'. Only valid fordim' equal !! to 0 (with empty parametricCoord'), 1 (withparametricCoord' containing !! parametric coordinates on the curve) or 2 (with parametricCoord' !! containing u, v parametric coordinates on the surface, concatenated: [p1u, !! p1v, p2u, ...]). Return x, y, z coordinates incoord', concatenated: [p1x, !! p1y, p1z, p2x, ...].

GetDerivative

!> Evaluate the derivative of the parametrization of the entity of dimension !! dim' and tagtag' at the parametric coordinates parametricCoord'. Only !! valid fordim' equal to 1 (with parametricCoord' containing parametric !! coordinates on the curve) or 2 (withparametricCoord' containing u, v !! parametric coordinates on the surface, concatenated: [p1u, p1v, p2u, ...]). !! For dim' equal to 1 return the x, y, z components of the derivative with !! respect to u [d1ux, d1uy, d1uz, d2ux, ...]; fordim' equal to 2 return the !! x, y, z components of the derivative with respect to u and v: [d1ux, d1uy, !! d1uz, d1vx, d1vy, d1vz, d2ux, ...].

GetSecondDerivative

!> Evaluate the second derivative of the parametrization of the entity of !! dimension dim' and tagtag' at the parametric coordinates !! parametricCoord'. Only valid fordim' equal to 1 (with parametricCoord' !! containing parametric coordinates on the curve) or 2 (with !!parametricCoord' containing u, v parametric coordinates on the surface, !! concatenated: [p1u, p1v, p2u, ...]). For dim' equal to 1 return the x, y, !! z components of the second derivative with respect to u [d1uux, d1uuy, !! d1uuz, d2uux, ...]; fordim' equal to 2 return the x, y, z components of !! the second derivative with respect to u and v, and the mixed derivative !! with respect to u and v: [d1uux, d1uuy, d1uuz, d1vvx, d1vvy, d1vvz, d1uvx, !! d1uvy, d1uvz, d2uux, ...].

GetCurvature

!> Evaluate the (maximum) curvature of the entity of dimension dim' and tag !!tag' at the parametric coordinates parametricCoord'. Only valid fordim' !! equal to 1 (with parametricCoord' containing parametric coordinates on the !! curve) or 2 (withparametricCoord' containing u, v parametric coordinates !! on the surface, concatenated: [p1u, p1v, p2u, ...]).

GetPrincipalCurvatures

!> Evaluate the principal curvatures of the surface with tag tag' at the !! parametric coordinatesparametricCoord', as well as their respective !! directions. `parametricCoord' are given by pair of u and v coordinates, !! concatenated: [p1u, p1v, p2u, ...].

GetNormal

!> Get the normal to the surface with tag tag' at the parametric coordinates !!parametricCoord'. The parametricCoord' vector should contain u and v !! coordinates, concatenated: [p1u, p1v, p2u, ...].normals' are returned as !! a vector of x, y, z components, concatenated: [n1x, n1y, n1z, n2x, ...].

GetParametrization

!> Get the parametric coordinates parametricCoord' for the pointscoord' on !! the entity of dimension dim' and tagtag'. coord' are given as x, y, z !! coordinates, concatenated: [p1x, p1y, p1z, p2x, ...].parametricCoord' !! returns the parametric coordinates t on the curve (if dim' = 1) or u and v !! coordinates concatenated on the surface (ifdim' = 2), i.e. [p1t, p2t, !! ...] or [p1u, p1v, p2u, ...].

GetParametrizationBounds

!> Get the min' andmax' bounds of the parametric coordinates for the entity !! of dimension dim' and tagtag'.

IsInside

!> Check if the coordinates (or the parametric coordinates if parametric' is !! set) provided incoord' correspond to points inside the entity of !! dimension dim' and tagtag', and return the number of points inside. This !! feature is only available for a subset of entities, depending on the !! underlying geometrical representation.

GetClosestPoint

!> Get the points closestCoord' on the entity of dimensiondim' and tag !! tag' to the pointscoord', by orthogonal projection. coord' and !!closestCoord' are given as x, y, z coordinates, concatenated: [p1x, p1y, !! p1z, p2x, ...]. parametricCoord' returns the parametric coordinates t on !! the curve (ifdim' = 1) or u and v coordinates concatenated on the surface !! (if `dim' = 2), i.e. [p1t, p2t, ...] or [p1u, p1v, p2u, ...].

ReparametrizeOnSurface

!> Reparametrize the boundary entity (point or curve, i.e. with dim' == 0 or !!dim' == 1) of tag tag' on the surfacesurfaceTag'. If dim' == 1, !! reparametrize all the points corresponding to the parametric coordinates !!parametricCoord'. Multiple matches in case of periodic surfaces can be !! selected with `which'. This feature is only available for a subset of !! entities, depending on the underlying geometrical representation.

SetVisibility

!> Set the visibility of the model entities dimTags' (given as a vector of !! (dim, tag) pairs) tovalue'. Apply the visibility setting recursively if !! `recursive' is true.

GetVisibility

!> Get the visibility of the model entity of dimension dim' and tagtag'.

SetVisibilityPerWindow

!> Set the global visibility of the model per window to value', where !!windowIndex' identifies the window in the window list.

SetColor

!> Set the color of the model entities dimTags' (given as a vector of (dim, !! tag) pairs) to the RGBA value (r', g',b', a'), wherer', g',b' and !! a' should be integers between 0 and 255. Apply the color setting !! recursively ifrecursive' is true.

GetColor

!> Get the color of the model entity of dimension dim' and tagtag'.

SetCoordinates

!> Set the x',y', `z' coordinates of a geometrical point.

GetAttributeNames

!> Get the names of any optional attributes stored in the model.

GetAttribute

!> Get the values of the attribute with name `name'.

SetAttribute

!> Set the values of the attribute with name `name'.

RemoveAttribute

!> Remove the attribute with name `name'.