HArD::Core3D
Hybrid Arbitrary Degree::Core 3D - Library to implement 3D schemes with vertex, edge, face and cell polynomials as unknowns
Loading...
Searching...
No Matches
Classes | Typedefs | Functions | Variables
TransformMeshes

Provides tools to transform a mesh (coarsen, change format, etc.) More...

Classes

class  DirectedFace
 
class  DirectedCell
 
class  CellNodeArray
 
class  GraphNodeArray
 
class  DirectedGraph
 
struct  Element
 Structure to store elements. More...
 

Typedefs

typedef std::vector< std::vector< std::size_t > > Array
 Type definition for a matrix of unsigned ints.
 

Functions

int main (const int argc, const char *argv[])
 Main executable (CheckMesh) to check the sanity of an RF mesh.
 
 DirectedFace::DirectedFace ()
 Null constructor.
 
 DirectedFace::~DirectedFace ()
 Destructor.
 
 DirectedFace::DirectedFace (std::vector< std::size_t >)
 Class Constructor: Initialises the face with the two nodes that form the face.
 
void DirectedFace::add_vertex (size_t)
 Add a vertex to face.
 
bool operator== (const DirectedFace &, const DirectedFace &)
 Boolean operation to test if two faces are equal.
 
 DirectedCell::DirectedCell ()
 Null Constructor.
 
 DirectedCell::DirectedCell (std::size_t)
 Constructor.
 
 DirectedCell::~DirectedCell ()
 Destructor.
 
 DirectedCell::DirectedCell (std::vector< DirectedFace > &, std::size_t)
 Class Constructor: Initialises the cell with a vector of faces and the cell ID.
 
void DirectedCell::add_face (DirectedFace &)
 Method to append an face to the end of the cell.
 
void DirectedCell::remove_face (std::size_t)
 Remove face at a given position.
 
void DirectedCell::append_cell (DirectedCell &)
 
bool DirectedCell::check_cell ()
 
bool DirectedCell::has_face (DirectedFace)
 Tests if cell has an face.
 
void DirectedCell::print ()
 Prints all the faces of the cell.
 
 CellNodeArray::CellNodeArray ()
 Null constructor.
 
 CellNodeArray::~CellNodeArray ()
 Default constructor.
 
 CellNodeArray::CellNodeArray (Array &)
 Class Constructor: Initialises the NodeArray with the cell-node array.
 
bool CellNodeArray::node_exists (std::size_t)
 Test if a given node exists in the cell-node array.
 
void CellNodeArray::renum_nodes (std::size_t)
 Subtracts one from all nodes greater than a given node.
 
void CellNodeArray::print (std::ofstream *, std::size_t)
 Prints the cell node array to an out file stream.
 
 GraphNodeArray::GraphNodeArray ()
 Null constructor.
 
 GraphNodeArray::~GraphNodeArray ()
 Default constructor.
 
 GraphNodeArray::GraphNodeArray (std::vector< CellNodeArray > &)
 Class Constructor: Initialises the NodeArray with the cell-node array.
 
bool GraphNodeArray::node_exists (std::size_t)
 Test if a given node exists in the cell-node array.
 
void GraphNodeArray::renum_nodes (std::size_t)
 Subtracts one from all nodes greater than a given node.
 
void GraphNodeArray::print (std::ofstream *)
 Prints the cell node array to an out file stream.
 
 DirectedGraph::DirectedGraph ()
 Null constructor.
 
 DirectedGraph::~DirectedGraph ()
 Default constructor.
 
 DirectedGraph::DirectedGraph (std::vector< DirectedCell > &)
 Class Constructor: Initialises the DirectedGraph with the cells.
 
void DirectedGraph::add_cell (DirectedCell &)
 Appends a cell to the end of the graph.
 
void DirectedGraph::remove_cell (std::size_t)
 Removes cell from a given position.
 
bool DirectedGraph::test_graph ()
 Test if graph has duplicate faces or unordered cells.
 
void DirectedGraph::randomise ()
 Randomise order of cells in graph.
 
void DirectedGraph::order ()
 Order cells in graph by the number of faces in each cell.
 
void DirectedGraph::coarsen ()
 Coarsen the graph by merging cells.
 
GraphNodeArray DirectedGraph::graph_to_array ()
 Returns the cell-node array the graph corresponds to.
 
