STOMMS Mesh Reader APIs

Data Types

Typedefs

using DimType = int

Interger identifier for the physical dimensions.

(0D = 0, 1D = 1, 2D = 2, 3D = 3).

using VertexIdType = int

Interger identifier for the model and mesh vertices.

using EdgeIdType = int

Interger identifier for the model and mesh edges.

using CurveIdType = int

Interger identifier for the model curves (both physics and physical curves).

using SurfaceIdType = int

Interger identifier for the model faces.

using GeomIdType = int

Integer identifier for the model entities. Although we do have identifier for individual entities, this is helpful in functions that take in and return entities of any dimension.

using MeshIdType = int

Integer identifier for the mesh entities. Although we do have identifier for individual entities, this is helpful in functions that take in and return entities of any dimensions.

using PlaneId = int

Interger identifier for the planes. Unique for each poloidal plane.

Enums

enum class SurfaceType

The set of surfaces can be classified into seven different types depending on the physics they corresponds to. The physics regions can be increased/decreased as we move forward.

Values:

enumerator Core
enumerator ScrapeOffLayer
enumerator LowFieldSideEdge
enumerator HighFieldSideEdge
enumerator NearVacuum
enumerator Private
enumerator None
enum class CurveType

Curves are divided into four basics types. Three of them (closed, open, separatrix) are purely defined by physics and wall curve is the only one that is physical curve.

Values:

enumerator Closed
enumerator Open
enumerator Separatrix
enumerator Wall
enumerator None
enumerator Closed
enumerator Open
enumerator Separatrix
enumerator Wall
enumerator None
enum class PointType

Two basic types of model vertices. Magnetic Axis: OPoint. Saddle Points of field: Xpoints

Values:

enumerator OPoint
enumerator XPoint
enumerator None
enum class TopoType

Basic Topology definition of model/mesh entities. The lowest is the vertex which is considered 0D, and region is the largest entity (3D).

Values:

enumerator Vertex
enumerator Edge
enumerator Face
enumerator Region

XgcMesh Class

class XgcMesh

Public Functions

XgcMesh(std::string adiosFileName)

XGC Mesh Class. Takes in adios2 file.

Parameters:

adiosFileName – Adios2 file name containing mesh and related information.

const PlaneMesh &getMeshAtPlane(const int &planeNum)

Given the plane number, return PlaneMesh. Made it public for testing underlying APIs. Once development is done, make it private.

Parameters:

planeNum – Plane Number on which mesh is required.

std::string getMeshName()

Function to return mesh name.

int getNumPlanes()

Function to return number of planes in a mesh.

Omega_h::Mesh getOmegahMeshatPlane(const int &planeNum)

Given the plane number, get Omegah mesh at that plane.

Parameters:

planeNum – Plane Number on which Omega_h mesh is required.

int getNumCurvesAtRegion(int physicsRegion, PlaneId planeId)

Given the type of physics region, return the number of flux curves on it. Core = 0, SOL = 1, Private_1 = 2, private_2 = 3, …). As in current implementation of XGC. Change in future as needed.

Parameters:
  • physicsRegion – Physics region on which model curves are required.

  • planeId – Id of the plane.

std::vector<CurveIdType> getCurvesAtRegion(int physicsRegion, PlaneId planeId)

Given the type of physics region, return the indices of flux curves.(Core = 0, SOL = 1, Private_1 = 2, private_2 = 3, …). As in current implementation of XGC. Change in future as needed.

Parameters:
  • physicsRegion – Physics region on which model curves are required.

  • planeId – Id of the plane.

std::vector<VertexIdType> getCriticalPoints(PointType pType, PlaneId planeId)

Given the required point type and plane #, return x-points or o-points on the plane.

Parameters:
  • pType – desired critical point type (XPoint, OPoint).

  • planeId – Id of the plane.

CurveType getCurveType(CurveIdType curveId, PlaneId planeId)

Given the id of a model curve and Plane #, return curve type.

Parameters:
  • curveId – Model curve id for which type is desired.

  • planeId – Id of the plane.

std::vector<CurveIdType> getCurvesForType(CurveType cType, PlaneId planeId)

Given the curveType (closed,open etc.) and plane #, return all flux curves of that type.

Parameters:
  • cType – CurveType for which model curves are needed.

  • planeId – Id of the plane.

