PolyFEM
Loading...
Searching...
No Matches
polyfem::io::OutStatsData Class Reference

all stats from polyfem More...

#include <OutStatsData.hpp>

Public Member Functions

void compute_errors (const int n_bases, const std::vector< polyfem::basis::ElementBases > &bases, const std::vector< polyfem::basis::ElementBases > &gbases, const polyfem::mesh::Mesh &mesh, const assembler::Problem &problem, const double tend, const Eigen::MatrixXd &sol)
 compute errors
 
void compute_mesh_stats (const polyfem::mesh::Mesh &mesh)
 compute stats (counts els type, mesh lenght, etc), step 1 of solve
 
void compute_mesh_size (const polyfem::mesh::Mesh &mesh_in, const std::vector< polyfem::basis::ElementBases > &bases_in, const int n_samples, const bool use_curved_mesh_size)
 computes the mesh size, it samples every edges n_samples times uses curved_mesh_size (false by default) to compute the size of the linear mesh
 
void reset ()
 clears all stats
 
void count_flipped_elements (const polyfem::mesh::Mesh &mesh, const std::vector< polyfem::basis::ElementBases > &gbases)
 counts the number of flipped elements
 
void save_json (const nlohmann::json &args, const int n_bases, const int n_pressure_bases, const Eigen::MatrixXd &sol, const mesh::Mesh &mesh, const Eigen::VectorXi &disc_orders, const Eigen::VectorXi &disc_ordersq, const assembler::Problem &problem, const OutRuntimeData &runtime, const std::string &formulation, const bool isoparametric, const int sol_at_node_id, nlohmann::json &j) const
 saves the output statistic to a json object
 

Public Attributes

Eigen::Vector4d spectrum = Eigen::Vector4d::Zero()
 spectrum of the stiffness matrix, enable only if POLYSOLVE_WITH_SPECTRA is ON (off by default)
 
json solver_info
 information of the solver, eg num iteration, time, errors, etc the informations varies depending on the solver
 
double mesh_size = 0
 max edge lenght
 
double min_edge_length = 0
 min edge lenght
 
double average_edge_length = 0
 avg edge lenght
 
double l2_err = 0
 errors, lp_err is in fact an L8 error
 
double linf_err = 0
 
double lp_err = 0
 
double h1_err = 0
 
double h1_semi_err = 0
 
double grad_max_err = 0
 
long long nn_zero = 0
 non zeros and sytem matrix size num dof is the total dof in the system
 
long long mat_size = 0
 
long long num_dofs = 0
 
double max_angle = 0
 statiscs on angle, compute only when using p_ref (false by default)
 
double sigma_max = 0
 statiscs on tri/tet quality, compute only when using p_ref (false by default)
 
double sigma_min = 0
 
double sigma_avg = 0
 
int n_flipped = 0
 number of flipped elements, compute only when using count_flipped_els (false by default)
 
int simplex_count = 0
 statiscs on the mesh (simplices)
 
int prism_count = 0
 statiscs on the mesh (simplices)
 
int pyramid_count = 0
 statiscs on the mesh (simplices)
 
int regular_count = 0
 statiscs on the mesh (regular quad/hex part of the mesh), see Polyspline paper for desciption
 
int regular_boundary_count = 0
 statiscs on the mesh (regular quad/hex boundary part of the mesh), see Polyspline paper for desciption
 
int simple_singular_count = 0
 statiscs on the mesh (irregular quad/hex part of the mesh), see Polyspline paper for desciption
 
int multi_singular_count = 0
 statiscs on the mesh (irregular quad/hex part of the mesh), see Polyspline paper for desciption
 
int boundary_count = 0
 statiscs on the mesh (boundary quads/hexs), see Polyspline paper for desciption
 
int non_regular_boundary_count = 0
 statiscs on the mesh (irregular boundary quad/hex part of the mesh), see Polyspline paper for desciption
 
int non_regular_count = 0
 statiscs on the mesh (irregular quad/hex part of the mesh), see Polyspline paper for desciption
 