std::string DirectedGraph::get_partition ()
 Returns list of fine cells that each coarse cell consists of.
 
void DirectedGraph::plotfile (std::ofstream *, std::vector< Eigen::VectorXd > &)
 Outputs to a .dat file for gnuplot to read.
 
size_t coplanar_idx (const std::vector< VectorRd > &points)
 Given a family of points, returns the maximum N such that the first N points are co-planar.
 
int main (int argc, char *argv[])
 Main executable (MeshCoarsen) to coarsen a mesh.
 
void write_RF (HArDCore3D::Mesh *mesh, const std::string filename)
 Writes RF files from a mesh.
 
void random_move (HArDCore3D::Mesh *mesh, double &factor)
 Move vertices randomly, except boundary and those with x=1/2 or z=1/2.
 
void apply_transformation (HArDCore3D::Mesh *mesh, std::function< VectorRd(const VectorRd &)> trans)
 Apply algebraic transformation to all vertices.
 
 Element::Element (const size_t &_type, const size_t &_id, const std::vector< size_t > &_vertices)
 Constructor.
 
void Element::printRF (std::ofstream &file) const
 Plots the element in RF format into the file provided.
 

Variables

constexpr int dimspace = 3
 
const std::string mesh_dir = "../../../meshes/"
 
std::string default_mesh = mesh_dir + "Cubic-Cells/RF_fmt/gcube_2x2x2"
 
std::vector< std::size_t > DirectedFace::V
 vector of vertices
 
std::vector< DirectedFaceDirectedCell::T
 The faces the cell consists of.
 
std::vector< std::size_t > DirectedCell::part
 The cell ID's of the cell's that have formed this cell.
 
Array CellNodeArray::A
 The cell-node array.
 
std::vector< CellNodeArrayGraphNodeArray::GA
 The cell-node array.
 
std::vector< DirectedCellDirectedGraph::G
 Vector of cells that form the graph.
 
const std::string mesh_dir = "../../../meshes/"
 
std::string default_mesh = mesh_dir + "Cubic-Cells/RF_fmt/gcube_2x2x2"
 
const std::string mesh_root = ""
 
const std::string mesh_dir = "../../../meshes/"
 
std::string default_mesh = mesh_dir + "Cubic-Cells/RF_fmt/gcube_2x2x2"
 
const size_t Element::type
 
const size_t Element::id
 
const std::vector< size_t > Element::vertices
 
size_t Element::n_vertices
 
size_t Element::n_faces
 
const std::string mesh_dir = "../../../meshes/"
 
std::string default_mesh = mesh_dir + "ComplexGeometries/CubeCavityWedge/MSH_fmt/hexa.1"
 
const std::string mesh_dir = "../../../meshes/"
 
std::string default_mesh = mesh_dir + "Cubic-Cells/RF_fmt/gcube_2x2x2"
 
const std::string mesh_dir = "../../../meshes/"
 
std::string default_mesh = mesh_dir + "Cubic-Cells/RF_fmt/gcube_2x2x2"
 

Detailed Description

Provides tools to transform a mesh (coarsen, change format, etc.)

Typedef Documentation

◆ Array

typedef std::vector<std::vector<std::size_t> > Array

Type definition for a matrix of unsigned ints.

Function Documentation

◆ add_cell()

void DirectedGraph::add_cell ( DirectedCell T)

Appends a cell to the end of the graph.

Parameters
TCell to be added

◆ add_face()

void DirectedCell::add_face ( DirectedFace f)

Method to append an face to the end of the cell.

Parameters
fFace to be added

◆ add_vertex()

void DirectedFace::add_vertex ( size_t  v)

Add a vertex to face.

Parameters
vVertex to be added

◆ append_cell()

void DirectedCell::append_cell ( DirectedCell K)

Appends the vector of faces and partition vector of a cell to the faces and partition of this cell

Parameters
KCell to be added

◆ apply_transformation()

void apply_transformation ( HArDCore3D::Mesh mesh,
std::function< VectorRd(const VectorRd &)>  trans 
)

Apply algebraic transformation to all vertices.

◆ CellNodeArray() [1/2]

CellNodeArray::CellNodeArray ( )

Null constructor.

◆ CellNodeArray() [2/2]

CellNodeArray::CellNodeArray ( Array _A)

Class Constructor: Initialises the NodeArray with the cell-node array.

