81 const Real r2 = 0.5 * 0.5;
83 std::vector<const Elem *> selected_elems;
84 for (
const auto &e :
mesh.active_local_element_ptr_range())
86 const Point c = e->vertex_average();
87 if (c(0) * c(0) + c(1) * c(1) <= r2)
88 selected_elems.push_back(e);
96 std::vector<unsigned int> vars_to_project = {u_var};
97 sys.
project_solution(circle_projection_function,
nullptr, es.parameters, circle_range, vars_to_project);
102 const Real tol = 1e-3;
104 for (
const auto &e :
mesh.active_local_element_ptr_range())
106 const Point c = e->vertex_average();
107 const bool inside = (c(0) * c(0) + c(1) * c(1) <= r2);
109 std::vector<dof_id_type> u_indices, v_indices;
116 const Number val_baseline = baseline_linear_function(c, es.parameters,
"",
"");
117 const Number val_projected = circle_projection_function(c, es.parameters,
"",
"");
120 LIBMESH_ASSERT_NUMBERS_EQUAL(u_val, val_projected, tol);
123 LIBMESH_ASSERT_NUMBERS_EQUAL(u_val, val_baseline, tol);
126 LIBMESH_ASSERT_NUMBERS_EQUAL(v_val, val_baseline, tol);
This is the EquationSystems class.
The ReplicatedMesh class is derived from the MeshBase class, and is used to store identical copies of...
void dof_indices(const Elem *const elem, std::vector< dof_id_type > &di) const
libMesh::Parallel::Communicator * TestCommWorld
The StoredRange class defines a contiguous, divisible set of objects.
This class handles the numbering of degrees of freedom on a mesh.
Manages consistently variables, degrees of freedom, and coefficient vectors.
std::unique_ptr< NumericVector< Number > > solution
Data structure to hold solution values.
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.
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.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const DofMap & get_dof_map() const
A Point defines a location in LIBMESH_DIM dimensional Real space.