10#include <libmesh/dof_map.h>
11#include <libmesh/elem.h>
12#include <libmesh/enum_fe_family.h>
13#include <libmesh/enum_order.h>
14#include <libmesh/equation_systems.h>
15#include <libmesh/fe_type.h>
16#include <libmesh/int_range.h>
17#include <libmesh/mesh.h>
18#include <libmesh/mesh_generation.h>
19#include <libmesh/mesh_refinement.h>
20#include <libmesh/system.h>
21#include <libmesh/utility.h>
38template <
unsigned int D>
44 return Utility::pow<D>(1. + p(0) + 2.*p(1) + 3.*p(2));
49#ifdef LIBMESH_ENABLE_AMR
51template <ElemType elem_type, Order order, FEFamily family>
77 MeshTools::Generation::build_cube(*
_mesh, 2, 2, 2, 0., 1., 0., 1., 0., 1., base);
79 if (base != elem_type)
80 _mesh->all_second_order();
86 for (
auto * elem :
_mesh->active_element_ptr_range())
87 if (elem->id() % 4 == 0)
110 unsigned int n_checked = 0;
116 const Point q(a/8., (
dim > 1) ?
b/8. : 0., (
dim > 2) ? (a +
b)/16. : 0.);
119 amr_test_poly<static_cast<unsigned int>(order)>(q, dummy,
"",
"");
126 CPPUNIT_ASSERT(n_checked > 0);
130#define INSTANTIATE_FEAMRCONSTRAINTTEST(elemtype, order, family) \
131 class FEAMRConstraintTest_##family##_##order##_##elemtype : \
132 public FEAMRConstraintTest<elemtype, order, family> { \
134 FEAMRConstraintTest_##family##_##order##_##elemtype() : \
135 FEAMRConstraintTest<elemtype, order, family>() { \
136 if (unitlog->summarized_logs_enabled()) \
137 this->libmesh_suite_name = "FEAMRConstraintTest"; \
139 this->libmesh_suite_name = \
140 "FEAMRConstraintTest_" #family "_" #order "_" #elemtype; \
142 CPPUNIT_TEST_SUITE( FEAMRConstraintTest_##family##_##order##_##elemtype ); \
143 CPPUNIT_TEST( testConstrainedSpaceHoldsPolynomials ); \
144 CPPUNIT_TEST_SUITE_END(); \
147 CPPUNIT_TEST_SUITE_REGISTRATION( FEAMRConstraintTest_##family##_##order##_##elemtype )
std::string libmesh_suite_name
std::unique_ptr< Mesh > _mesh
void testConstrainedSpaceHoldsPolynomials()
static const unsigned int type_to_dim_map[INVALID_ELEM]
This array maps the integer representation of the ElemType enum to the geometric dimension of the ele...
This is the EquationSystems class.
Parameters parameters
Data structure holding arbitrary parameters.
virtual void init()
Initialize all the systems.
virtual System & add_system(std::string_view system_type, std::string_view name)
Add the system of type system_type named name to the systems array.
class FEType hides (possibly multiple) FEFamily and approximation orders, thereby enabling specialize...
Implements (adaptive) mesh refinement algorithms for a MeshBase.
bool refine_and_coarsen_elements()
Refines and coarsens user-requested elements.
This class provides the ability to map between arbitrary, user-defined strings and several data types...
A Point defines a location in LIBMESH_DIM dimensional Real space.
Manages consistently variables, degrees of freedom, and coefficient vectors.
void project_solution(FunctionBase< Number > *f, FunctionBase< Gradient > *g=nullptr, std::optional< ConstElemRange > active_local_range=std::nullopt, std::optional< std::vector< unsigned int > > variable_numbers=std::nullopt) const
Projects arbitrary functions onto the current solution.
Number point_value(unsigned int var, const Point &p, const bool insist_on_success=true, const NumericVector< Number > *sol=nullptr) 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_FEAMRCONSTRAINTTEST(QUAD9, SECOND, LAGRANGE)
The libMesh namespace provides an interface to certain functionality in the library.
ElemType
Defines an enum for geometric element types.
static constexpr Real TOLERANCE
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...