Parameters
_AThe cell-node array

◆ check_cell()

bool DirectedCell::check_cell ( )

◆ coarsen()

void DirectedGraph::coarsen ( )

Coarsen the graph by merging cells.

◆ coplanar_idx()

size_t coplanar_idx ( const std::vector< VectorRd > &  points)

Given a family of points, returns the maximum N such that the first N points are co-planar.

◆ DirectedCell() [1/3]

DirectedCell::DirectedCell ( )

Null Constructor.

◆ DirectedCell() [2/3]

DirectedCell::DirectedCell ( std::size_t  cell_num)

Constructor.

◆ DirectedCell() [3/3]

DirectedCell::DirectedCell ( std::vector< DirectedFace > &  _T,
std::size_t  cell_num 
)

Class Constructor: Initialises the cell with a vector of faces and the cell ID.

Parameters
_TA reference to the faces that the cell consists of
cell_numInitial cell ID

◆ DirectedFace() [1/2]

DirectedFace::DirectedFace ( )

Null constructor.

◆ DirectedFace() [2/2]

DirectedFace::DirectedFace ( std::vector< std::size_t >  _V)

Class Constructor: Initialises the face with the two nodes that form the face.

◆ DirectedGraph() [1/2]

DirectedGraph::DirectedGraph ( )

Null constructor.

◆ DirectedGraph() [2/2]

DirectedGraph::DirectedGraph ( std::vector< DirectedCell > &  _G)

Class Constructor: Initialises the DirectedGraph with the cells.

Parameters
_GInitial cells

◆ Element()

Element::Element ( const size_t &  _type,
const size_t &  _id,
const std::vector< size_t > &  _vertices 
)
inline

Constructor.

Parameters
_typeType of element
_idId of the element
_verticesList of indices of vertices

◆ get_partition()

std::string DirectedGraph::get_partition ( )

Returns list of fine cells that each coarse cell consists of.

◆ graph_to_array()

GraphNodeArray DirectedGraph::graph_to_array ( )

Returns the cell-node array the graph corresponds to.

◆ GraphNodeArray() [1/2]

GraphNodeArray::GraphNodeArray ( )

Null constructor.

◆ GraphNodeArray() [2/2]

GraphNodeArray::GraphNodeArray ( std::vector< CellNodeArray > &  _GA)

Class Constructor: Initialises the NodeArray with the cell-node array.

Parameters
_GAThe graph-node array

◆ has_face()

bool DirectedCell::has_face ( DirectedFace  f)

Tests if cell has an face.

Parameters
fFace to check for

◆ main() [1/2]

int main ( const int  argc,
const char *  argv[] 
)

Main executable (CheckMesh) to check the sanity of an RF mesh.

Main executable (RFToVTU) to transform an RF mesh into a VTU file.

Main executable (RFToFVCA10format) to transform an RF mesh into a .msh FVCA10 format.

Main executable (MoveVertices) to modify a mesh by moving its vertices.

Main executable (MakeFlatFaces) to try and create a mesh with flat faces (by subdivision)

◆ main() [2/2]

int main ( int  argc,
char *  argv[] 
)

Main executable (MeshCoarsen) to coarsen a mesh.

Main executable (MSHToRF) to convert a .msh mesh in RF format.

◆ node_exists() [1/2]

bool CellNodeArray::node_exists ( std::size_t  node)

Test if a given node exists in the cell-node array.

Parameters
nodeNode to test for

◆ node_exists() [2/2]

bool GraphNodeArray::node_exists ( std::size_t  node)

Test if a given node exists in the cell-node array.

Parameters
nodeNode to test for

◆ operator==()

bool operator== ( const DirectedFace lhs,
const DirectedFace rhs 
)

Boolean operation to test if two faces are equal.

◆ order()

void DirectedGraph::order ( )

Order cells in graph by the number of faces in each cell.

◆ plotfile()

void DirectedGraph::plotfile ( std::ofstream *  ,
std::vector< Eigen::VectorXd > &   
)

Outputs to a .dat file for gnuplot to read.

◆ print() [1/3]

void DirectedCell::print ( )

Prints all the faces of the cell.

◆ print() [2/3]

void GraphNodeArray::print ( std::ofstream *  out)

Prints the cell node array to an out file stream.

Parameters
outPointer to the file stream to print to

◆ print() [3/3]