int undefined_count = 0
 statiscs on the mesh (not quad/hex simplex), see Polyspline paper for desciption
 
int multi_singular_boundary_count = 0
 statiscs on the mesh (irregular boundary quad/hex part of the mesh), see Polyspline paper for desciption
 

Detailed Description

all stats from polyfem

Definition at line 50 of file OutStatsData.hpp.

Member Function Documentation

◆ compute_errors()

void polyfem::io::OutStatsData::compute_errors ( const int  n_bases,
const std::vector< polyfem::basis::ElementBases > &  bases,
const std::vector< polyfem::basis::ElementBases > &  gbases,
const polyfem::mesh::Mesh mesh,
const assembler::Problem problem,
const double  tend,
const Eigen::MatrixXd &  sol 
)

compute errors

Parameters
[in]n_basesnumber of base
[in]basesbases
[in]gbasesgeometric bases
[in]meshmesh
[in]problemproblem
[in]tendend time step
[in]solsolution

Definition at line 1856 of file OutData.cpp.

References polyfem::assembler::ElementAssemblyValues::compute(), polyfem::mesh::Mesh::dimension(), polyfem::assembler::Problem::exact(), polyfem::assembler::Problem::exact_grad(), polyfem::assembler::Problem::has_exact_sol(), polyfem::assembler::Problem::is_scalar(), polyfem::mesh::Mesh::is_volume(), polyfem::logger(), val, and vals.

Referenced by polyfem::legacy::State::compute_errors(), polyfem::varform::BilaplacianVarForm::compute_errors(), polyfem::varform::FluidVarForm::compute_errors(), polyfem::varform::IncompressibleElasticVarForm::compute_errors(), and polyfem::varform::ScalarVarForm::compute_errors().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ compute_mesh_size()

void polyfem::io::OutStatsData::compute_mesh_size ( const polyfem::mesh::Mesh mesh_in,
const std::vector< polyfem::basis::ElementBases > &  bases_in,
const int  n_samples,
const bool  use_curved_mesh_size 
)

computes the mesh size, it samples every edges n_samples times uses curved_mesh_size (false by default) to compute the size of the linear mesh

Parameters
[in]meshto compute stats
[in]basesgeom bases
[in]n_samplesused for curved meshes
[in]use_curved_mesh_sizeuse curved edges to compute mesh size

Definition at line 1728 of file OutData.cpp.

References polyfem::mesh::Mesh::get_edges(), polyfem::mesh::Mesh::is_polytope(), polyfem::mesh::Mesh::is_simplex(), polyfem::mesh::Mesh::is_volume(), polyfem::logger(), polyfem::utils::EdgeSampler::sample_2d_cube(), polyfem::utils::EdgeSampler::sample_2d_simplex(), polyfem::utils::EdgeSampler::sample_3d_cube(), and polyfem::utils::EdgeSampler::sample_3d_simplex().

Referenced by polyfem::legacy::State::build_basis(), polyfem::varform::BilaplacianVarForm::build_basis(), polyfem::varform::ElasticVarForm::build_basis(), polyfem::varform::FluidVarForm::build_basis(), and polyfem::varform::ScalarVarForm::build_basis().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ compute_mesh_stats()

void polyfem::io::OutStatsData::compute_mesh_stats ( const polyfem::mesh::Mesh mesh)

compute stats (counts els type, mesh lenght, etc), step 1 of solve

Parameters
meshmesh

Definition at line 2017 of file OutData.cpp.

References polyfem::mesh::Mesh::elements_tag(), polyfem::logger(), and polyfem::mesh::Mesh::n_elements().

Referenced by forward_simulation_with_legacy_state(), and polyfem::varform::VarForm::prepare().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ count_flipped_elements()

void polyfem::io::OutStatsData::count_flipped_elements ( const polyfem::mesh::Mesh mesh,
const std::vector< polyfem::basis::ElementBases > &  gbases 
)

counts the number of flipped elements

Parameters
[in]meshmesh
[in]gbasesgeometric bases

Definition at line 1811 of file OutData.cpp.

