jacobi_oo_STL
Public Member Functions | List of all members
Mesh_2d_3_square Class Reference

#include <geom.h>

Inheritance diagram for Mesh_2d_3_square:
Mesh

Public Member Functions

 Mesh_2d_3_square (int nx, int ny, int myid=0, int procx=1, int procy=1)
 
 ~Mesh_2d_3_square () override
 
void SetU (std::vector< double > &u) const
 
void SetF (std::vector< double > &f) const
 
std::vector< int > Index_DirichletNodes () const override
 
void SaveVectorP (std::string const &name, std::vector< double > const &u) const
 
- Public Member Functions inherited from Mesh
 Mesh (int ndim, int nvert_e=0, int ndof_e=0)
 
virtual ~Mesh ()
 
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 Debug () const
 
void Write_ascii_matlab (std::string const &fname, std::vector< double > const &v) const
 
void Visualize (std::vector< double > const &v) const
 

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)
 

Detailed Description

2D finite element mesh of the square consiting of linear triangular elements.

Definition at line 219 of file geom.h.

Constructor & Destructor Documentation

◆ Mesh_2d_3_square()

Mesh_2d_3_square::Mesh_2d_3_square ( int  nx,
int  ny,
int  myid = 0,
int  procx = 1,
int  procy = 1 
)

Generates the f.e. mesh for the unit square.

Parameters
[in]nxnumber of discretization intervals in x-direction
[in]nynumber of discretization intervals in y-direction
[in]myidmy MPI-rank / subdomain
[in]procxnumber of ranks/subdomains in x-direction
[in]procynumber of processes in y-direction

Definition at line 130 of file geom.cpp.

◆ ~Mesh_2d_3_square()

Mesh_2d_3_square::~Mesh_2d_3_square ( )
inlineoverride

Destructor

Definition at line 236 of file geom.h.

Member Function Documentation

◆ Index_DirichletNodes()

std::vector< int > Mesh_2d_3_square::Index_DirichletNodes ( ) const
overridevirtual

Determines the indices of those vertices with Dirichlet boundary conditions

Returns
index vector.

Implements Mesh.

Definition at line 197 of file geom.cpp.

◆ SaveVectorP()

void Mesh_2d_3_square::SaveVectorP ( std::string const &  name,
std::vector< double > const &  u 
) const

Stores the values of vector u of (sub)domain into a file name for further processing in gnuplot. The file stores rowise the x- and y- coordinates together with the value from u . The domain [xl, xr] x [yb, yt] is discretized into nx x ny intervals.

Parameters
[in]namebasename of file name (file name will be extended by the rank number)
[in]ulocal vector
Warning
Assumes tensor product grid in unit square; rowise numbered (as generated in class constructor). The output is provided for tensor product grid visualization ( similar to Matlab-surf() ).
See also
Mesh_2d_3_square

Definition at line 227 of file geom.cpp.

◆ SetF()

void Mesh_2d_3_square::SetF ( std::vector< double > &  f) const

Set right hand side (rhs) vector on a tensor product grid in the rectangle.

Parameters
[in]frhs vector

Definition at line 182 of file geom.cpp.

◆ SetU()

void Mesh_2d_3_square::SetU ( std::vector< double > &  u) const

Set solution vector based on a tensor product grid in the rectangle.

Parameters
[in]usolution vector

Definition at line 168 of file geom.cpp.


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