24 explicit Mesh(
int ndim,
int nvert_e = 0,
int ndof_e = 0,
int nedge_e = 0);
47 explicit Mesh(std::string
const &fname);
170 void SetValues(std::vector<double> &
v,
const std::function<
double(
double,
double)> &func)
const;
171 void SetBoundaryValues(std::vector<double> &
v,
const std::function<
double(
double,
double)> &func)
const;
172 void SetDirchletValues(std::vector<double> &
v,
const std::function<
double(
double,
double)> &func)
const;
221 void Visualize(std::vector<double>
const &
v)
const;
387 return static_cast<int>(
_bedges.size());
599 std::vector<std::shared_ptr<Mesh>>
_gmesh;
621 Mesh_2d_3_square(
int nx,
int ny,
int myid = 0,
int procx = 1,
int procy = 1);
632 void SetU(std::vector<double> &u)
const;
638 void SetF(std::vector<double> &f)
const;
662 void SaveVectorP(std::string
const &name, std::vector<double>
const &u)
const;
function vertex minimal boundary edge info in an ASCII file Matlab indexing is stored(starts with 1). % % The output file format is compatible with Mesh_2d_3_matlab nnode
void SetU(std::vector< double > &u) const
int _procx
number of MPI ranks in x-direction
~Mesh_2d_3_square() override
double _xl
x coordinate of lower left corner of square
std::array< int, 4 > _neigh
MPI ranks of neighbors (negative: no neighbor but b.c.)
void GetCoordsInRectangle(int nx, int ny, double xl, double xr, double yb, double yt, double xc[])
std::vector< int > Index_DirichletNodes() const override
double _xr
x coordinate of lower right corner of square
double _yt
y coordinate of upper right corner of square
void SaveVectorP(std::string const &name, std::vector< double > const &u) const
int _color
red/black coloring (checker board) of subdomains
void SetF(std::vector< double > &f) const
std::vector< int > Index_BoundaryNodes() const override
void GetConnectivityInRectangle(int nx, int ny, int ia[])
int _procy
number of MPI ranks in y-direction
int _nx
number of intervals in x-direction
int _ny
number of intervals in y-direction
double _yb
y coordinate or lower left corner of square
const std::vector< double > & GetCoords() const
void DeriveEdgeFromVertexBased_fast()
void Resize_Connectivity(int nelem, int nvert_e)
std::vector< int > _ea
edge based element connectivity
int _nedge_e
number of edges per element
void Resize_Coords(int nnodes, int ndim)
const std::vector< int > & GetEdges() const
std::vector< int > _sdedges
boundary edges [nbedges][2] with left/right subdomain number
std::vector< int > _ia
element connectivity
void DeriveEdgeFromVertexBased()
std::vector< double > & GetCoords()
int _ndof_e
degrees of freedom (d.o.f.) per element
void Export_scicomp(std::string const &basename) const
std::vector< double > _xc
coordinates
std::vector< int > & GetEdgeConnectivity()
void ReadVectexBasedMesh(std::string const &fname)
std::vector< std::vector< int > > Node2NodeGraph_2() const
int _nelem
number elements
void SetNdofsElement(int ndof)
virtual std::vector< int > Index_DirichletNodes() const
virtual bool Check_array_dimensions() const
const std::vector< int > & GetEdgeConnectivity() const
std::vector< int > & GetEdges()
int _ndim
space dimension of the problem (1, 2, or 3)
std::vector< int > _ebedges
boundary edges [nbedges]
int _nnode
number nodes/vertices
void DeriveVertexFromEdgeBased()
void Write_ascii_matlab(std::string const &fname, std::vector< double > const &v) const
int _nedge
number of edges in mesh
std::vector< int > _bedges
boundary edges [nbedges][2] storing start/end vertex
void DeriveEdgeFromVertexBased_fast_2()
int NverticesElements() const
std::vector< std::vector< int > > Node2NodeGraph() const
__attribute__((noinline)) Mesh(Mesh const &)=default
int NedgesElements() const
Mesh & operator=(Mesh const &)=delete
std::vector< int > & GetConnectivity()
void PermuteVertices_EdgeBased(std::vector< int > const &old2new)
void Del_EdgeConnectivity()
void ReadVertexBasedMesh(std::string const &fname)
void DeriveEdgeFromVertexBased_slow()
void DebugEdgeBased() const
virtual std::vector< int > const & GetFathersOfVertices() const
void SetDirchletValues(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
const std::vector< int > _dummy
empty dummy vector
std::vector< int > _edges
edges of mesh (vertices ordered ascending)
virtual std::vector< int > Index_BoundaryNodes() const
void SetNverticesElement(int nvert)
const std::vector< int > & GetConnectivity() const
std::vector< std::vector< int > > Node2NodeGraph_1() const
void SetValues(std::vector< double > &v, const std::function< double(double, double)> &func) const
void Visualize(std::vector< double > const &v) const
int _nvert_e
number of vertices per element
bool Check_array_dimensions() const override
virtual ~RefinedMesh() override
RefinedMesh(Mesh const &cmesh)
std::vector< bool > const _ibref
refinement info
void PermuteVertices_EdgeBased(std::vector< int > const &old2new)
Mesh RefineElements(std::vector< bool > const &ibref)
std::vector< int > _vfathers
stores the 2 fathers of each vertex (equal fathers denote original coarse vertex)
void RefineAllElements(int nref=1)
std::vector< int > const & GetFathersOfVertices() const override
RefinedMesh & operator=(RefinedMesh const &)=delete
RefinedMesh(RefinedMesh const &)=delete
int _nref
number of regular refinements performed
Mesh const & operator[](int lev) const
Mesh const & coarsest() const
std::vector< std::shared_ptr< Mesh > > _gmesh
mesh hierarchy from coarse ([0]) to fine.
Mesh const & finest() const