accu.template
Public Member Functions | Private Member Functions | Private Attributes | List of all members
ParMesh Class Reference

#include <par_geom.h>

Inheritance diagram for ParMesh:
Mesh

Public Member Functions

 ParMesh (int ndim, int nvert_e=0, int ndof_e=0, int nedge_e=0, MPI_Comm const &icomm=MPI_COMM_WORLD)
 
 ParMesh (ParMesh const &)=default
 
ParMeshoperator= (ParMesh const &)=delete
 
virtual ~ParMesh ()
 
 ParMesh (std::string const &sname, MPI_Comm const &icomm=MPI_COMM_WORLD)
 
void VecAccu (std::vector< double > &w) const
 
double dscapr (std::vector< double > const &x, std::vector< double > const &y) const
 
int MyRank () const
 
int NumProcs () const
 
MPI_Comm GetCommunicator () const
 
- Public Member Functions inherited from Mesh
 Mesh (int ndim, int nvert_e=0, int ndof_e=0, int nedge_e=0)
 
 __attribute__ ((noinline)) Mesh(Mesh const &)=default
 
Meshoperator= (Mesh const &)=delete
 
virtual ~Mesh ()
 
 Mesh (std::string const &fname)
 
void ReadVertexBasedMesh (std::string const &fname)
 
int Nelems () const
 
int NverticesElements () const
 
int NdofsElement () const
 
int Nnodes () const
 
int Ndims () const
 
void Resize_Connectivity (int nelem, int nvert_e)
 
const std::vector< int > & GetConnectivity () const
 
std::vector< int > & GetConnectivity ()
 
void Resize_Coords (int nnodes, int ndim)
 
const std::vector< double > & GetCoords () const
 
std::vector< double > & GetCoords ()
 
void SetValues (std::vector< double > &v, const std::function< double(double, double)> &func) const
 
void SetBoundaryValues (std::vector< double > &v, const std::function< double(double, double)> &func) const
 
void SetDirchletValues (std::vector< double > &v, const std::function< double(double, double)> &func) const
 
void Debug () const
 
void DebugEdgeBased () const
 
virtual std::vector< int > Index_DirichletNodes () const
 
virtual std::vector< int > Index_BoundaryNodes () const
 
void Write_ascii_matlab (std::string const &fname, std::vector< double > const &v) const
 
void Export_scicomp (std::string const &basename) const
 
void Visualize (std::vector< double > const &v) const
 
int Nedges () const
 
int NedgesElements () const
 
const std::vector< int > & GetEdgeConnectivity () const
 
std::vector< int > & GetEdgeConnectivity ()
 
const std::vector< int > & GetEdges () const
 
std::vector< int > & GetEdges ()
 
std::vector< std::vector< int > > Node2NodeGraph () const
 
virtual const std::vector< int > & GetFathersOfVertices () const
 
void Del_EdgeConnectivity ()
 

Private Member Functions

std::vector< int > ReadElementSubdomains (std::string const &dname)
 
void Transform_Local2Global_Vertex (int myrank, std::vector< int > const &t2d)
 
void Generate_VectorAdd ()
 
bool CheckInterfaceExchange_InPlace () const
 
bool CheckInterfaceExchange () const
 
bool CheckInterfaceAdd_InPlace () const
 
bool CheckInterfaceAdd () const
 

Private Attributes

const MPI_Comm _icomm
 MPI communicator for the group of processes. More...
 
int _numprocs
 number of MPI processes More...
 
int _myrank
 my MPI rank More...
 
std::vector< int > _v_l2g
 vertices: local to global mapping More...
 
std::vector< int > _t_l2g
 triangles: local to global mapping More...
 
std::map< int, int > _v_g2l
 vertices: global to local mapping More...
 
std::map< int, int > _t_g2l
 triangles: global to local mapping More...
 
std::vector< int > _valence
 valence of local vertices, i.e. number of subdomains they belong to More...
 
std::vector< double > _sendbuf
 send buffer a n d receiving buffer (MPI_IN_PLACE) More...
 
std::vector< int > _sendcounts
 number of data to send to each MPI rank (the same as for recv) More...
 
std::vector< int > _sdispls
 offset of data to send to each MPI rank wrt. _senbuffer (the same as for recv) More...
 
