#include <fe_test.h>
template<Order order, FEFamily family, ElemType elem_type>
class FETest< order, family, elem_type >
Definition at line 120 of file fe_test.h.
◆ setUp()
template<Order order, FEFamily family, ElemType elem_type>
void FETest< order, family, elem_type >::setUp |
( |
| ) |
|
|
inline |
Definition at line 132 of file fe_test.h.
135 const std::unique_ptr<Elem> test_elem = Elem::build(elem_type);
136 _dim = test_elem->dim();
137 const unsigned int ny =
_dim > 1;
138 const unsigned int nz =
_dim > 2;
140 unsigned char weight_index = 0;
146 weight_index = cast_int<unsigned char>
148 libmesh_assert_not_equal_to(weight_index, 0);
158 0., 1., 0., ny, 0., nz,
166 const unsigned int nv = elem->n_vertices();
167 const unsigned int nn = elem->n_nodes();
170 const unsigned int n_edges =
171 (elem->type() ==
EDGE3) ? 1 : elem->n_edges();
172 const unsigned int n_faces =
173 (elem->type() ==
QUAD9) ? 1 : elem->n_faces();
174 const unsigned int nve = std::min(nv + n_edges, nn);
175 const unsigned int nvef = std::min(nve + n_faces, nn);
177 for (
unsigned int i = 0; i != nv; ++i)
178 elem->node_ref(i).set_extra_datum<
Real>(weight_index, 1.);
179 for (
unsigned int i = nv; i != nve; ++i)
180 elem->node_ref(i).set_extra_datum<
Real>(weight_index,
rational_w);
182 for (
unsigned int i = nve; i != nvef; ++i)
183 elem->node_ref(i).set_extra_datum<
Real>(weight_index, w2);
185 for (
unsigned int i = nvef; i != nn; ++i)
186 elem->node_ref(i).set_extra_datum<
Real>(weight_index, w3);
209 _fe = FEBase::build(
_dim, fe_type).release();
221 _elem = rng.begin() == rng.end() ? nullptr : *(rng.begin());
References libMesh::DistributedMesh::active_element_ptr_range(), libMesh::DistributedMesh::active_local_element_ptr_range(), libMesh::MeshBase::add_node_datum(), libMesh::MeshBase::add_node_integer(), libMesh::EquationSystems::add_system(), libMesh::System::add_variable(), libMesh::FEGenericBase< OutputType >::build(), libMesh::Elem::build(), libMesh::MeshTools::Generation::build_cube(), libMesh::CLOUGH, libMesh::DofMap::dof_indices(), libMesh::EDGE3, libMesh::System::get_dof_map(), libMesh::FEGenericBase< OutputType >::get_dphi(), libMesh::FEGenericBase< OutputType >::get_dphidx(), libMesh::FEGenericBase< OutputType >::get_dphidy(), libMesh::FEGenericBase< OutputType >::get_dphidz(), libMesh::FEGenericBase< OutputType >::get_phi(), libMesh::EquationSystems::init(), linear_test(), linear_test_grad(), libMesh::n_threads(), libMesh::EquationSystems::parameters, libMesh::System::project_solution(), libMesh::QUAD9, libMesh::RATIONAL_BERNSTEIN, rational_test(), rational_test_grad(), rational_w, libMesh::Real, libMesh::MeshBase::set_default_mapping_data(), TestCommWorld, and libMesh::System::variable_type().
◆ tearDown()
template<Order order, FEFamily family, ElemType elem_type>
void FETest< order, family, elem_type >::tearDown |
( |
| ) |
|
|
inline |
◆ testGradU()
template<Order order, FEFamily family, ElemType elem_type>
void FETest< order, family, elem_type >::testGradU |
( |
| ) |
|
|
inline |
Definition at line 291 of file fe_test.h.
308 #ifdef LIBMESH_ENABLE_EXCEPTIONS
309 for (
unsigned int i=0; i !=
_nx; ++i)
310 for (
unsigned int j=0; j !=
_ny; ++j)
311 for (
unsigned int k=0; k !=
_nz; ++k)
321 std::vector<Point> master_points
355 LIBMESH_ASSERT_FP_EQUAL(
libmesh_real(grad_u(2)), 0.0625,
References libMesh::CLOUGH, libMesh::Elem::contains_point(), libMesh::System::current_local_solution, libMesh::FEGenericBase< OutputType >::get_dphi(), libMesh::FEMap::inverse_map(), libMesh::libmesh_real(), libMesh::n_threads(), libMesh::RATIONAL_BERNSTEIN, rational_test_grad(), libMesh::Real, libMesh::FEAbstract::reinit(), std::sqrt(), and libMesh::TOLERANCE.
◆ testGradUComp()
template<Order order, FEFamily family, ElemType elem_type>
void FETest< order, family, elem_type >::testGradUComp |
( |
| ) |
|
|
inline |
Definition at line 362 of file fe_test.h.
379 #ifdef LIBMESH_ENABLE_EXCEPTIONS
380 for (
unsigned int i=0; i !=
_nx; ++i)
381 for (
unsigned int j=0; j !=
_ny; ++j)
382 for (
unsigned int k=0; k !=
_nz; ++k)
392 std::vector<Point> master_points
397 Number grad_u_x = 0, grad_u_y = 0, grad_u_z = 0;
References libMesh::CLOUGH, libMesh::Elem::contains_point(), libMesh::System::current_local_solution, libMesh::FEGenericBase< OutputType >::get_dphidx(), libMesh::FEGenericBase< OutputType >::get_dphidy(), libMesh::FEGenericBase< OutputType >::get_dphidz(), libMesh::FEMap::inverse_map(), libMesh::libmesh_real(), libMesh::n_threads(), libMesh::RATIONAL_BERNSTEIN, rational_test_grad(), libMesh::Real, libMesh::FEAbstract::reinit(), std::sqrt(), and libMesh::TOLERANCE.
◆ testU()
template<Order order, FEFamily family, ElemType elem_type>
void FETest< order, family, elem_type >::testU |
( |
| ) |
|
|
inline |
Definition at line 237 of file fe_test.h.
254 #ifdef LIBMESH_ENABLE_EXCEPTIONS
255 for (
unsigned int i=0; i !=
_nx; ++i)
256 for (
unsigned int j=0; j !=
_ny; ++j)
257 for (
unsigned int k=0; k !=
_nz; ++k)
268 std::vector<Point> master_points
278 LIBMESH_ASSERT_FP_EQUAL
283 LIBMESH_ASSERT_FP_EQUAL
References libMesh::CLOUGH, libMesh::Elem::contains_point(), libMesh::System::current_local_solution, libMesh::FEGenericBase< OutputType >::get_phi(), libMesh::FEMap::inverse_map(), libMesh::libmesh_real(), libMesh::n_threads(), libMesh::RATIONAL_BERNSTEIN, rational_test(), libMesh::Real, libMesh::FEAbstract::reinit(), and libMesh::TOLERANCE.
◆ _dim
template<Order order, FEFamily family, ElemType elem_type>
unsigned int FETest< order, family, elem_type >::_dim |
|
private |
◆ _dof_indices
template<Order order, FEFamily family, ElemType elem_type>
◆ _elem
template<Order order, FEFamily family, ElemType elem_type>
◆ _es
template<Order order, FEFamily family, ElemType elem_type>
◆ _fe
template<Order order, FEFamily family, ElemType elem_type>
◆ _mesh
template<Order order, FEFamily family, ElemType elem_type>
◆ _nx
template<Order order, FEFamily family, ElemType elem_type>
unsigned int FETest< order, family, elem_type >::_nx |
|
private |
◆ _ny
template<Order order, FEFamily family, ElemType elem_type>
unsigned int FETest< order, family, elem_type >::_ny |
|
private |
◆ _nz
template<Order order, FEFamily family, ElemType elem_type>
unsigned int FETest< order, family, elem_type >::_nz |
|
private |
◆ _sys
template<Order order, FEFamily family, ElemType elem_type>
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.
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
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.
virtual bool contains_point(const Point &p, Real tol=TOLERANCE) const
const std::vector< std::vector< OutputShape > > & get_dphidx() const
virtual SimpleRange< element_iterator > active_element_ptr_range() override
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)
static const Real TOLERANCE
const std::vector< std::vector< OutputGradient > > & get_dphi() const
Gradient rational_test_grad(const Point &p, const Parameters &, const std::string &, const std::string &)
static const Real rational_w
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.
std::unique_ptr< NumericVector< Number > > current_local_solution
All the values I need to compute my contribution to the simulation at hand.
libMesh::Parallel::Communicator * TestCommWorld
virtual void init()
Initialize all the systems.
A Point defines a location in LIBMESH_DIM dimensional Real space.
Number rational_test(const Point &p, const Parameters &, const std::string &, const std::string &)
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
class FEType hides (possibly multiple) FEFamily and approximation orders, thereby enabling specialize...
const std::vector< std::vector< OutputShape > > & get_dphidy() const
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.
Gradient linear_test_grad(const Point &, const Parameters &, const std::string &, const std::string &)
const std::vector< std::vector< OutputShape > > & get_dphidz() const
const DofMap & get_dof_map() const
const std::vector< std::vector< OutputShape > > & get_phi() const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual void reinit(const Elem *elem, const std::vector< Point > *const pts=nullptr, const std::vector< Real > *const weights=nullptr)=0
This is at the core of this class.
void project_solution(FunctionBase< Number > *f, FunctionBase< Gradient > *g=nullptr) const
Projects arbitrary functions onto the current solution.
std::vector< dof_id_type > _dof_indices
Number linear_test(const Point &p, const Parameters &, const std::string &, const std::string &)
This class provides the ability to map between arbitrary, user-defined strings and several data types...
Parameters parameters
Data structure holding arbitrary parameters.