libMesh
|
Tools for Mesh
generation.
More...
Namespaces | |
Private | |
Classes | |
class | QueryElemSubdomainIDBase |
Class for receiving the callback during extrusion generation and providing user-defined subdomains based on the old (existing) element id and the current layer. More... | |
Functions | |
void | build_cube (UnstructuredMesh &mesh, const unsigned int nx=0, const unsigned int ny=0, const unsigned int nz=0, const Real xmin=0., const Real xmax=1., const Real ymin=0., const Real ymax=1., const Real zmin=0., const Real zmax=1., const ElemType type=INVALID_ELEM, const bool gauss_lobatto_grid=false) |
Builds a \( nx \times ny \times nz \) (elements) cube. More... | |
void | build_point (UnstructuredMesh &mesh, const ElemType type=INVALID_ELEM, const bool gauss_lobatto_grid=false) |
A specialized build_cube() for 0D meshes. More... | |
void | build_line (UnstructuredMesh &mesh, const unsigned int nx, const Real xmin=0., const Real xmax=1., const ElemType type=INVALID_ELEM, const bool gauss_lobatto_grid=false) |
A specialized build_cube() for 1D meshes. More... | |
void | build_square (UnstructuredMesh &mesh, const unsigned int nx, const unsigned int ny, const Real xmin=0., const Real xmax=1., const Real ymin=0., const Real ymax=1., const ElemType type=INVALID_ELEM, const bool gauss_lobatto_grid=false) |
A specialized build_cube() for 2D meshes. More... | |
void | build_sphere (UnstructuredMesh &mesh, const Real rad=1, const unsigned int nr=2, const ElemType type=INVALID_ELEM, const unsigned int n_smooth=2, const bool flat=true) |
Meshes a spherical or mapped-spherical domain. More... | |
void | build_extrusion (UnstructuredMesh &mesh, const MeshBase &cross_section, const unsigned int nz, RealVectorValue extrusion_vector, QueryElemSubdomainIDBase *elem_subdomain=nullptr) |
Meshes the tensor product of a 1D and a 1D-or-2D domain. More... | |
void | build_delaunay_square (UnstructuredMesh &mesh, const unsigned int nx, const unsigned int ny, const Real xmin, const Real xmax, const Real ymin, const Real ymax, const ElemType type, const std::vector< TriangleInterface::Hole *> *holes=nullptr) |
Meshes a rectangular (2D) region (with or without holes) with a Delaunay triangulation. More... | |
void | surface_octahedron (UnstructuredMesh &mesh, Real xmin, Real xmax, Real ymin, Real ymax, Real zmin, Real zmax, bool flip_tris=false) |
Meshes the surface of an octahedron with 8 Tri3 elements, with counter-clockwise (libMesh default) node ordering as viewed from the octahedron exterior if flip_tris is false or from the interior otherwise. More... | |
Tools for Mesh
generation.
void libMesh::MeshTools::Generation::build_cube | ( | UnstructuredMesh & | mesh, |
const unsigned int | nx = 0 , |
||
const unsigned int | ny = 0 , |
||
const unsigned int | nz = 0 , |
||
const Real | xmin = 0. , |
||
const Real | xmax = 1. , |
||
const Real | ymin = 0. , |
||
const Real | ymax = 1. , |
||
const Real | zmin = 0. , |
||
const Real | zmax = 1. , |
||
const ElemType | type = INVALID_ELEM , |
||
const bool | gauss_lobatto_grid = false |
||
) |
Builds a \( nx \times ny \times nz \) (elements) cube.
Defaults to a unit cube (or line in 1D, square in 2D), but the dimensions can be specified through the optional arguments.
Boundary ids are set to be equal to the side indexing on a master hex
Definition at line 313 of file mesh_generation.C.
References libMesh::BoundaryInfo::add_node(), libMesh::BoundaryInfo::add_side(), libMesh::BoundaryInfo::boundary_ids(), libMesh::Elem::build(), libMesh::Elem::build_with_id(), libMesh::EDGE2, libMesh::EDGE3, libMesh::EDGE4, libMesh::Utility::enum_to_string(), libMesh::HEX20, libMesh::HEX27, libMesh::HEX8, libMesh::DofObject::id(), libMesh::MeshTools::Generation::Private::idx(), libMesh::index_range(), libMesh::INVALID_ELEM, libMesh::BoundaryInfo::invalid_id, libMesh::libmesh_assert(), mesh, libMesh::NODEELEM, libMesh::BoundaryInfo::nodeset_name(), libMesh::PRISM15, libMesh::PRISM18, libMesh::PRISM20, libMesh::PRISM21, libMesh::PRISM6, libMesh::PYRAMID13, libMesh::PYRAMID14, libMesh::PYRAMID18, libMesh::PYRAMID5, libMesh::QUAD4, libMesh::QUAD8, libMesh::QUAD9, libMesh::QUADSHELL4, libMesh::QUADSHELL8, libMesh::QUADSHELL9, libMesh::Real, libMesh::MeshTools::Modification::redistribute(), libMesh::BoundaryInfo::remove(), libMesh::Elem::set_node(), libMesh::BoundaryInfo::sideset_name(), libMesh::TET10, libMesh::TET14, libMesh::TET4, libMesh::TRI3, libMesh::TRI6, libMesh::TRI7, and libMesh::TRISHELL3.
Referenced by add_cube_convex_hull_to_mesh(), AllSecondOrderTest::allCompleteOrderMixedFixing3D(), AllSecondOrderTest::allSecondOrderMixedFixing3D(), Biharmonic::Biharmonic(), build_line(), ExtraIntegersTest::build_mesh(), build_point(), build_square(), CopyNodesAndElementsTest::collectMeshes(), main(), ParsedFEMFunctionTest::setUp(), PerElemTest< elem_type >::setUp(), RationalMapTest< elem_type >::setUp(), setup(), ParallelGhostSyncTest::setUp(), FETestBase< order, family, elem_type, 1 >::setUp(), SystemsTest::test3DProjectVectorFE(), DistortTest::test_helper_3D(), AllTriTest::test_helper_3D(), MeshFunctionTest::test_p_level(), VolumeTest::test_true_centroid_and_volume(), MeshStitchTest::testAmbiguousRemappingStitch(), SystemsTest::testAssemblyWithDgFemContext(), SystemsTest::testBlockRestrictedVarNDofs(), MeshStitchTest::testBoundaryInfo(), SystemsTest::testBoundaryProjectCube(), MeshGenerationTest::testBuildCube(), DefaultCouplingTest::testCoupling(), PointNeighborCouplingTest::testCoupling(), SystemsTest::testDofCouplingWithVarGroups(), DofMapTest::testDofOwner(), BoundaryInfoTest::testEdgeBoundaryConditions(), MeshInputTest::testExodusWriteElementDataFromDiscontinuousNodalData(), VolumeTest::testHex20PLevelTrueCentroid(), MeshTetTest::testHole(), InfFERadialTest::testInfQuants(), PointLocatorTest::testLocator(), MeshStitchTest::testMeshStitch(), MeshStitchTest::testMeshStitchElemsets(), PartitionerTest< PartitionerSubclass, MeshClass >::testPartition(), SystemsTest::testProjectCube(), SystemsTest::testProjectCubeWithMeshFunction(), SystemsTest::testProjectMatrix3D(), MeshStitchTest::testRemappingStitch(), SystemsTest::testSetSystemParameterOverEquationSystem(), InfFERadialTest::testSides(), InfFERadialTest::testSingleOrder(), VolumeTest::testTwistedVolume(), and WriteEdgesetData::testWriteImpl().
void libMesh::MeshTools::Generation::build_delaunay_square | ( | UnstructuredMesh & | mesh, |
const unsigned int | nx, | ||
const unsigned int | ny, | ||
const Real | xmin, | ||
const Real | xmax, | ||
const Real | ymin, | ||
const Real | ymax, | ||
const ElemType | type, | ||
const std::vector< TriangleInterface::Hole *> * | holes = nullptr |
||
) |
Meshes a rectangular (2D) region (with or without holes) with a Delaunay triangulation.
This function internally calls the triangle library written by J.R. Shewchuk.
Definition at line 2642 of file mesh_generation.C.
References libMesh::MeshBase::add_point(), libMesh::BoundaryInfo::add_side(), libMesh::TriangulatorInterface::attach_hole_list(), libMesh::MeshBase::clear(), libMesh::TriangulatorInterface::desired_area(), libMesh::TriangulatorInterface::elem_type(), libMesh::MeshBase::get_boundary_info(), mesh, libMesh::MeshBase::n_nodes(), libMesh::TriangulatorInterface::PSLG, libMesh::Real, libMesh::MeshBase::set_mesh_dimension(), libMesh::TOLERANCE, libMesh::TriangleInterface::triangulate(), and libMesh::TriangulatorInterface::triangulation_type().
void libMesh::MeshTools::Generation::build_extrusion | ( | UnstructuredMesh & | mesh, |
const MeshBase & | cross_section, | ||
const unsigned int | nz, | ||
RealVectorValue | extrusion_vector, | ||
QueryElemSubdomainIDBase * | elem_subdomain = nullptr |
||
) |
Meshes the tensor product of a 1D and a 1D-or-2D domain.
Definition at line 2269 of file mesh_generation.C.
References libMesh::MeshBase::add_elem(), libMesh::BoundaryInfo::add_node(), libMesh::MeshBase::add_node(), libMesh::BoundaryInfo::add_side(), libMesh::BoundaryInfo::boundary_ids(), libMesh::Node::build(), libMesh::Elem::build(), libMesh::ParallelObject::comm(), libMesh::MeshBase::delete_remote_elements(), libMesh::Elem::dim(), libMesh::EDGE2, libMesh::EDGE3, libMesh::MeshBase::get_boundary_info(), libMesh::BoundaryInfo::get_edgeset_name_map(), libMesh::BoundaryInfo::get_nodeset_name_map(), libMesh::BoundaryInfo::get_side_boundary_ids(), libMesh::BoundaryInfo::get_sideset_name_map(), libMesh::MeshTools::Generation::QueryElemSubdomainIDBase::get_subdomain_for_layer(), libMesh::HEX27, libMesh::HEX8, libMesh::MeshBase::is_serial(), libMesh::libmesh_assert(), TIMPI::Communicator::max(), mesh, libMesh::MeshBase::n_elem(), libMesh::MeshBase::n_nodes(), libMesh::MeshBase::node_ptr(), libMesh::MeshBase::parallel_max_unique_id(), libMesh::MeshBase::prepare_for_use(), libMesh::PRISM18, libMesh::PRISM21, libMesh::PRISM6, libMesh::QUAD4, libMesh::QUAD9, libMesh::MeshBase::query_node_ptr(), libMesh::remote_elem, libMesh::MeshBase::reserve_elem(), libMesh::MeshBase::reserve_nodes(), libMesh::SECOND, libMesh::BoundaryInfo::set_edgeset_name_map(), libMesh::BoundaryInfo::set_nodeset_name_map(), libMesh::BoundaryInfo::set_sideset_name_map(), top_id, libMesh::TRI3, libMesh::TRI6, and libMesh::TRI7.
Referenced by main(), and MeshExtruderTest::testExtruder().
void libMesh::MeshTools::Generation::build_line | ( | UnstructuredMesh & | mesh, |
const unsigned int | nx, | ||
const Real | xmin = 0. , |
||
const Real | xmax = 1. , |
||
const ElemType | type = INVALID_ELEM , |
||
const bool | gauss_lobatto_grid = false |
||
) |
A specialized build_cube()
for 1D meshes.
Boundary ids are set to be equal to the side indexing on a master edge
Definition at line 1673 of file mesh_generation.C.
References build_cube(), and mesh.
Referenced by Biharmonic::Biharmonic(), BoundaryMesh0DTest::build_mesh(), NodalNeighborsTest::do_test(), main(), DualShapeTest::setUp(), SystemsTest::simpleSetup(), SystemsTest::test100KVariables(), MeshSpatialDimensionTest::test1D(), ConstraintOperatorTest::test1DCoarseningNewNodes(), ConstraintOperatorTest::test1DCoarseningOperator(), MeshGenerationTest::testBuildLine(), ConnectedComponentsTest::testEdge(), VolumeTest::testEdge3Volume(), MeshSubdomainIDTest::testMultiple(), BoundaryInfoTest::testNameCopying(), EquationSystemsTest::testPostInitAddElem(), SystemsTest::testProjectLine(), SystemsTest::testProjectMatrix1D(), EquationSystemsTest::testReinitWithNodeElem(), DistributedMeshTest::testRemoteElemError(), and EquationSystemsTest::testSelectivePRefine().
void libMesh::MeshTools::Generation::build_point | ( | UnstructuredMesh & | mesh, |
const ElemType | type = INVALID_ELEM , |
||
const bool | gauss_lobatto_grid = false |
||
) |
A specialized build_cube()
for 0D meshes.
The resulting mesh is a single NodeElem suitable for ODE tests
Definition at line 1655 of file mesh_generation.C.
References build_cube(), and mesh.
Referenced by TimeSolverTestImplementation< NewmarkSolver >::run_test_with_exact_soln(), EquationSystemsTest::testInit(), EquationSystemsTest::testPostInitAddRealSystem(), and EquationSystemsTest::testPostInitAddSystem().
void libMesh::MeshTools::Generation::build_sphere | ( | UnstructuredMesh & | mesh, |
const Real | rad = 1 , |
||
const unsigned int | nr = 2 , |
||
const ElemType | type = INVALID_ELEM , |
||
const unsigned int | n_smooth = 2 , |
||
const bool | flat = true |
||
) |
Meshes a spherical or mapped-spherical domain.
Definition at line 1725 of file mesh_generation.C.
Referenced by main(), MeshGenerationTest::testBuildSphere(), InfFERadialTest::testInfQuants_numericDeriv(), MeshTetTest::testSphereShell(), and MeshTriangulationTest::testTriangulatorRoundHole().
void libMesh::MeshTools::Generation::build_square | ( | UnstructuredMesh & | mesh, |
const unsigned int | nx, | ||
const unsigned int | ny, | ||
const Real | xmin = 0. , |
||
const Real | xmax = 1. , |
||
const Real | ymin = 0. , |
||
const Real | ymax = 1. , |
||
const ElemType | type = INVALID_ELEM , |
||
const bool | gauss_lobatto_grid = false |
||
) |
A specialized build_cube()
for 2D meshes.
Boundary ids are set to be equal to the side indexing on a master quad
Definition at line 1694 of file mesh_generation.C.
References build_cube(), and mesh.
Referenced by AllSecondOrderTest::allCompleteOrder(), AllSecondOrderTest::allCompleteOrderDoNothing(), AllSecondOrderTest::allCompleteOrderMixed(), AllSecondOrderTest::allCompleteOrderMixedFixing(), AllSecondOrderTest::allCompleteOrderRange(), AllSecondOrderTest::allSecondOrder(), AllSecondOrderTest::allSecondOrderDoNothing(), AllSecondOrderTest::allSecondOrderMixed(), AllSecondOrderTest::allSecondOrderMixedFixing(), AllSecondOrderTest::allSecondOrderRange(), Biharmonic::Biharmonic(), BoundaryMeshTest::build_mesh(), main(), WriteVecAndScalar::setupTests(), MultiEvaluablePredTest::test(), MeshSpatialDimensionTest::test2D(), SystemsTest::test2DProjectVectorFE(), DistortTest::test_helper_2D(), AllTriTest::test_helper_2D(), MeshFunctionTest::test_subdomain_id_sets(), DofMapTest::testBadElemFECombo(), EquationSystemsTest::testBadVarNames(), BoundaryInfoTest::testBoundaryOnChildrenBoundaryIDs(), BoundaryInfoTest::testBoundaryOnChildrenBoundarySides(), BoundaryInfoTest::testBoundaryOnChildrenElementsRefineCoarsen(), BoundaryInfoTest::testBoundaryOnChildrenErrors(), MeshGenerationTest::testBuildSquare(), DofMapTest::testConstraintLoopDetection(), MeshAssignTest::testCopyConstruct(), MeshInputTest::testCopyElementSolutionImpl(), MeshInputTest::testCopyElementVectorImpl(), MeshInputTest::testCopyNodalSolutionImpl(), MeshDeletionsTest::testDeleteElem(), MeshInputTest::testExodusReadHeader(), MeshExtruderTest::testExtruder(), MixedOrderTest::testFindNeighbors(), MappedSubdomainPartitionerTest::testMappedSubdomainPartitioner(), BoundaryInfoTest::testMesh(), MeshBaseTest::testMeshBaseVerifyIsPrepared(), MeshAssignTest::testMeshMoveAssign(), MeshInputTest::testNemesisReadImpl(), PointLocatorTest::testPlanar(), SystemsTest::testProjectMatrix2D(), SystemsTest::testProjectSquare(), VolumeTest::testQuad4TrueCentroid(), EquationSystemsTest::testRefineThenReinitPreserveFlags(), BoundaryInfoTest::testRenumber(), EquationSystemsTest::testRepartitionThenReinit(), MeshInputTest::testSingleElementImpl(), MeshSmootherTest::testSmoother(), CheckpointIOTest::testSplitter(), MixedOrderTest::testStitch(), MeshTriangulationTest::testTriangulatorMeshedHoles(), SimplexRefinementTest::testTriRefinement(), MeshInputTest::testVTKPreserveElemIds(), MeshInputTest::testVTKPreserveSubdomainIds(), WriteNodesetData::testWriteImpl(), WriteSidesetData::testWriteImpl(), and WriteElemsetData::testWriteImpl().
void libMesh::MeshTools::Generation::surface_octahedron | ( | UnstructuredMesh & | mesh, |
Real | xmin, | ||
Real | xmax, | ||
Real | ymin, | ||
Real | ymax, | ||
Real | zmin, | ||
Real | zmax, | ||
bool | flip_tris = false |
||
) |
Meshes the surface of an octahedron with 8 Tri3 elements, with counter-clockwise (libMesh default) node ordering as viewed from the octahedron exterior if flip_tris
is false or from the interior otherwise.
Definition at line 2756 of file mesh_generation.C.
References libMesh::MeshBase::add_elem(), libMesh::MeshBase::add_point(), libMesh::Elem::build(), libMesh::MeshBase::get_boundary_info(), mesh, libMesh::MeshBase::node_ptr(), libMesh::MeshBase::prepare_for_use(), libMesh::Real, libMesh::Elem::set_node(), and libMesh::TRI3.
Referenced by SimplexRefinementTest::test3DTriRefinement().