std::vector< int > _loc_itf
 local index of interface vertex lk More...
 
std::vector< int > _gloc_itf
 global index of interface vertex lk More...
 
std::vector< int > _buf2loc
 local indices of sendbuffer positions (the same as for recv) More...
 

Additional Inherited Members

- Protected Member Functions inherited from Mesh
void SetNelem (int nelem)
 
void SetNverticesElement (int nvert)
 
void SetNdofsElement (int ndof)
 
void SetNnode (int nnode)
 
void SetNdim (int ndim)
 
void SetNedge (int nedge)
 
void ReadVectexBasedMesh (std::string const &fname)
 
void DeriveEdgeFromVertexBased ()
 
void DeriveEdgeFromVertexBased_slow ()
 
void DeriveEdgeFromVertexBased_fast ()
 
void DeriveEdgeFromVertexBased_fast_2 ()
 
void DeriveVertexFromEdgeBased ()
 
int Nnbedges () const
 
virtual bool Check_array_dimensions () const
 
void PermuteVertices_EdgeBased (std::vector< int > const &old2new)
 
- Protected Attributes inherited from Mesh
int _nelem
 number elements More...
 
int _nvert_e
 number of vertices per element More...
 
int _ndof_e
 degrees of freedom (d.o.f.) per element More...
 
int _nnode
 number nodes/vertices More...
 
int _ndim
 space dimension of the problem (1, 2, or 3) More...
 
std::vector< int > _ia
 element connectivity More...
 
std::vector< double > _xc
 coordinates More...
 
std::vector< int > _bedges
 boundary edges [nbedges][2] storing start/end vertex More...
 
std::vector< int > _sdedges
 boundary edges [nbedges][2] with left/right subdomain number More...
 
int _nedge
 number of edges in mesh More...
 
int _nedge_e
 number of edges per element More...
 
std::vector< int > _edges
 edges of mesh (vertices ordered ascending) More...
 
std::vector< int > _ea
 edge based element connectivity More...
 
std::vector< int > _ebedges
 boundary edges [nbedges] More...
 

Detailed Description

Definition at line 14 of file par_geom.h.

Constructor & Destructor Documentation

◆ ParMesh() [1/3]

ParMesh::ParMesh ( int  ndim,
int  nvert_e = 0,
int  ndof_e = 0,
int  nedge_e = 0,
MPI_Comm const &  icomm = MPI_COMM_WORLD 
)
explicit

Constructor initializing the members with default values.

Parameters
[in]ndimspace dimensions (dimension for coordinates)
[in]nvert_enumber of vertices per element (dimension for connectivity)
[in]ndof_edegrees of freedom per element (= nvert_e for linear elements)
[in]nedge_enumber of edges per element (= nvert_e for linear elements in 2D)
[in]icommMPI communicator

Definition at line 21 of file par_geom.cpp.

◆ ParMesh() [2/3]

ParMesh::ParMesh ( ParMesh const &  )
default

◆ ~ParMesh()

ParMesh::~ParMesh ( )
virtual

Destructor.

See clang warning on weak-vtables.

Definition at line 32 of file par_geom.cpp.

◆ ParMesh() [3/3]

ParMesh::ParMesh ( std::string const &  sname,
MPI_Comm const &  icomm = MPI_COMM_WORLD 
)
explicit

Reads mesh data from a binary file.

Parameters
[in]snamesuffix of file name
[in]icommMPI communicator
See also
ascii_write_mesh.m for the file format.

Definition at line 37 of file par_geom.cpp.

Member Function Documentation

◆ CheckInterfaceAdd()

bool ParMesh::CheckInterfaceAdd ( ) const
private

Definition at line 474 of file par_geom.cpp.

◆ CheckInterfaceAdd_InPlace()

bool ParMesh::CheckInterfaceAdd_InPlace ( ) const
private

Definition at line 438 of file par_geom.cpp.

◆ CheckInterfaceExchange()

bool ParMesh::CheckInterfaceExchange ( ) const
private

Definition at line 406 of file par_geom.cpp.

◆ CheckInterfaceExchange_InPlace()

bool ParMesh::CheckInterfaceExchange_InPlace ( ) const
private

Definition at line 377 of file par_geom.cpp.

◆ dscapr()

