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

#include <geom.h>

Inheritance diagram for RefinedMesh:
Mesh

Public Member Functions

 RefinedMesh (Mesh const &cmesh, std::vector< bool > const &ibref)
 
 RefinedMesh (Mesh const &cmesh)
 
 RefinedMesh (RefinedMesh const &)=delete
 
RefinedMeshoperator= (RefinedMesh const &)=delete
 
virtual ~RefinedMesh () override
 
Mesh RefineElements (std::vector< bool > const &ibref)
 
void RefineAllElements (int nref=1)
 
const std::vector< int > & GetFathersOfVertices () const override
 
- 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
 
void Del_EdgeConnectivity ()
 

Protected Member Functions

bool Check_array_dimensions () const override
 
void PermuteVertices_EdgeBased (std::vector< int > const &old2new)
 
- 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
 
void PermuteVertices_EdgeBased (std::vector< int > const &old2new)
 

Private Attributes

const std::vector< bool > _ibref
 refinement info More...
 
int _nref
 number of regular refinements performed More...
 
std::vector< int > _vfathers
 stores the 2 fathers of each vertex (equal fathers denote original coarse vertex) More...
 

Additional Inherited Members

- 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 454 of file geom.h.

Constructor & Destructor Documentation

◆ RefinedMesh() [1/3]

RefinedMesh::RefinedMesh ( Mesh const &  cmesh,
std::vector< bool > const &  ibref 
)

Constructs a refined mesh according to the marked elements in ibref.

If the vector ibref has size 0 then all elements will be refined.

Parameters
[in]cmeshoriginal mesh for coarsening.
[in]ibrefvector containing True/False regarding refinement for each element

Definition at line 817 of file geom.cpp.

◆ RefinedMesh() [2/3]

RefinedMesh::RefinedMesh ( Mesh const &  cmesh)
inlineexplicit

Constructs a refined mesh by regulare refinement of all elements.

Parameters
[in]cmeshoriginal mesh for coarsening.

Definition at line 476 of file geom.h.

◆ RefinedMesh() [3/3]

RefinedMesh::RefinedMesh ( RefinedMesh const &  )
delete

◆ ~RefinedMesh()

RefinedMesh::~RefinedMesh ( )
overridevirtual

Destructor.

Definition at line 833 of file geom.cpp.

Member Function Documentation

◆ Check_array_dimensions()

bool RefinedMesh::Check_array_dimensions ( ) const
overrideprotectedvirtual

Checks whether the array dimensions fit to their appropriate size parameters

Returns
index vector.

Reimplemented from Mesh.

Definition at line 1070 of file geom.cpp.

◆ GetFathersOfVertices()

const std::vector<int>& RefinedMesh::GetFathersOfVertices ( ) const
inlineoverridevirtual

Accesses the father-of-nodes relation.

Returns
father-of-nodes relation [nnodes][2]

Reimplemented from Mesh.

Definition at line 516 of file geom.h.

◆ operator=()

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

◆ PermuteVertices_EdgeBased()

void RefinedMesh::PermuteVertices_EdgeBased ( std::vector< int > const &  old2new)
protected

Permutes the vertex information in an edge based mesh.

Parameters
[in]old2newnew indices of original vertices.

Definition at line 1056 of file geom.cpp.

◆ RefineAllElements()

void RefinedMesh::RefineAllElements ( int  nref = 1)

Refines all elements in the actual mesh.

Parameters
[in]nrefnumber of regular refinements to perform

Definition at line 862 of file geom.cpp.

◆ RefineElements()

Mesh RefinedMesh::RefineElements ( std::vector< bool > const &  ibref)

Refines the mesh according to the marked elements.

Parameters
[in]ibrefvector containing True/False regarding refinement for each element
Returns
the refined mesh

Definition at line 836 of file geom.cpp.

Member Data Documentation

◆ _ibref

const std::vector<bool> RefinedMesh::_ibref
private

refinement info

Definition at line 538 of file geom.h.

◆ _nref

int RefinedMesh::_nref
private

number of regular refinements performed

Definition at line 539 of file geom.h.

◆ _vfathers

std::vector<int> RefinedMesh::_vfathers
private

stores the 2 fathers of each vertex (equal fathers denote original coarse vertex)

Definition at line 540 of file geom.h.


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