void CellNodeArray::print ( std::ofstream *  out,
std::size_t  cell_num 
)

Prints the cell node array to an out file stream.

Parameters
outPointer to the file stream to print to

◆ printRF()

void Element::printRF ( std::ofstream &  file) const
inline

Plots the element in RF format into the file provided.

◆ random_move()

void random_move ( HArDCore3D::Mesh mesh,
double &  factor 
)

Move vertices randomly, except boundary and those with x=1/2 or z=1/2.

◆ randomise()

void DirectedGraph::randomise ( )

Randomise order of cells in graph.

◆ remove_cell()

void DirectedGraph::remove_cell ( std::size_t  pos)

Removes cell from a given position.

Parameters
posCell to be removed

◆ remove_face()

void DirectedCell::remove_face ( std::size_t  pos)

Remove face at a given position.

Parameters
posPosition of face to be removed

◆ renum_nodes() [1/2]

void CellNodeArray::renum_nodes ( std::size_t  node)

Subtracts one from all nodes greater than a given node.

Parameters
nodeNode given

◆ renum_nodes() [2/2]

void GraphNodeArray::renum_nodes ( std::size_t  node)

Subtracts one from all nodes greater than a given node.

Parameters
nodeNode given

◆ test_graph()

bool DirectedGraph::test_graph ( )

Test if graph has duplicate faces or unordered cells.

◆ write_RF()

void write_RF ( HArDCore3D::Mesh mesh,
const std::string  filename 
)

Writes RF files from a mesh.

◆ ~CellNodeArray()

CellNodeArray::~CellNodeArray ( )

Default constructor.

◆ ~DirectedCell()

DirectedCell::~DirectedCell ( )

Destructor.

◆ ~DirectedFace()

DirectedFace::~DirectedFace ( )

Destructor.

◆ ~DirectedGraph()

DirectedGraph::~DirectedGraph ( )

Default constructor.

◆ ~GraphNodeArray()

GraphNodeArray::~GraphNodeArray ( )

Default constructor.

Variable Documentation

◆ A

Array CellNodeArray::A

The cell-node array.

◆ default_mesh [1/6]

std::string default_mesh = mesh_dir + "Cubic-Cells/RF_fmt/gcube_2x2x2"

◆ default_mesh [2/6]

std::string default_mesh = mesh_dir + "Cubic-Cells/RF_fmt/gcube_2x2x2"

◆ default_mesh [3/6]

std::string default_mesh = mesh_dir + "Cubic-Cells/RF_fmt/gcube_2x2x2"

◆ default_mesh [4/6]

std::string default_mesh = mesh_dir + "ComplexGeometries/CubeCavityWedge/MSH_fmt/hexa.1"

◆ default_mesh [5/6]

std::string default_mesh = mesh_dir + "Cubic-Cells/RF_fmt/gcube_2x2x2"

◆ default_mesh [6/6]

std::string default_mesh = mesh_dir + "Cubic-Cells/RF_fmt/gcube_2x2x2"

◆ dimspace

constexpr int dimspace = 3
constexpr

◆ G

std::vector<DirectedCell> DirectedGraph::G

Vector of cells that form the graph.

◆ GA

std::vector<CellNodeArray> GraphNodeArray::GA

The cell-node array.

◆ id

const size_t Element::id

◆ mesh_dir [1/6]

const std::string mesh_dir = "../../../meshes/"

◆ mesh_dir [2/6]

const std::string mesh_dir = "../../../meshes/"

◆ mesh_dir [3/6]

const std::string mesh_dir = "../../../meshes/"

◆ mesh_dir [4/6]

const std::string mesh_dir = "../../../meshes/"

◆ mesh_dir [5/6]

const std::string mesh_dir = "../../../meshes/"

◆ mesh_dir [6/6]

const std::string mesh_dir = "../../../meshes/"

◆ mesh_root

const std::string mesh_root = ""

◆ n_faces

size_t Element::n_faces

◆ n_vertices

size_t Element::n_vertices

◆ part

std::vector<std::size_t> DirectedCell::part

The cell ID's of the cell's that have formed this cell.

◆ T

std::vector<DirectedFace> DirectedCell::T

The faces the cell consists of.

◆ type

const size_t Element::type

◆ V

std::vector<std::size_t> DirectedFace::V

vector of vertices

◆ vertices

const std::vector<size_t> Element::vertices