References polyfem::mesh::Mesh::elements_tag(), polyfem::mesh::Mesh::is_polytope(), polyfem::mesh::Mesh::is_volume(), polyfem::log_and_throw_error(), polyfem::logger(), and vals.

Referenced by polyfem::legacy::State::build_basis(), polyfem::varform::BilaplacianVarForm::build_basis(), polyfem::varform::ElasticVarForm::build_basis(), polyfem::varform::FluidVarForm::build_basis(), and polyfem::varform::ScalarVarForm::build_basis().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reset()

void polyfem::io::OutStatsData::reset ( )

clears all stats

Definition at line 1806 of file OutData.cpp.

Referenced by polyfem::legacy::State::build_basis(), and polyfem::varform::VarForm::reset().

Here is the caller graph for this function:

◆ save_json()

void polyfem::io::OutStatsData::save_json ( const nlohmann::json &  args,
const int  n_bases,
const int  n_pressure_bases,
const Eigen::MatrixXd &  sol,
const mesh::Mesh mesh,
const Eigen::VectorXi &  disc_orders,
const Eigen::VectorXi &  disc_ordersq,
const assembler::Problem problem,
const OutRuntimeData runtime,
const std::string &  formulation,
const bool  isoparametric,
const int  sol_at_node_id,
nlohmann::json &  j 
) const

saves the output statistic to a json object

Parameters
[in]joutput json

save json

Parameters
[in]argsinput argumeents
[in]n_basesnumber of bases
[in]n_pressure_basesnumber fo pressure bases
[in]solsolution
[in]meshmesh
[in]disc_ordersdiscretization order
[in]disc_ordersqdiscretization order
[in]problemproblem
[in]runtimerumtime
[in]formulationformulation
[in]isoparametricif isoparametric
[in]sol_at_node_idexport solution at node
[out]joutput json

Definition at line 2099 of file OutData.cpp.

References polyfem::io::OutRuntimeData::assembling_mass_mat_time, polyfem::io::OutRuntimeData::assembling_stiffness_mat_time, polyfem::io::OutRuntimeData::assigning_rhs_time, polyfem::io::OutRuntimeData::building_basis_time, polyfem::io::OutRuntimeData::computing_poly_basis_time, polyfem::mesh::Mesh::dimension(), polyfem::utils::get_n_threads(), getPeakRSS(), polyfem::assembler::Problem::is_scalar(), polyfem::io::OutRuntimeData::loading_mesh_time, polyfem::logger(), polyfem::mesh::Mesh::n_elements(), polyfem::mesh::Mesh::n_vertices(), polyfem::assembler::Problem::name(), polyfem::mesh::Mesh::orders(), and polyfem::io::OutRuntimeData::solving_time.

Referenced by polyfem::legacy::State::save_json(), polyfem::varform::BilaplacianVarForm::save_json(), polyfem::varform::FluidVarForm::save_json(), polyfem::varform::IncompressibleElasticVarForm::save_json(), and polyfem::varform::ScalarVarForm::save_json().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ average_edge_length

double polyfem::io::OutStatsData::average_edge_length = 0

avg edge lenght

Definition at line 65 of file OutStatsData.hpp.

◆ boundary_count

int polyfem::io::OutStatsData::boundary_count = 0

statiscs on the mesh (boundary quads/hexs), see Polyspline paper for desciption

Definition at line 97 of file OutStatsData.hpp.

◆ grad_max_err

double polyfem::io::OutStatsData::grad_max_err = 0

Definition at line 68 of file OutStatsData.hpp.

◆ h1_err

double polyfem::io::OutStatsData::h1_err = 0

Definition at line 68 of file OutStatsData.hpp.

◆ h1_semi_err

double polyfem::io::OutStatsData::h1_semi_err = 0

Definition at line 68 of file OutStatsData.hpp.

◆ l2_err

double polyfem::io::OutStatsData::l2_err = 0

errors, lp_err is in fact an L8 error

Definition at line 68 of file OutStatsData.hpp.

◆ linf_err

