Skip to content

Class ae108::cpppetsc::Mesh

template <class Policy>

ClassList > ae108 > cpppetsc > Mesh

Public Types

Type Name
typedef Matrix< Policy > matrix_type
typedef Policy policy_type
typedef PetscReal real_type
typedef PetscInt size_type
typedef PetscScalar value_type
typedef Vector< Policy > vector_type

Public Static Attributes

Type Name
constexpr size_type IGNORE_VERTEX_INDEX = = -1

Public Functions

Type Name
void addToGlobalVector (const local< vector_type > & localVector, distributed< vector_type > *const globalVector) const
Add the values in the local vector to the corresponding values in the global vector.
Mesh cloneWithDofs (const size_type dofPerVertex, const size_type dofPerElement) const
Clone the mesh with a different default section.
size_type coordinateDimension () const
Returns the dimension of the coordinates.
void copyToGlobalVector (const local< vector_type > & localVector, distributed< vector_type > *const globalVector) const
Copy the values in the local vector to the corresponding values in the global vector.
void copyToLocalVector (const distributed< vector_type > & globalVector, local< vector_type > *const localVector) const
Fill the local vector with the corresponding values from the global vector.
DM data () const
Returns the internal mesh.
distributed< vector_type > fromCanonicalOrder (const distributed< vector_type > & vector) const
Returns a global vector in PETSc's row order transformed from the provided vector in canonical row order (the degrees of freedom of the elements sorted by global index, followed by the degrees of freedom of the vertices sorted by global index).
Mesh< Policy > fromConnectivity (const size_type dimension, const Container & elementVertexIDs, const size_type numberOfVertices, const size_type dofPerVertex, const size_type dofPerElement)
auto localElements () const
Makes it possible to iterate over (views of) the local elements.
size_type localNumberOfElements () const
Returns the local number of elements in the mesh.
size_type localNumberOfVertices () const
Returns the local number of vertices in the mesh.
auto localVertices () const
Makes it possible to iterate over (views of) the local vertices.
void print () const
Prints the mesh to stdout.
distributed< vector_type > toCanonicalOrder (const distributed< vector_type > & vector) const
Returns a global vector in canonical row order (the degrees of freedom of the elements sorted by global index, followed by the degrees of freedom of the vertices sorted by global index) transformed from the provided vector in PETSc's row order.
matrix_type toCanonicalOrder (const matrix_type & matrix) const
Returns a matrix in canonical row/column order (the degrees of freedom of the elements sorted by global index, followed by the degrees of freedom of the vertices sorted by global index) transformed from the provided matrix in PETSc's row/column order.
size_type totalNumberOfElements () const
Returns the total number of elements in the mesh.
size_type totalNumberOfVertices () const
Returns the total number of vertices in the mesh.

Public Static Functions

Type Name
Mesh fromConnectivity (const size_type dimension, const Container & elementVertexIDs, const size_type numberOfVertices, const size_type dofPerVertex, const size_type dofPerElement=0)
Creates a Mesh from the connectivity representation.

Public Types Documentation

typedef matrix_type

using ae108::cpppetsc::Mesh< Policy >::matrix_type =  Matrix<Policy>;

typedef policy_type

using ae108::cpppetsc::Mesh< Policy >::policy_type =  Policy;

typedef real_type

using ae108::cpppetsc::Mesh< Policy >::real_type =  PetscReal;

typedef size_type

using ae108::cpppetsc::Mesh< Policy >::size_type =  PetscInt;

typedef value_type

using ae108::cpppetsc::Mesh< Policy >::value_type =  PetscScalar;

typedef vector_type

using ae108::cpppetsc::Mesh< Policy >::vector_type =  Vector<Policy>;

Public Static Attributes Documentation

variable IGNORE_VERTEX_INDEX

constexpr size_type ae108::cpppetsc::Mesh< Policy >::IGNORE_VERTEX_INDEX;

Public Functions Documentation

function addToGlobalVector

Add the values in the local vector to the corresponding values in the global vector.

void ae108::cpppetsc::Mesh::addToGlobalVector (
    const local < vector_type > & localVector,
    distributed < vector_type > *const globalVector
) const


function cloneWithDofs

Clone the mesh with a different default section.

