#include <HoneycombMeshGenerator.hpp>
Public Member Functions | |
HoneycombMeshGenerator (unsigned numNodesAlongWidth, unsigned numNodesAlongLength, unsigned ghosts=3, bool cylindrical=true, double scaleFactor=1.0) | |
~HoneycombMeshGenerator () | |
MutableMesh< 2, 2 > * | GetMesh () |
Cylindrical2dMesh * | GetCylindricalMesh () |
std::vector< unsigned > | GetCellLocationIndices () |
MutableMesh< 2, 2 > * | GetCircularMesh (double radius) |
Private Member Functions | |
void | Make2dPeriodicMesh (double width, unsigned ghosts) |
Private Attributes | |
MutableMesh< 2, 2 > * | mpMesh |
std::set< unsigned > | mGhostNodeIndices |
std::string | mMeshFilename |
double | mDomainWidth |
double | mDomainDepth |
double | mBottom |
double | mTop |
unsigned | mNumCellWidth |
unsigned | mNumCellLength |
bool | mCylindrical |
This class takes in options such as width, height, number of ghost nodes and generates a honeycomb mesh (with equal distance between nodes), and ghost node information when requested.
NOTE: the user should delete the mesh after use to manage memory.
Definition at line 49 of file HoneycombMeshGenerator.hpp.
HoneycombMeshGenerator::HoneycombMeshGenerator | ( | unsigned | numNodesAlongWidth, | |
unsigned | numNodesAlongLength, | |||
unsigned | ghosts = 3 , |
|||
bool | cylindrical = true , |
|||
double | scaleFactor = 1.0 | |||
) |
Honeycomb Mesh Generator
numNodesAlongWidth | The number of cells you want alopng the bottom of the domain, | |
numNodesAlongLength | The number of cells you want sides of the domain, | |
ghosts | The thickness of ghost nodes to put around the edge (defaults to 3), | |
cylindrical | Whether the mesh should be cylindrically periodic (defaults to true), | |
scaleFactor | The scale factor for the width (circumference) of the cells. |
Definition at line 34 of file HoneycombMeshGenerator.cpp.
References TetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ConstructFromMeshReader(), EXCEPTION, MutableMesh< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), OutputFileHandler::GetOutputDirectoryFullPath(), PetscTools::IsSequential(), Make2dPeriodicMesh(), mCylindrical, mDomainWidth, mGhostNodeIndices, mMeshFilename, mpMesh, and MutableMesh< ELEMENT_DIM, SPACE_DIM >::ReMesh().
HoneycombMeshGenerator::~HoneycombMeshGenerator | ( | ) |
Destructor - deletes the mesh object and pointer
Definition at line 80 of file HoneycombMeshGenerator.cpp.
References mpMesh.
void HoneycombMeshGenerator::Make2dPeriodicMesh | ( | double | width, | |
unsigned | ghosts | |||
) | [private] |
Make a periodic honeycomb mesh.
width | The periodic length scale to base this mesh around | |
ghosts | The number of rows of ghost nodes to add on at the top and bottom |
Definition at line 161 of file HoneycombMeshGenerator.cpp.
References PetscTools::AmMaster(), PetscTools::Barrier(), mBottom, mCylindrical, mDomainDepth, mGhostNodeIndices, mMeshFilename, mNumCellLength, mNumCellWidth, mTop, and OutputFileHandler::OpenOutputFile().
Referenced by HoneycombMeshGenerator().
MutableMesh< 2, 2 > * HoneycombMeshGenerator::GetMesh | ( | ) |
Definition at line 86 of file HoneycombMeshGenerator.cpp.
References EXCEPTION, mCylindrical, and mpMesh.
Cylindrical2dMesh * HoneycombMeshGenerator::GetCylindricalMesh | ( | ) |
Definition at line 96 of file HoneycombMeshGenerator.cpp.
References EXCEPTION, mCylindrical, and mpMesh.
std::vector< unsigned > HoneycombMeshGenerator::GetCellLocationIndices | ( | ) |
Returns the indices of the nodes in the mesh which correspond to real cells. This information needs to be passed in when constructing a MeshBasedCellPopulationWithGhostNodes.
Definition at line 105 of file HoneycombMeshGenerator.cpp.
References MutableMesh< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), mGhostNodeIndices, and mpMesh.
MutableMesh< 2, 2 > * HoneycombMeshGenerator::GetCircularMesh | ( | double | radius | ) |
radius | the radius of the circular mesh |
Definition at line 119 of file HoneycombMeshGenerator.cpp.
References MutableMesh< ELEMENT_DIM, SPACE_DIM >::DeleteNodePriorToReMesh(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNode(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNumAllNodes(), MutableMesh< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), RandomNumberGenerator::Instance(), mCylindrical, mpMesh, RandomNumberGenerator::ranf(), MutableMesh< ELEMENT_DIM, SPACE_DIM >::ReMesh(), and AbstractMesh< ELEMENT_DIM, SPACE_DIM >::Translate().
MutableMesh<2,2>* HoneycombMeshGenerator::mpMesh [private] |
A pointer to the mesh this class creates
Definition at line 54 of file HoneycombMeshGenerator.hpp.
Referenced by GetCellLocationIndices(), GetCircularMesh(), GetCylindricalMesh(), GetMesh(), HoneycombMeshGenerator(), and ~HoneycombMeshGenerator().
std::set<unsigned> HoneycombMeshGenerator::mGhostNodeIndices [private] |
The indices of the nodes in this mesh which are 'ghost nodes'
Definition at line 57 of file HoneycombMeshGenerator.hpp.
Referenced by GetCellLocationIndices(), HoneycombMeshGenerator(), and Make2dPeriodicMesh().
std::string HoneycombMeshGenerator::mMeshFilename [private] |
The mesh is generated by writing out a series of nodes and reading them in from this file
Definition at line 60 of file HoneycombMeshGenerator.hpp.
Referenced by HoneycombMeshGenerator(), and Make2dPeriodicMesh().
double HoneycombMeshGenerator::mDomainWidth [private] |
The (x) width of the domain to be constructed
Definition at line 63 of file HoneycombMeshGenerator.hpp.
Referenced by HoneycombMeshGenerator().
double HoneycombMeshGenerator::mDomainDepth [private] |
The (y) depth of the domain to be constructed
Definition at line 66 of file HoneycombMeshGenerator.hpp.
Referenced by Make2dPeriodicMesh().
double HoneycombMeshGenerator::mBottom [private] |
The y coordinate of the bottom row of cells (ghosts if requested)
Definition at line 69 of file HoneycombMeshGenerator.hpp.
Referenced by Make2dPeriodicMesh().
double HoneycombMeshGenerator::mTop [private] |
The y coordinate of the top row of cells (ghosts if requested)
Definition at line 72 of file HoneycombMeshGenerator.hpp.
Referenced by Make2dPeriodicMesh().
unsigned HoneycombMeshGenerator::mNumCellWidth [private] |
The number of columns of cells to put across the x coordinate of the mesh
Definition at line 75 of file HoneycombMeshGenerator.hpp.
Referenced by Make2dPeriodicMesh().
unsigned HoneycombMeshGenerator::mNumCellLength [private] |
The number of rows of cells to put up the y coordinate of the mesh
Definition at line 78 of file HoneycombMeshGenerator.hpp.
Referenced by Make2dPeriodicMesh().
bool HoneycombMeshGenerator::mCylindrical [private] |
Whether we are creating a cylindrical mesh or not
Definition at line 81 of file HoneycombMeshGenerator.hpp.
Referenced by GetCircularMesh(), GetCylindricalMesh(), GetMesh(), HoneycombMeshGenerator(), and Make2dPeriodicMesh().