CurveIdType getCurveIdFromGeometricEdge(EdgeIdType edgeId, PlaneId planeId)

Given the model edge id and plane #, return the curve id on which model edge is classified on.

Parameters:
  • edgeId – Model edge id.

  • planeId – Id of the plane.

SurfaceType getPhysicsRegionType(SurfaceIdType surfaceId, PlaneId planeId)

Given the id of a surface and plane #, return physics type of the surface.

Parameters:
  • surfaceId – (in): Model face id.

  • planeId – Id of the plane.

std::vector<EdgeIdType> getCurveGeometricEdges(CurveIdType curveId, PlaneId planeId)

Given the id of a model curve, and plane #, this function returns all the geometric edges on that model curve.

Parameters:
  • curveId – Id of model curve for which model edges will be returned.

  • planeId – Id of the plane.

TopoType getGeometricTopology(TopoType topoType, MeshIdType id, PlaneId planeId)

Function to return model topology of the model entity on which mesh entity is classified. This will return the dimension of the model entity on which mesh entity is classified.

Parameters:
  • topoType – Topology of the mesh entity for which classification information is needed (e.g TopoType::Vertex for mesh vertices if classification for mesh vertex is needed).

  • id – id of the mesh entity.

  • planeId – Id of the plane.

GeomIdType getGeometricClassification(TopoType topoType, MeshIdType id, PlaneId planeId)

Function to return id of the model entity on which mesh entity is classified. This function must be used with the getGeometricTopology to get complete classification information.

Parameters:
  • topoType – Topology of the mesh entity for which classification information is needed (e.g TopoType::Vertex for mesh vertices if classification for mesh vertex is needed).

  • id – id of the mesh entity.

  • planeId – Id of the plane.

std::vector<MeshIdType> getMeshEntities(TopoType geomTopoType, GeomIdType geomId, TopoType meshTopoType, bool includeClosure, PlaneId planeId)

Reverse Classification.

Given the geometric model id and topology, return the reverse classification for the desired mesh topology.

Example

If all mesh vertices classified on a model face N (without closure) are desired, the usage of this API is:

getMeshEntities(TopoType::Face, N, TopoType::Vertex, false, planeId); 

Parameters:
  • geomTopoType – Input geometric topology on which mesh entities are required.

  • geomId – Id of the geometric entity.

  • meshTopoType – Topology of desired mesh entities.

  • includeClosure – set true to get mesh entities on the closure of the model entity.

  • planeId – Id of the plane.

std::vector<GeomIdType> getModelAdjEnts(TopoType geomTopoIn, GeomIdType geomEntId, TopoType geomTopoOut, PlaneId planeId)

Given the model entity topology, and its geometric id, returns all adjacents entities of dimension geomTopoOut.

Parameters:
  • geomTopoType – Input geometric topology on which adjacencies are needed.

  • geomId – Id of the geometric entity.

  • planeId – Id of the plane.

std::vector<VertexIdType> getAdjacentXpoints(SurfaceIdType privateFaceIndex, PlaneId planeId)

Function to take an index of a private region and returns a vector of the adjacent x-points. throws an exception if the passed index is not a private region.

Parameters:
  • privateFaceIndex – Index of the private region.

  • planeId – Id of the plane.

SurfaceType getPhysicsRegionForMeshEnt(TopoType meshTopoType, MeshIdType id, PlaneId planeId)

Given the mesh entity (vertex or face) return the physics regions its classified on. meshTopoType: Topology of mesh entity (TopoType::Vertex, Face allowed). id: id of the mesh entity.

Parameters:

planeId – Id of the plane.

std::map<MeshIdType, std::vector<CurveIdType>> getNonAlignedMeshVerticesOnModelSurface(SurfaceIdType surfaceId, PlaneId planeId)

Given a surface (model face), return all non-aligned mesh vertices on it. The return map contains vertex id as key and vector of flux curves bounding it.

Parameters:
  • surfaceId – Index of the model face on which non-aligned mesh vertices are required.

  • planeId – Id of the plane.

std::map<MeshIdType, std::vector<CurveIdType>> getNonAlignedMeshVerticesOnPlane(PlaneId planeId)

Given just PlaneId, return all non-aligned mesh vertices on it. The return map contains vertex id as key and vector of flux curves bounding it.

Parameters:

planeId – Id of the plane.