Mesh ae108::cpppetsc::Mesh::cloneWithDofs (
    const size_type dofPerVertex,
    const size_type dofPerElement
) const


function coordinateDimension

Returns the dimension of the coordinates.

size_type ae108::cpppetsc::Mesh::coordinateDimension () const


function copyToGlobalVector

Copy the values in the local vector to the corresponding values in the global vector.

void ae108::cpppetsc::Mesh::copyToGlobalVector (
    const local < vector_type > & localVector,
    distributed < vector_type > *const globalVector
) const

Remark:

Be careful with overlapping areas (e.g. for ghost points) on different nodes.


function copyToLocalVector

Fill the local vector with the corresponding values from the global vector.

void ae108::cpppetsc::Mesh::copyToLocalVector (
    const distributed < vector_type > & globalVector,
    local < vector_type > *const localVector
) const


function data

Returns the internal mesh.

DM ae108::cpppetsc::Mesh::data () const

Remark:

For internal use only.


function fromCanonicalOrder

Returns a global vector in PETSc's row order transformed from the provided vector in canonical row order (the degrees of freedom of the elements sorted by global index, followed by the degrees of freedom of the vertices sorted by global index).

distributed < vector_type > ae108::cpppetsc::Mesh::fromCanonicalOrder (
    const distributed < vector_type > & vector
) const


function fromConnectivity [2/2]

template<class Container>
Mesh < Policy > ae108::cpppetsc::Mesh::fromConnectivity (
    const size_type dimension,
    const Container & elementVertexIDs,
    const size_type numberOfVertices,
    const size_type dofPerVertex,
    const size_type dofPerElement
) 

function localElements

Makes it possible to iterate over (views of) the local elements.

auto ae108::cpppetsc::Mesh::localElements () const


function localNumberOfElements

Returns the local number of elements in the mesh.

size_type ae108::cpppetsc::Mesh::localNumberOfElements () const


function localNumberOfVertices

Returns the local number of vertices in the mesh.

size_type ae108::cpppetsc::Mesh::localNumberOfVertices () const


function localVertices

Makes it possible to iterate over (views of) the local vertices.

auto ae108::cpppetsc::Mesh::localVertices () const


function print

Prints the mesh to stdout.

void ae108::cpppetsc::Mesh::print () const


function toCanonicalOrder [1/2]

Returns a global vector in canonical row order (the degrees of freedom of the elements sorted by global index, followed by the degrees of freedom of the vertices sorted by global index) transformed from the provided vector in PETSc's row order.

distributed < vector_type > ae108::cpppetsc::Mesh::toCanonicalOrder (
    const distributed < vector_type > & vector
) const


function toCanonicalOrder [2/2]

Returns a matrix in canonical row/column order (the degrees of freedom of the elements sorted by global index, followed by the degrees of freedom of the vertices sorted by global index) transformed from the provided matrix in PETSc's row/column order.

matrix_type ae108::cpppetsc::Mesh::toCanonicalOrder (
    const matrix_type & matrix
) const


function totalNumberOfElements

Returns the total number of elements in the mesh.

size_type ae108::cpppetsc::Mesh::totalNumberOfElements () const


function totalNumberOfVertices

Returns the total number of vertices in the mesh.

size_type ae108::cpppetsc::Mesh::totalNumberOfVertices () const


Public Static Functions Documentation

function fromConnectivity [1/2]

Creates a Mesh from the connectivity representation.

template<class Container>
static Mesh ae108::cpppetsc::Mesh::fromConnectivity (
    const size_type dimension,
    const Container & elementVertexIDs,
    const size_type numberOfVertices,
    const size_type dofPerVertex,
    const size_type dofPerElement=0
) 

Template parameters:

  • Container Requirements: size(); Container::value_type requirements: size(), data().

Parameters:

  • dimension The coordinate dimension.
  • elementVertexIDs A container of containers: the container at index i contains the vertex IDs of the element with index i. Each vertex ID must lie in [0, numberOfVertices) u {IGNORE_VERTEX_INDEX}. IDs of value IGNORE_VERTEX_INDEX are ignored.
  • numberOfVertices The maximum vertex ID in the mesh.


The documentation for this class was generated from the following file cpppetsc/src/include/ae108/cpppetsc/Mesh.h