double ParMesh::dscapr ( std::vector< double > const &  x,
std::vector< double > const &  y 
) const
inline

Inner product

Parameters
[in]xvector
[in]yvector
Returns
resulting Euclidian inner product <x,y>

Definition at line 57 of file par_geom.h.

◆ Generate_VectorAdd()

void ParMesh::Generate_VectorAdd ( )
private

Transform

Definition at line 192 of file par_geom.cpp.

◆ GetCommunicator()

MPI_Comm ParMesh::GetCommunicator ( ) const
inline

Returns recent

Returns
MPI communicator

Definition at line 115 of file par_geom.h.

◆ MyRank()

int ParMesh::MyRank ( ) const
inline

MPI rank of the calling process in communication group.

Returns
MPI rank of the calling process

Definition at line 98 of file par_geom.h.

◆ NumProcs()

int ParMesh::NumProcs ( ) const
inline

Number of MPI processes in communication group.

Returns
Number of MPI processes

Definition at line 107 of file par_geom.h.

◆ operator=()

ParMesh& ParMesh::operator= ( ParMesh const &  )
delete

◆ ReadElementSubdomains()

vector< int > ParMesh::ReadElementSubdomains ( std::string const &  dname)
private

Reads the global triangle to subdomain mapping.

Parameters
[in]dnamefile name
See also
ascii_write_subdomains.m for the file format

Definition at line 75 of file par_geom.cpp.

◆ Transform_Local2Global_Vertex()

void ParMesh::Transform_Local2Global_Vertex ( int  myrank,
std::vector< int > const &  t2d 
)
private

Transform

Parameters
[in]myrankMPI rank of this process
[in]t2dglobal mapping triangle to subdomain for all elements (vertex based)

Definition at line 106 of file par_geom.cpp.

◆ VecAccu()

void ParMesh::VecAccu ( std::vector< double > &  w) const

Definition at line 517 of file par_geom.cpp.

Member Data Documentation

◆ _buf2loc

std::vector<int> ParMesh::_buf2loc
private

local indices of sendbuffer positions (the same as for recv)

Definition at line 141 of file par_geom.h.

◆ _gloc_itf

std::vector<int> ParMesh::_gloc_itf
private

global index of interface vertex lk

Definition at line 140 of file par_geom.h.

◆ _icomm

const MPI_Comm ParMesh::_icomm
private

MPI communicator for the group of processes.

Definition at line 122 of file par_geom.h.

◆ _loc_itf

std::vector<int> ParMesh::_loc_itf
private

local index of interface vertex lk

Definition at line 139 of file par_geom.h.

◆ _myrank

int ParMesh::_myrank
private

my MPI rank

Definition at line 124 of file par_geom.h.

◆ _numprocs

int ParMesh::_numprocs
private

number of MPI processes

Definition at line 123 of file par_geom.h.

◆ _sdispls

std::vector<int> ParMesh::_sdispls
private

offset of data to send to each MPI rank wrt. _senbuffer (the same as for recv)

Definition at line 136 of file par_geom.h.

◆ _sendbuf

std::vector<double> ParMesh::_sendbuf
mutableprivate

send buffer a n d receiving buffer (MPI_IN_PLACE)

Definition at line 134 of file par_geom.h.

◆ _sendcounts

std::vector<int> ParMesh::_sendcounts
private

number of data to send to each MPI rank (the same as for recv)

Definition at line 135 of file par_geom.h.

◆ _t_g2l

std::map<int, int> ParMesh::_t_g2l
private

triangles: global to local mapping

Definition at line 128 of file par_geom.h.

◆ _t_l2g

std::vector<int> ParMesh::_t_l2g
private

triangles: local to global mapping

Definition at line 126 of file par_geom.h.

◆ _v_g2l

std::map<int, int> ParMesh::_v_g2l
private

vertices: global to local mapping

Definition at line 127 of file par_geom.h.

◆ _v_l2g

std::vector<int> ParMesh::_v_l2g
private

vertices: local to global mapping

Definition at line 125 of file par_geom.h.

◆ _valence

std::vector<int> ParMesh::_valence
private

valence of local vertices, i.e. number of subdomains they belong to

Definition at line 132 of file par_geom.h.


The documentation for this class was generated from the following files: