Go to the documentation of this file.
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>
21 template <ElemType elem_type>
25 unsigned int _dim, _nx, _ny,
_nz;
37 const std::unique_ptr<Elem> test_elem =
Elem::build(elem_type);
38 _dim = test_elem->dim();
39 const unsigned int ny = _dim > 1;
40 const unsigned int nz = _dim > 2;
45 unsigned char weight_index = cast_int<unsigned char>
47 libmesh_assert_not_equal_to(weight_index, 0);
54 0., 1., 0., ny, 0., nz,
60 CPPUNIT_ASSERT_EQUAL(elem->mapping_data(), weight_index);
68 Real & x = (*node)(0);
69 Real & y = (*node)(1);
70 node->set_extra_datum<
Real>(weight_index, 1);
80 node->set_extra_datum<
Real>(weight_index,
sqrt(
Real(2))/2);
102 _elem = rng.begin() == rng.end() ? nullptr : *(rng.begin());
105 _ny = (_dim > 1) ? _nx : 0;
106 _nz = (_dim > 2) ? _nx : 0;
127 #ifdef LIBMESH_ENABLE_EXCEPTIONS
128 for (
unsigned int j=0; j != _ny+1; ++j)
129 for (
unsigned int k=0; k != _nz+1; ++k)
131 for (
int i=-1; i !=
int(_nx+2); ++i)
134 theta = (
Real(j)/_nx)*
pi/2,
136 Real x = -.5 + r * std::cos(theta),
137 y = r * std::sin(theta);
140 if (i >= 0 && i <=
int(_nx))
152 #define INSTANTIATE_RATIONALMAP_TEST(elemtype) \
153 class RationalMapTest_##elemtype : public RationalMapTest<elemtype> { \
155 CPPUNIT_TEST_SUITE( RationalMapTest_##elemtype ); \
156 CPPUNIT_TEST( testContainsPoint ); \
157 CPPUNIT_TEST_SUITE_END(); \
160 CPPUNIT_TEST_SUITE_REGISTRATION( RationalMapTest_##elemtype );
Manages consistently variables, degrees of freedom, and coefficient vectors.
The Mesh class is a thin wrapper, around the ReplicatedMesh class by default.
const std::vector< Point > & get_xyz() const
virtual System & add_system(const std::string &system_type, const std::string &name)
Add the system of type system_type named name to the systems array.
virtual SimpleRange< element_iterator > active_local_element_ptr_range() override
virtual bool contains_point(const Point &p, Real tol=TOLERANCE) const
const std::vector< std::vector< OutputShape > > & get_dphidx() const
INSTANTIATE_RATIONALMAP_TEST(EDGE3)
The libMesh namespace provides an interface to certain functionality in the library.
This class forms the foundation from which generic finite elements may be derived.
void set_default_mapping_data(const unsigned char data)
Set the default master space to physical space mapping basis functions to be used on newly added elem...
MetaPhysicL::DualNumber< T, D > sqrt(const MetaPhysicL::DualNumber< T, D > &in)
const std::vector< std::vector< OutputGradient > > & get_dphi() const
virtual SimpleRange< node_iterator > node_ptr_range() override
std::vector< dof_id_type > _dof_indices
static std::unique_ptr< FEGenericBase > build(const unsigned int dim, const FEType &type)
Builds a specific finite element type.
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
virtual void init()
Initialize all the systems.
A Point defines a location in LIBMESH_DIM dimensional Real space.
unsigned int add_node_integer(const std::string &name, bool allocate_data=true)
Register an integer datum (of type dof_id_type) to be added to each node in the mesh.
This is the EquationSystems class.
const FEType & variable_type(const unsigned int i) const
const std::vector< std::vector< OutputShape > > & get_dphidy() const
virtual SimpleRange< element_iterator > element_ptr_range() override
void set_default_mapping_type(const ElemMappingType type)
Set the default master space to physical space mapping basis functions to be used on newly added elem...
unsigned int add_node_datum(const std::string &name, bool allocate_data=true)
Register a datum (of type T) to be added to each node in the mesh.
This is the base class from which all geometric element types are derived.
const std::vector< std::vector< OutputShape > > & get_dphidz() const
const std::vector< std::vector< OutputShape > > & get_phi() const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static std::unique_ptr< Elem > build(const ElemType type, Elem *p=nullptr)
void ErrorVector unsigned int