48 LOG_SCOPE (
"minimum()",
"ErrorVector");
50 const dof_id_type n = cast_int<dof_id_type>(this->size());
56 libmesh_assert_greater_equal ((*
this)[i], 0.);
62 libmesh_assert_greater_equal (
min, 0.);
71 LOG_SCOPE (
"mean()",
"ErrorVector");
73 const dof_id_type n = cast_int<dof_id_type>(this->size());
81 the_mean += (
static_cast<Real>((*this)[i]) - the_mean ) / (nnz + 1);
94 const dof_id_type n = cast_int<dof_id_type>(this->size());
108 sv.push_back((*
this)[i]);
128 const dof_id_type n = cast_int<dof_id_type>(this->size());
130 LOG_SCOPE (
"variance()",
"ErrorVector");
132 Real the_variance = 0;
138 const Real delta = (
static_cast<Real>((*this)[i]) - mean_in );
139 the_variance += (delta * delta - the_variance) / (nnz + 1);
152 LOG_SCOPE (
"cut_below()",
"ErrorVector");
154 const dof_id_type n = cast_int<dof_id_type>(this->size());
156 std::vector<dof_id_type> cut_indices;
157 cut_indices.reserve(n/2);
162 if ((*
this)[i] < cut)
164 cut_indices.push_back(i);
176 LOG_SCOPE (
"cut_above()",
"ErrorVector");
178 const dof_id_type n = cast_int<dof_id_type>(this->size());
180 std::vector<dof_id_type> cut_indices;
181 cut_indices.reserve(n/2);
186 if ((*
this)[i] > cut)
188 cut_indices.push_back(i);
199 libmesh_assert_less (i, this->size());
206 return ((*
this)[i] != 0.);
213 std::unique_ptr<MeshBase> meshptr = oldmesh.
clone();
218 mesh.allow_renumbering(
false);
219 mesh.all_first_order();
221 #ifdef LIBMESH_ENABLE_AMR 224 for (
auto & elem :
mesh.element_ptr_range())
227 elem->set_p_level(0);
229 #endif // LIBMESH_ENABLE_AMR 238 std::vector<dof_id_type> dof_indices;
240 for (
const auto & elem :
mesh.active_local_element_ptr_range())
250 libmesh_assert_less (elem_id, (*this).size());
254 error_system.
solution->set(solution_index, (*
this)[elem_id]);
262 if (
mesh.max_elem_id() !=
mesh.n_elem() ||
263 mesh.max_node_id() !=
mesh.n_nodes())
265 mesh.allow_renumbering(
true);
266 mesh.renumber_nodes_and_elements();
269 if (filename.rfind(
".gmv") < filename.size())
274 else if (filename.rfind(
".plt") < filename.size())
279 #if defined(LIBMESH_HAVE_EXODUS_API) && defined(LIBMESH_HAVE_NEMESIS_API) 280 else if ((filename.rfind(
".nem") < filename.size()) ||
281 (filename.rfind(
".n") < filename.size()))
288 #ifdef LIBMESH_HAVE_EXODUS_API 289 else if ((filename.rfind(
".exo") < filename.size()) ||
290 (filename.rfind(
".e") < filename.size()))
297 else if (filename.rfind(
".xda") < filename.size())
304 else if (filename.rfind(
".xdr") < filename.size())
314 libMesh::err <<
"Warning: ErrorVector::plot_error currently only" 315 <<
" supports .gmv, .plt, .xdr/.xda, and .exo/.e (if enabled) output;" << std::endl;
316 libMesh::err <<
"Could not recognize filename: " << filename
Manages multiples systems of equations.
virtual void write_equation_systems(const std::string &, const EquationSystems &, const std::set< std::string > *system_names=nullptr)
void dof_indices(const Elem *const elem, std::vector< dof_id_type > &di) const
Handles reading and writing of Exodus binary files.
virtual Real variance() const override
long double max(long double a, double b)
virtual std::unique_ptr< MeshBase > clone() const =0
DIE A HORRIBLE DEATH HERE typedef float ErrorVectorReal
virtual std::vector< dof_id_type > cut_above(Real cut) const override
Manages the degrees of freedom (DOFs) in a simulation.
void write(const std::string &name, const XdrMODE, const unsigned int write_flags=(WRITE_DATA), bool partition_agnostic=true) const
virtual Real median() override
virtual void write(const std::string &) override
void write_element_data(const EquationSystems &es)
std::unique_ptr< NumericVector< Number > > solution
virtual System & add_system(const std::string &system_type, const std::string &name)
OStreamProxy err(std::cerr)
void plot_error(const std::string &filename, const MeshBase &mesh) const
virtual std::vector< dof_id_type > cut_below(Real cut) const override
virtual ErrorVectorReal minimum() const override
virtual const Elem * elem_ptr(const dof_id_type i) const =0
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual void write(const std::string &fname) override
void write_element_data(const EquationSystems &es)
virtual void write(const std::string &base_filename) override
bool is_active_elem(dof_id_type i) const
unsigned int add_variable(const std::string &var, const FEType &type, const std::set< subdomain_id_type > *const active_subdomains=nullptr)
const DofMap & get_dof_map() const
long double min(long double a, double b)
void write_discontinuous_gmv(const std::string &name, const EquationSystems &es, const bool write_partitioning, const std::set< std::string > *system_names=nullptr) const
Manages consistently variables, degrees of freedom, and coefficient vectors for explicit systems...
virtual Real mean() const override