jacobi.template
|
#include <geom.h>
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 |
std::vector< int > | Index_BoundaryNodes () 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, int nedge_e=0) | |
__attribute__ ((noinline)) Mesh(Mesh const &)=default | |
Mesh & | operator= (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 |
void | Write_ascii_matlab (std::string const &fname, std::vector< double > const &v) const |
void | Export_scicomp (std::string const &basename) const |
virtual 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 | |
void | GetCoordsInRectangle (int nx, int ny, double xl, double xr, double yb, double yt, double xc[]) |
void | GetConnectivityInRectangle (int nx, int ny, int ia[]) |
Private Attributes | |
int | _myid |
my MPI rank More... | |
int | _procx |
number of MPI ranks in x-direction More... | |
int | _procy |
number of MPI ranks in y-direction More... | |
std::array< int, 4 > | _neigh |
MPI ranks of neighbors (negative: no neighbor but b.c.) More... | |
int | _color |
red/black coloring (checker board) of subdomains More... | |
double | _xl |
x coordinate of lower left corner of square More... | |
double | _xr |
x coordinate of lower right corner of square More... | |
double | _yb |
y coordinate or lower left corner of square More... | |
double | _yt |
y coordinate of upper right corner of square More... | |
int | _nx |
number of intervals in x-direction More... | |
int | _ny |
number of intervals in y-direction 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... | |
2D finite element mesh of the square consisting of linear triangular elements.
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.
[in] | nx | number of discretization intervals in x-direction |
[in] | ny | number of discretization intervals in y-direction |
[in] | myid | my MPI-rank / subdomain |
[in] | procx | number of ranks/subdomains in x-direction |
[in] | procy | number of processes in y-direction |
|
override |
|
private |
Determines the element connectivity of linear triangular elements of a FEM discretization of a rectangle using nx
x ny
equidistant intervals for discretization.
[in] | nx | number of discretization intervals in x-direction |
[in] | ny | number of discretization intervals in y-direction |
[out] | ia | element connectivity matrix with ia(3*s,3*s+1,3*s+2) as node numbers od element s |
|
private |
Determines the coordinates of the discretization nodes of the domain [xl
, xr
] x [yb
, yt
] which is discretized into nx
x ny
intervals.
[in] | nx | number of discretization intervals in x-direction |
[in] | ny | number of discretization intervals in y-direction |
[in] | xl | x-coordinate of left boundary |
[in] | xr | x-coordinate of right boundary |
[in] | yb | y-coordinate of lower boundary |
[in] | yt | y-coordinate of upper boundary |
[out] | xc | coordinate vector of length 2n with x(2*k,2*k+1) as coordinates of node k |
|
overridevirtual |
|
overridevirtual |
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.
[in] | name | basename of file name (file name will be extended by the rank number) |
[in] | u | local vector |
void Mesh_2d_3_square::SetF | ( | std::vector< double > & | f | ) | const |
void Mesh_2d_3_square::SetU | ( | std::vector< double > & | u | ) | const |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |