20 #include "libmesh/libmesh_common.h" 21 #include "libmesh/error_estimator.h" 22 #include "libmesh/error_vector.h" 23 #include "libmesh/equation_systems.h" 24 #include "libmesh/parallel.h" 25 #include "libmesh/enum_error_estimator_type.h" 26 #include "libmesh/int_range.h" 42 comm.
sum(error_per_cell);
49 const std::map<const System *, SystemNorm> & error_norms,
51 bool estimate_parent_error)
60 if (error_norms.find(&sys) == error_norms.end())
63 this->
error_norm = error_norms.find(&sys)->second;
66 if (solution_vectors &&
67 solution_vectors->find(&sys) != solution_vectors->end())
68 solution_vector = solution_vectors->find(&sys)->second;
71 solution_vector, estimate_parent_error);
75 libmesh_assert_equal_to (error_per_cell.size(), system_error_per_cell.size());
77 error_per_cell[i] += system_error_per_cell[i];
80 error_per_cell = system_error_per_cell;
96 bool estimate_parent_error)
107 for (
unsigned int v = 0; v !=
n_vars; ++v)
110 if (!errors_per_cell.count(std::make_pair(&sys, v)))
114 std::vector<Real> weights(
n_vars, 0.0);
121 if (solution_vectors &&
122 solution_vectors->find(&sys) != solution_vectors->end())
123 solution_vector = solution_vectors->find(&sys)->second;
126 (sys, *errors_per_cell[std::make_pair(&sys, v)],
127 solution_vector, estimate_parent_error);
virtual void estimate_errors(const EquationSystems &equation_systems, ErrorVector &error_per_cell, const std::map< const System *, SystemNorm > &error_norms, const std::map< const System *, const NumericVector< Number > *> *solution_vectors=nullptr, bool estimate_parent_error=false)
This virtual function can be redefined in derived classes, but by default computes the sum of the err...
This is the EquationSystems class.
unsigned int n_systems() const
SystemNorm error_norm
When estimating the error in a single system, the error_norm is used to control the scaling and norm ...
The ErrorVector is a specialization of the StatisticsVector for error data computed on a finite eleme...
virtual void estimate_error(const System &system, ErrorVector &error_per_cell, const NumericVector< Number > *solution_vector=nullptr, bool estimate_parent_error=false)=0
This pure virtual function must be redefined in derived classes to compute the error for each active ...
This class defines a norm/seminorm to be applied to a NumericVector which contains coefficients in a ...
The libMesh namespace provides an interface to certain functionality in the library.
std::map< std::pair< const System *, unsigned int >, std::unique_ptr< ErrorVector > > ErrorMap
When calculating many error vectors at once, we need a data structure to hold them all...
const T_sys & get_system(std::string_view name) const
Manages consistently variables, degrees of freedom, and coefficient vectors.
FEMNormType type(unsigned int var) const
void reduce_error(std::vector< ErrorVectorReal > &error_per_cell, const Parallel::Communicator &comm) const
This method takes the local error contributions in error_per_cell from each processor and combines th...
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...
unsigned int n_vars() const
auto index_range(const T &sizable)
Helper function that returns an IntRange<std::size_t> representing all the indices of the passed-in v...