double polyfem::io::OutStatsData::linf_err = 0

Definition at line 68 of file OutStatsData.hpp.

◆ lp_err

double polyfem::io::OutStatsData::lp_err = 0

Definition at line 68 of file OutStatsData.hpp.

◆ mat_size

◆ max_angle

double polyfem::io::OutStatsData::max_angle = 0

statiscs on angle, compute only when using p_ref (false by default)

Definition at line 75 of file OutStatsData.hpp.

Referenced by polyfem::refinement::APriori::p_refine(), and polyfem::refinement::APriori::p_refine().

◆ mesh_size

◆ min_edge_length

double polyfem::io::OutStatsData::min_edge_length = 0

min edge lenght

Definition at line 63 of file OutStatsData.hpp.

Referenced by polyfem::legacy::State::build_basis(), and polyfem::varform::VarForm::save_restart_json().

◆ multi_singular_boundary_count

int polyfem::io::OutStatsData::multi_singular_boundary_count = 0

statiscs on the mesh (irregular boundary quad/hex part of the mesh), see Polyspline paper for desciption

Definition at line 105 of file OutStatsData.hpp.

◆ multi_singular_count

int polyfem::io::OutStatsData::multi_singular_count = 0

statiscs on the mesh (irregular quad/hex part of the mesh), see Polyspline paper for desciption

Definition at line 95 of file OutStatsData.hpp.

◆ n_flipped

int polyfem::io::OutStatsData::n_flipped = 0

◆ nn_zero

◆ non_regular_boundary_count

int polyfem::io::OutStatsData::non_regular_boundary_count = 0

statiscs on the mesh (irregular boundary quad/hex part of the mesh), see Polyspline paper for desciption

Definition at line 99 of file OutStatsData.hpp.

◆ non_regular_count

int polyfem::io::OutStatsData::non_regular_count = 0

statiscs on the mesh (irregular quad/hex part of the mesh), see Polyspline paper for desciption

Definition at line 101 of file OutStatsData.hpp.

◆ num_dofs

◆ prism_count

int polyfem::io::OutStatsData::prism_count = 0

statiscs on the mesh (simplices)

Definition at line 85 of file OutStatsData.hpp.

◆ pyramid_count

int polyfem::io::OutStatsData::pyramid_count = 0

statiscs on the mesh (simplices)

Definition at line 87 of file OutStatsData.hpp.

◆ regular_boundary_count

int polyfem::io::OutStatsData::regular_boundary_count = 0

statiscs on the mesh (regular quad/hex boundary part of the mesh), see Polyspline paper for desciption

Definition at line 91 of file OutStatsData.hpp.

◆ regular_count

int polyfem::io::OutStatsData::regular_count = 0

statiscs on the mesh (regular quad/hex part of the mesh), see Polyspline paper for desciption

Definition at line 89 of file OutStatsData.hpp.

◆ sigma_avg

double polyfem::io::OutStatsData::sigma_avg = 0

◆ sigma_max

double polyfem::io::OutStatsData::sigma_max = 0

statiscs on tri/tet quality, compute only when using p_ref (false by default)

Definition at line 77 of file OutStatsData.hpp.

Referenced by polyfem::refinement::APriori::p_refine(), and polyfem::refinement::APriori::p_refine().

◆ sigma_min

double polyfem::io::OutStatsData::sigma_min = 0

◆ simple_singular_count

int polyfem::io::OutStatsData::simple_singular_count = 0

statiscs on the mesh (irregular quad/hex part of the mesh), see Polyspline paper for desciption

Definition at line 93 of file OutStatsData.hpp.

◆ simplex_count

int polyfem::io::OutStatsData::simplex_count = 0

statiscs on the mesh (simplices)

Definition at line 83 of file OutStatsData.hpp.

◆ solver_info

◆ spectrum

◆ undefined_count

int polyfem::io::OutStatsData::undefined_count = 0

statiscs on the mesh (not quad/hex simplex), see Polyspline paper for desciption

Definition at line 103 of file OutStatsData.hpp.


The documentation for this class was generated from the following files: