Definition at line 31 of file mesh_input.C.
◆ CPPUNIT_TEST() [1/5]
◆ CPPUNIT_TEST() [2/5]
◆ CPPUNIT_TEST() [3/5]
◆ CPPUNIT_TEST() [4/5]
◆ CPPUNIT_TEST() [5/5]
◆ CPPUNIT_TEST_SUITE()
◆ CPPUNIT_TEST_SUITE_END()
MeshInputTest::CPPUNIT_TEST_SUITE_END |
( |
| ) |
|
◆ setUp()
void MeshInputTest::setUp |
( |
| ) |
|
|
inline |
◆ tearDown()
void MeshInputTest::tearDown |
( |
| ) |
|
|
inline |
◆ testDynaReadElem()
void MeshInputTest::testDynaReadElem |
( |
| ) |
|
|
inline |
Definition at line 214 of file mesh_input.C.
225 dyna.read(
"1_quad.dyn");
245 CPPUNIT_ASSERT_EQUAL(elem->type(),
QUAD9);
246 for (
unsigned int n=0; n != 9; ++n)
248 (elem->node_ref(n).get_extra_datum<
Real>(weight_index),
251 CPPUNIT_ASSERT_EQUAL(elem->point(0)(0),
Real(0.5));
252 CPPUNIT_ASSERT_EQUAL(elem->point(0)(1),
Real(0.5));
253 CPPUNIT_ASSERT_EQUAL(elem->point(1)(0),
Real(1.5));
254 CPPUNIT_ASSERT_EQUAL(elem->point(1)(1),
Real(0.5));
255 CPPUNIT_ASSERT_EQUAL(elem->point(2)(0),
Real(1.5));
256 CPPUNIT_ASSERT_EQUAL(elem->point(2)(1),
Real(1.5));
257 CPPUNIT_ASSERT_EQUAL(elem->point(3)(0),
Real(0.5));
258 CPPUNIT_ASSERT_EQUAL(elem->point(3)(1),
Real(1.5));
259 CPPUNIT_ASSERT(elem->has_affine_map());
261 for (
unsigned int v=0; v != 4; ++v)
262 CPPUNIT_ASSERT_EQUAL(elem->point(v)(2),
Real(0));
References libMesh::MeshBase::allow_remote_element_removal(), libMesh::MeshBase::allow_renumbering(), libMesh::MeshCommunication::broadcast(), libMesh::MeshBase::default_mapping_data(), libMesh::MeshBase::default_mapping_type(), libMesh::MeshBase::element_ptr_range(), mesh, libMesh::MeshBase::n_elem(), libMesh::MeshBase::n_nodes(), libMesh::NODEELEM, libMesh::MeshBase::prepare_for_use(), libMesh::ParallelObject::processor_id(), libMesh::QUAD9, libMesh::RATIONAL_BERNSTEIN_MAP, libMesh::DynaIO::read(), libMesh::Real, and TestCommWorld.
◆ testDynaReadPatch()
void MeshInputTest::testDynaReadPatch |
( |
| ) |
|
|
inline |
Definition at line 268 of file mesh_input.C.
278 dyna.read(
"25_quad.bxt");
299 for (
unsigned int n=0; n != 9; ++n)
301 (elem->node_ref(n).get_extra_datum<
Real>(weight_index),
304 unsigned int n_neighbors = 0, n_neighbors_expected = 2;
305 for (
unsigned int side=0; side != 4; ++side)
306 if (elem->neighbor_ptr(side))
308 Point c = elem->centroid();
310 if (c(0) > 0.2 && c(0) < 0.8)
311 n_neighbors_expected++;
312 if (c(1) > 0.2 && c(1) < 0.8)
313 n_neighbors_expected++;
315 CPPUNIT_ASSERT_EQUAL(n_neighbors, n_neighbors_expected);
318 #ifdef LIBMESH_ENABLE_CONSTRAINTS
324 dyna.add_spline_constraints(sys.
get_dof_map(), 0, 0);
328 #endif // LIBMESH_ENABLE_CONSTRAINTS
References libMesh::MeshBase::active_element_ptr_range(), libMesh::DynaIO::add_spline_constraints(), libMesh::EquationSystems::add_system(), libMesh::System::add_variable(), libMesh::MeshBase::allow_remote_element_removal(), libMesh::MeshBase::allow_renumbering(), libMesh::MeshCommunication::broadcast(), libMesh::MeshBase::default_mapping_data(), libMesh::MeshBase::default_mapping_type(), libMesh::System::get_dof_map(), libMesh::EquationSystems::init(), libMesh::libmesh_real(), mesh, libMesh::DofMap::n_constrained_dofs(), libMesh::MeshBase::n_elem(), libMesh::MeshBase::n_nodes(), libMesh::NODEELEM, libMesh::MeshBase::prepare_for_use(), libMesh::ParallelObject::processor_id(), libMesh::RATIONAL_BERNSTEIN_MAP, libMesh::DynaIO::read(), libMesh::Real, libMesh::SECOND, TestCommWorld, and libMesh::TOLERANCE.
◆ testExodusCopyElementSolution()
void MeshInputTest::testExodusCopyElementSolution |
( |
| ) |
|
|
inline |
Definition at line 61 of file mesh_input.C.
80 std::set<std::string> sys_list;
81 exii.write_equation_systems(
"mesh_with_soln.e", es, &sys_list);
84 exii.write_element_data(es);
98 exii.read(
"mesh_with_soln.e");
108 #ifdef LIBMESH_USE_COMPLEX_NUMBERS
109 exii.copy_elemental_solution(sys,
"teste",
"r_e");
111 exii.copy_elemental_solution(sys,
"teste",
"e");
References libMesh::EquationSystems::add_system(), libMesh::System::add_variable(), libMesh::MeshCommunication::broadcast(), libMesh::MeshTools::Generation::build_square(), libMesh::CONSTANT, libMesh::ExodusII_IO::copy_elemental_solution(), libMesh::EquationSystems::init(), libMesh::libmesh_real(), mesh, libMesh::MONOMIAL, libMesh::EquationSystems::parameters, libMesh::System::point_value(), libMesh::MeshBase::prepare_for_use(), libMesh::ParallelObject::processor_id(), libMesh::System::project_solution(), libMesh::ExodusII_IO::read(), libMesh::Real, TestCommWorld, libMesh::TOLERANCE, libMesh::ExodusII_IO::write_element_data(), libMesh::MeshOutput< MT >::write_equation_systems(), and x_plus_y().
◆ testExodusWriteElementDataFromDiscontinuousNodalData()
void MeshInputTest::testExodusWriteElementDataFromDiscontinuousNodalData |
( |
| ) |
|
|
inline |
Definition at line 130 of file mesh_input.C.
141 (
mesh, 2, 2, 2, 0., 1., 0., 1., 0., 1.,
HEX8);
147 std::vector<dof_id_type> dof_indices;
151 for (
unsigned int i=0; i<dof_indices.size(); ++i)
152 sys.
solution->set(dof_indices[i], i);
160 std::set<std::string> sys_list;
161 exii.write_equation_systems(
"elemental_from_nodal.e", es, &sys_list);
164 sys_list = {
"SimpleSystem"};
166 exii.write_element_data_from_discontinuous_nodal_data
167 (es, &sys_list,
"_elem_corner_");
172 std::vector<std::string> file_var_names =
177 std::vector<Real> expected_values = {0., 1., 2., 3.};
190 exii.read(
"elemental_from_nodal.e");
197 exii.copy_elemental_solution
205 LIBMESH_ASSERT_FP_EQUAL
References libMesh::MeshBase::active_element_ptr_range(), libMesh::EquationSystems::add_system(), libMesh::System::add_variable(), libMesh::MeshCommunication::broadcast(), libMesh::MeshTools::Generation::build_cube(), libMesh::CONSTANT, libMesh::ExodusII_IO::copy_elemental_solution(), libMesh::DofMap::dof_indices(), libMesh::MeshBase::element_ptr_range(), libMesh::FIRST, libMesh::System::get_dof_map(), libMesh::HEX8, libMesh::index_range(), libMesh::EquationSystems::init(), libMesh::L2_LAGRANGE, mesh, libMesh::MONOMIAL, libMesh::System::point_value(), libMesh::MeshBase::prepare_for_use(), libMesh::ParallelObject::processor_id(), libMesh::ExodusII_IO::read(), libMesh::Real, libMesh::System::solution, TestCommWorld, libMesh::TOLERANCE, libMesh::System::variable_name(), libMesh::ExodusII_IO::write_element_data_from_discontinuous_nodal_data(), and libMesh::MeshOutput< MT >::write_equation_systems().
◆ testMeshMoveConstructor()
void MeshInputTest::testMeshMoveConstructor |
( |
| ) |
|
|
inline |
The documentation for this class was generated from the following file:
Manages consistently variables, degrees of freedom, and coefficient vectors.
The Mesh class is a thin wrapper, around the ReplicatedMesh class by default.
ElemMappingType default_mapping_type() const
Returns the default master space to physical space mapping basis functions to be used on newly added ...
Manages consistently variables, degrees of freedom, coefficient vectors, and matrices for implicit sy...
void dof_indices(const Elem *const elem, std::vector< dof_id_type > &di) const
Fills the vector di with the global degree of freedom indices for the element.
dof_id_type n_constrained_dofs() const
virtual SimpleRange< element_iterator > active_element_ptr_range()=0
virtual dof_id_type n_elem() const =0
const std::string & variable_name(const unsigned int i) const
IntRange< std::size_t > index_range(const std::vector< T > &vec)
Helper function that returns an IntRange<std::size_t> representing all the indices of the passed-in v...
static const Real TOLERANCE
The ExodusII_IO class implements reading meshes in the ExodusII file format from Sandia National Labs...
The ReplicatedMesh class is derived from the MeshBase class, and is used to store identical copies of...
virtual SimpleRange< element_iterator > element_ptr_range()=0
void broadcast(MeshBase &) const
processor_id_type processor_id() const
unsigned int add_variable(const std::string &var, const FEType &type, const std::set< subdomain_id_type > *const active_subdomains=nullptr)
Adds the variable var to the list of variables for this system.
libMesh::Parallel::Communicator * TestCommWorld
A Point defines a location in LIBMESH_DIM dimensional Real space.
Reading and writing meshes in (a subset of) LS-DYNA format.
This is the EquationSystems class.
virtual dof_id_type n_nodes() const =0
std::unique_ptr< BoundaryInfo > boundary_info
This class holds the boundary information.
std::unique_ptr< NumericVector< Number > > solution
Data structure to hold solution values.
Number point_value(unsigned int var, const Point &p, const bool insist_on_success=true, const NumericVector< Number > *sol=nullptr) const
This class handles the numbering of degrees of freedom on a mesh.
void allow_remote_element_removal(bool allow)
If false is passed in then this mesh will no longer have remote elements deleted when being prepared ...
const DofMap & get_dof_map() const
unsigned char default_mapping_data() const
Returns any default data value used by the master space to physical space mapping.
void allow_renumbering(bool allow)
If false is passed in then this mesh will no longer be renumbered when being prepared for use.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void prepare_for_use(const bool skip_renumber_nodes_and_elements=false, const bool skip_find_neighbors=false)
Prepare a newly ecreated (or read) mesh for use.
This is the MeshCommunication class.
void project_solution(FunctionBase< Number > *f, FunctionBase< Gradient > *g=nullptr) const
Projects arbitrary functions onto the current solution.
virtual std::unique_ptr< Partitioner > & partitioner()
A partitioner to use at each prepare_for_use()