3#include <libmesh/dof_map.h>
4#include <libmesh/elem.h>
5#include <libmesh/equation_systems.h>
6#include <libmesh/fe_base.h>
7#include <libmesh/fe_interface.h>
8#include <libmesh/mesh.h>
9#include <libmesh/mesh_generation.h>
10#include <libmesh/numeric_vector.h>
11#include <libmesh/system.h>
21template <ElemType elem_type>
29 std::unique_ptr<EquationSystems>
_es;
30 std::unique_ptr<FEBase>
_fe;
39 const std::unique_ptr<Elem> test_elem =
Elem::build(elem_type);
40 _dim = test_elem->dim();
41 const unsigned int ny =
_dim > 1;
42 const unsigned int nz =
_dim > 2;
45 _mesh->add_node_integer(
"buffer integer1");
46 _mesh->add_node_integer(
"buffer integer2");
50 const Real default_weight = 1.0;
51 unsigned char weight_index = cast_int<unsigned char>
52 (
_mesh->add_node_datum<
Real>(
"rational_weight",
true,
55 libmesh_assert_not_equal_to(weight_index, 0);
58 _mesh->set_default_mapping_data(weight_index);
62 0., 1., 0., ny, 0., nz,
65 for (
auto elem :
_mesh->element_ptr_range())
68 CPPUNIT_ASSERT_EQUAL(elem->mapping_data(), weight_index);
74 for (
auto node :
_mesh->node_ptr_range())
79 Real & x = (*node)(0);
80 Real & y = (*node)(1);
95 _es = std::make_unique<EquationSystems>(*
_mesh);
112 auto rng =
_mesh->active_local_element_ptr_range();
113 _elem = rng.begin() == rng.end() ? nullptr : *(rng.begin());
135#ifdef LIBMESH_ENABLE_EXCEPTIONS
136 for (
unsigned int j=0; j !=
_ny+1; ++j)
137 for (
unsigned int k=0; k !=
_nz+1; ++k)
139 for (
int i=-1; i !=
int(
_nx+2); ++i)
144 Real x = -.5 + r * std::cos(theta),
145 y = r * std::sin(theta);
148 if (i >= 0 && i <=
int(
_nx))
160#define INSTANTIATE_RATIONALMAP_TEST(elemtype) \
161 class RationalMapTest_##elemtype : public RationalMapTest<elemtype> { \
163 RationalMapTest_##elemtype() : \
164 RationalMapTest<elemtype>() { \
165 if (unitlog->summarized_logs_enabled()) \
166 this->libmesh_suite_name = "RationalMapTest"; \
168 this->libmesh_suite_name = "RationalMapTest_" #elemtype; \
170 CPPUNIT_TEST_SUITE( RationalMapTest_##elemtype ); \
171 CPPUNIT_TEST( testContainsPoint ); \
172 CPPUNIT_TEST_SUITE_END(); \
175 CPPUNIT_TEST_SUITE_REGISTRATION( RationalMapTest_##elemtype );
void ErrorVector unsigned int
std::unique_ptr< Mesh > _mesh
std::unique_ptr< EquationSystems > _es
std::string libmesh_suite_name
std::vector< dof_id_type > _dof_indices
std::unique_ptr< FEBase > _fe
void set_extra_datum(const unsigned int index, const T value)
Sets the value on this object of the extra datum associated with index, which should have been obtain...
This is the base class from which all geometric element types are derived.
static std::unique_ptr< Elem > build(const ElemType type, Elem *p=nullptr)
virtual bool contains_point(const Point &p, Real tol=TOLERANCE) const
static std::unique_ptr< FEGenericBase > build(const unsigned int dim, const FEType &type)
Builds a specific finite element type.
A Node is like a Point, but with more information.
A Point defines a location in LIBMESH_DIM dimensional Real space.
Manages consistently variables, degrees of freedom, and coefficient vectors.
const FEType & variable_type(const unsigned int i) const
unsigned int add_variable(std::string_view 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.
Communicator * TestCommWorld
INSTANTIATE_RATIONALMAP_TEST(EDGE3)
The libMesh namespace provides an interface to certain functionality in the library.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real