Go to the documentation of this file.
2 #include "libmesh/equation_systems.h"
3 #include "libmesh/exodusII_io.h"
4 #include "libmesh/replicated_mesh.h"
5 #include "libmesh/mesh_generation.h"
6 #include "libmesh/parallel.h"
7 #include "libmesh/string_to_enum.h"
8 #include "libmesh/boundary_info.h"
26 CPPUNIT_TEST(testWrite);
29 CPPUNIT_TEST_SUITE_END();
46 std::vector<BoundaryInfo::BCTuple> bc_tuples =
49 for (
const auto & t : bc_tuples)
58 for (
unsigned short edge=0; edge<4; ++edge)
62 for (
unsigned short edge=8; edge<12; ++edge)
70 #ifdef LIBMESH_HAVE_EXODUS_API
75 writer.
write(
"write_edgeset_data.e");
84 reader.
read(
"write_edgeset_data.e");
88 CPPUNIT_ASSERT(read_bi.
edgeset_name(0) ==
"back_edgeset");
89 CPPUNIT_ASSERT(read_bi.
edgeset_name(5) ==
"front_edgeset");
94 std::map<boundary_id_type, unsigned int> counts;
96 for (
const auto & t : edge_tuples)
97 counts[std::get<2>(t)]++;
98 CPPUNIT_ASSERT(counts[0] == 100);
99 CPPUNIT_ASSERT(counts[5] == 100);
101 #endif // #ifdef LIBMESH_HAVE_EXODUS_API
The BoundaryInfo class contains information relevant to boundary conditions including storing faces,...
const BoundaryInfo & get_boundary_info() const
The information about boundary ids on the mesh.
The libMesh namespace provides an interface to certain functionality in the library.
std::size_t n_edge_conds() const
The ExodusII_IO class implements reading meshes in the ExodusII file format from Sandia National Labs...
std::string & edgeset_name(boundary_id_type id)
void build_side_list(std::vector< dof_id_type > &element_id_list, std::vector< unsigned short int > &side_list, std::vector< boundary_id_type > &bc_id_list) const
Creates a list of element numbers, sides, and ids for those sides.
The ReplicatedMesh class is derived from the MeshBase class, and is used to store identical copies of...
CPPUNIT_TEST_SUITE_REGISTRATION(WriteEdgesetData)
void build_edge_list(std::vector< dof_id_type > &element_id_list, std::vector< unsigned short int > &edge_list, std::vector< boundary_id_type > &bc_id_list) const
Creates a list of element numbers, edges, and boundary ids for those edges.
libMesh::Parallel::Communicator * TestCommWorld
void add_edge(const dof_id_type elem, const unsigned short int edge, const boundary_id_type id)
Add edge edge of element number elem with boundary id id to the boundary information data structure.
const std::set< boundary_id_type > & get_edge_boundary_ids() const
virtual void write(const std::string &fname) override
This method implements writing a mesh to a specified file.
virtual void read(const std::string &name) override
This method implements reading a mesh from a specified file.