15#ifndef dealii_base_parsed_convergence_table_h
16#define dealii_base_parsed_convergence_table_h
169 const std::vector<std::set<VectorTools::NormType>> &list_of_error_norms = {
238 const std::vector<std::set<VectorTools::NormType>> &list_of_error_norms,
266 template <
int dim,
int spacedim,
typename VectorType>
269 const VectorType &solution,
276 template <
int dim,
int spacedim,
typename VectorType>
280 const VectorType &solution,
352 const std::function<
double()> &custom_function,
353 const bool compute_rate =
true);
358 template <
int dim,
int spacedim,
typename VectorType>
368 template <
int dim,
int spacedim,
typename VectorType>
418 std::map<std::string, std::pair<std::function<double()>,
bool>>
474template <
int dim,
int spacedim,
typename VectorType>
477 const VectorType &solution1,
478 const VectorType &solution2,
483 VectorType solution(solution1);
484 solution -= solution2;
494template <
int dim,
int spacedim,
typename VectorType>
498 const VectorType &solution1,
499 const VectorType &solution2,
505 solution -= solution2;
516template <
int dim,
int spacedim,
typename VectorType>
519 const VectorType &solution,
532template <
int dim,
int spacedim,
typename VectorType>
536 const VectorType &solution,
549 const unsigned int n_dofs = dh.
n_dofs();
554 table.add_value(
"cells", n_active_cells);
555 table.set_tex_caption(
"cells",
"\\# cells");
556 table.set_tex_format(
"cells",
"r");
558 else if (col ==
"dofs")
560 table.add_value(
"dofs", n_dofs);
561 table.set_tex_caption(
"dofs",
"\\# dofs");
562 table.set_tex_format(
"dofs",
"r");
566 const std::vector<std::function<double(
const Point<spacedim> &)>>
567 zero_components(n_components,
568 [](
const Point<spacedim> &) {
return 0.0; });
571 std::vector<std::function<double(
const Point<spacedim> &)>>
572 weight_components(n_components,
573 [](
const Point<spacedim> &) {
return 1.0; });
575 if (weight !=
nullptr)
579 for (
auto &f : weight_components)
580 f = [&](
const Point<spacedim> &p) {
return weight->
value(p); };
585 for (
unsigned int i = 0; i < n_components; ++i)
586 weight_components[i] = [&](
const Point<spacedim> &p) {
587 return weight->
value(p, i);
594 std::map<VectorTools::NormType, double> errors;
603 auto components_expr = zero_components;
604 for (
unsigned int j = 0; j < n_components; ++j)
606 components_expr[j] = weight_components[j];
608 FunctionFromFunctionObjects<spacedim> select_component(
611 Vector<float> difference_per_cell(
616 for (
const auto &norm : norms)
618 difference_per_cell = 0;
639 table.add_value(name, errors[norm]);
641 table.set_scientific(name,
true);
642 table.set_tex_caption(name, latex_name);
648 const double custom_error = extra_col.second.first();
650 std::string name = extra_col.first;
651 table.add_value(name, custom_error);
653 table.set_scientific(name,
true);
const FiniteElement< dim, spacedim > & get_fe(const types::fe_index index=0) const
const Triangulation< dim, spacedim > & get_triangulation() const
types::global_dof_index n_dofs() const
const unsigned int degree
unsigned int n_components() const
const unsigned int n_components
virtual RangeNumberType value(const Point< dim > &p, const unsigned int component=0) const
Abstract base class for mapping classes.
void add_extra_column(const std::string &column_name, const std::function< double()> &custom_function, const bool compute_rate=true)
void difference(const Mapping< dim, spacedim > &mapping, const DoFHandler< dim, spacedim > &, const VectorType &, const VectorType &, const Function< spacedim > *weight=nullptr)
void difference(const DoFHandler< dim, spacedim > &, const VectorType &, const VectorType &, const Function< spacedim > *weight=nullptr)
void add_parameters(ParameterHandler &prm)
void error_from_exact(const Mapping< dim, spacedim > &mapping, const DoFHandler< dim, spacedim > &vspace, const VectorType &solution, const Function< spacedim > &exact, const Function< spacedim > *weight=nullptr)
void error_from_exact(const DoFHandler< dim, spacedim > &vspace, const VectorType &solution, const Function< spacedim > &exact, const Function< spacedim > *weight=nullptr)
std::string error_file_name
void prepare_table_for_output()
const std::vector< std::string > component_names
std::set< std::string > extra_columns
ParsedConvergenceTable(const std::vector< std::string > &component_names={"u"}, const std::vector< std::set< VectorTools::NormType > > &list_of_error_norms={ {VectorTools::H1_norm, VectorTools::L2_norm, VectorTools::Linfty_norm}})
const std::vector< std::string > unique_component_names
std::vector< std::set< VectorTools::NormType > > norms_per_unique_component
const std::vector< ComponentMask > unique_component_masks
std::map< std::string, std::pair< std::function< double()>, bool > > extra_column_functions
virtual types::global_cell_index n_global_active_cells() const
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define AssertDimension(dim1, dim2)
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
#define AssertThrow(cond, exc)
const Mapping< dim, spacedim > & get_default_linear_mapping(const Triangulation< dim, spacedim > &triangulation)
MappingQ< dim, spacedim > StaticMappingQ1< dim, spacedim >::mapping
Tpetra::Vector< Number, LO, GO, NodeType< MemorySpace > > VectorType
double norm(const FEValuesBase< dim > &fe, const ArrayView< const std::vector< Tensor< 1, dim > > > &Du)
unsigned int n_active_cells(const internal::TriangulationImplementation::NumberCache< 1 > &c)
unsigned int global_cell_index