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

#include <Evaluator.hpp>

Public Member Functions

bool check_scalar_value (const mesh::Mesh &mesh, const bool is_problem_scalar, const std::vector< basis::ElementBases > &bases, const std::vector< basis::ElementBases > &gbases, const Eigen::VectorXi &disc_orders, const std::map< int, Eigen::MatrixXd > &polys, const std::map< int, std::pair< Eigen::MatrixXd, Eigen::MatrixXi > > &polys_3d, const assembler::Assembler &assembler, const utils::RefElementSampler &sampler, const Eigen::MatrixXd &fun, const double t, const bool use_sampler, const bool boundary_only)
 checks if mises are not nan
 

Static Public Member Functions

static void compute_stress_at_quadrature_points (const mesh::Mesh &mesh, const bool is_problem_scalar, const std::vector< basis::ElementBases > &bases, const std::vector< basis::ElementBases > &gbases, const Eigen::VectorXi &disc_orders, const assembler::Assembler &assembler, const Eigen::MatrixXd &fun, const double t, Eigen::MatrixXd &result, Eigen::VectorXd &von_mises)
 compute von mises stress at quadrature points for the function fun, also compute the interpolated function
 
static void interpolate_function (const mesh::Mesh &mesh, const bool is_problem_scalar, const std::vector< basis::ElementBases > &bases, const Eigen::VectorXi &disc_orders, const std::map< int, Eigen::MatrixXd > &polys, const std::map< int, std::pair< Eigen::MatrixXd, Eigen::MatrixXi > > &polys_3d, const utils::RefElementSampler &sampler, const int n_points, const Eigen::MatrixXd &fun, Eigen::MatrixXd &result, const bool use_sampler, const bool boundary_only)
 interpolate the function fun.
 
static void interpolate_function (const mesh::Mesh &mesh, const int actual_dim, const std::vector< basis::ElementBases > &basis, const Eigen::VectorXi &disc_orders, const std::map< int, Eigen::MatrixXd > &polys, const std::map< int, std::pair< Eigen::MatrixXd, Eigen::MatrixXi > > &polys_3d, const utils::RefElementSampler &sampler, const int n_points, const Eigen::MatrixXd &fun, Eigen::MatrixXd &result, const bool use_sampler, const bool boundary_only)
 interpolate the function fun.
 
static void interpolate_at_local_vals (const mesh::Mesh &mesh, const bool is_problem_scalar, const std::vector< basis::ElementBases > &bases, const std::vector< basis::ElementBases > &gbases, const int el_index, const Eigen::MatrixXd &local_pts, const Eigen::MatrixXd &fun, Eigen::MatrixXd &result, Eigen::MatrixXd &result_grad)
 interpolate solution and gradient at element (calls interpolate_at_local_vals with sol)
 
static void interpolate_at_local_vals (const mesh::Mesh &mesh, const int actual_dim, const std::vector< basis::ElementBases > &bases, const std::vector< basis::ElementBases > &gbases, const int el_index, const Eigen::MatrixXd &local_pts, const Eigen::MatrixXd &fun, Eigen::MatrixXd &result, Eigen::MatrixXd &result_grad)
 interpolate the function fun and its gradient at in element el_index for the local_pts in the reference element using bases bases interpolate solution and gradient at element (calls interpolate_at_local_vals with sol)
 
static void interpolate_at_local_vals (const int el_index, const int dim, const int actual_dim, const assembler::ElementAssemblyValues &vals, const Eigen::MatrixXd &fun, Eigen::MatrixXd &result, Eigen::MatrixXd &result_grad)
 
static void compute_scalar_value (const mesh::Mesh &mesh, const bool is_problem_scalar, const std::vector< basis::ElementBases > &bases, const std::vector< basis::ElementBases > &gbases, const Eigen::VectorXi &disc_orders, const std::map< int, Eigen::MatrixXd > &polys, const std::map< int, std::pair< Eigen::MatrixXd, Eigen::MatrixXi > > &polys_3d, const assembler::Assembler &assembler, const utils::RefElementSampler &sampler, const int n_points, const Eigen::MatrixXd &fun, const double t, std::vector< assembler::Assembler::NamedMatrix > &result, const bool use_sampler, const bool boundary_only)
 computes scalar quantity of funtion (ie von mises for elasticity and norm of velocity for fluid)
 
static void average_grad_based_function (const mesh::Mesh &mesh, const bool is_problem_scalar, const int n_bases, const std::vector< basis::ElementBases > &bases, const std::vector< basis::ElementBases > &gbases, const Eigen::VectorXi &disc_orders, const std::map< int, Eigen::MatrixXd > &polys, const std::map< int, std::pair< Eigen::MatrixXd, Eigen::MatrixXi > > &polys_3d, const assembler::Assembler &assembler, const utils::RefElementSampler &sampler, const double t, const int n_points, const Eigen::MatrixXd &fun, std::vector< assembler::Assembler::NamedMatrix > &result_scalar, std::vector< assembler::Assembler::NamedMatrix > &result_tensor, const bool use_sampler, const bool boundary_only)
 computes scalar quantity of funtion (ie von mises for elasticity and norm of velocity for fluid) the scalar value is averaged around every node to make it continuos
 
static void compute_tensor_value (const mesh::Mesh &mesh, const bool is_problem_scalar, const std::vector< basis::ElementBases > &bases, const std::vector< basis::ElementBases > &gbases, const Eigen::VectorXi &disc_orders, const std::map< int, Eigen::MatrixXd > &polys, const std::map< int, std::pair< Eigen::MatrixXd, Eigen::MatrixXi > > &polys_3d, const assembler::Assembler &assembler, const utils::RefElementSampler &sampler, const int n_points, const Eigen::MatrixXd &fun, const double t, std::vector< assembler::Assembler::NamedMatrix > &result, const bool use_sampler, const bool boundary_only)
 compute tensor quantity (ie stress tensor or velocy)
 
static void interpolate_boundary_function (const mesh::Mesh &mesh, const bool is_problem_scalar, const std::vector< basis::ElementBases > &bases, const std::vector< basis::ElementBases > &gbases, const Eigen::MatrixXd &pts, const Eigen::MatrixXi &faces, const Eigen::MatrixXd &fun, const bool compute_avg, Eigen::MatrixXd &result)
 computes integrated solution (fun) per surface face.
 
static Eigen::MatrixXd generate_linear_field (const int n_bases, const std::shared_ptr< mesh::MeshNodes > mesh_nodes, const Eigen::MatrixXd &grad)
 
static Eigen::MatrixXd get_bases_position (const int n_bases, const std::shared_ptr< mesh::MeshNodes > mesh_nodes)
 
static Eigen::VectorXd integrate_function (const std::vector< basis::ElementBases > &bases, const std::vector< basis::ElementBases > &gbases, const Eigen::MatrixXd &fun, const int dim, const int actual_dim)
 

Private Member Functions

 Evaluator ()
 

Detailed Description

Definition at line 14 of file Evaluator.hpp.

Constructor & Destructor Documentation

◆ Evaluator()

polyfem::io::Evaluator::Evaluator ( )
inlineprivate

Definition at line 17 of file Evaluator.hpp.

Member Function Documentation

◆ average_grad_based_function()

void polyfem::io::Evaluator::average_grad_based_function ( const mesh::Mesh mesh,
const bool  is_problem_scalar,
const int  n_bases,
const std::vector< basis::ElementBases > &  bases,
const std::vector< basis::ElementBases > &  gbases,
const Eigen::VectorXi &  disc_orders,
const std::map< int, Eigen::MatrixXd > &  polys,
const std::map< int, std::pair< Eigen::MatrixXd, Eigen::MatrixXi > > &  polys_3d,
const assembler::Assembler assembler,
const utils::RefElementSampler sampler,
const double  t,
const int  n_points,
const Eigen::MatrixXd &  fun,
std::vector< assembler::Assembler::NamedMatrix > &  result_scalar,
std::vector< assembler::Assembler::NamedMatrix > &  result_tensor,
const bool  use_sampler,
const bool  boundary_only 
)
static

computes scalar quantity of funtion (ie von mises for elasticity and norm of velocity for fluid) the scalar value is averaged around every node to make it continuos

Parameters
[in]meshmesh
[in]is_problem_scalarif problem is scalar
[in]n_basesnumber of bases
[in]basesbases
[in]gbasesgeom bases
[in]disc_ordersdiscretization orders
[in]polyspolygons
[in]polys_3dpolyhedra
[in]assemblerassembler
[in]samplersampler for the local element
[in]n_pointsis the size of the output.
[in]funfunction to used
[out]result_scalarscalar value
[out]result_tensortensor value
[in]use_sampleruses the sampler or not
[in]boundary_onlyinterpolates only at boundary elements

Definition at line 152 of file Evaluator.cpp.

References polyfem::basis::ElementBases::bases, polyfem::assembler::Assembler::compute_scalar_value(), polyfem::mesh::Mesh::dimension(), polyfem::basis::Basis::global(), interpolate_function(), polyfem::mesh::Mesh::is_cube(), polyfem::mesh::Mesh::is_simplex(), polyfem::logger(), polyfem::autogen::p_nodes_2d(), polyfem::autogen::p_nodes_3d(), polyfem::autogen::q_nodes_2d(), polyfem::autogen::q_nodes_3d(), quadrature, and vals.

Referenced by polyfem::io::OutGeometryData::save_volume().

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

◆ check_scalar_value()

bool polyfem::io::Evaluator::check_scalar_value ( const mesh::Mesh mesh,
const bool  is_problem_scalar,
const std::vector< basis::ElementBases > &  bases,
const std::vector< basis::ElementBases > &  gbases,
const Eigen::VectorXi &  disc_orders,
const std::map< int, Eigen::MatrixXd > &  polys,
const std::map< int, std::pair< Eigen::MatrixXd, Eigen::MatrixXi > > &  polys_3d,
const assembler::Assembler assembler,
const utils::RefElementSampler sampler,
const Eigen::MatrixXd &  fun,
const double  t,
const bool  use_sampler,
const bool  boundary_only 
)

checks if mises are not nan

Parameters
[in]meshmesh
[in]is_problem_scalarif problem is scalar
[in]basesbases
[in]gbasesgeom bases
[in]disc_ordersdiscretization orders
[in]polyspolygons
[in]polys_3dpolyhedra
[in]assemblerassembler
[in]samplersampler for the local element
[in]funfunction to used
[in]use_sampleruses the sampler or not
[in]boundary_onlyinterpolates only at boundary elements
Returns
if mises are nan

Definition at line 592 of file Evaluator.cpp.

References polyfem::assembler::Assembler::compute_scalar_value(), polyfem::utils::RefElementSampler::cube_points(), polyfem::mesh::Mesh::is_boundary_element(), polyfem::mesh::Mesh::is_cube(), polyfem::mesh::Mesh::is_simplex(), polyfem::mesh::Mesh::is_volume(), polyfem::logger(), polyfem::autogen::p_nodes_2d(), polyfem::autogen::p_nodes_3d(), polyfem::autogen::q_nodes_2d(), polyfem::autogen::q_nodes_3d(), polyfem::utils::RefElementSampler::sample_polygon(), polyfem::utils::RefElementSampler::sample_polyhedron(), and polyfem::utils::RefElementSampler::simplex_points().

Here is the call graph for this function:

◆ compute_scalar_value()

void polyfem::io::Evaluator::compute_scalar_value ( const mesh::Mesh mesh,
const bool  is_problem_scalar,
const std::vector< basis::ElementBases > &  bases,
const std::vector< basis::ElementBases > &  gbases,
const Eigen::VectorXi &  disc_orders,
const std::map< int, Eigen::MatrixXd > &  polys,
const std::map< int, std::pair< Eigen::MatrixXd, Eigen::MatrixXi > > &  polys_3d,
const assembler::Assembler assembler,
const utils::RefElementSampler sampler,
const int  n_points,
const Eigen::MatrixXd &  fun,
const double  t,
std::vector< assembler::Assembler::NamedMatrix > &  result,
const bool  use_sampler,
const bool  boundary_only 
)
static

computes scalar quantity of funtion (ie von mises for elasticity and norm of velocity for fluid)

Parameters
[in]meshmesh
[in]is_problem_scalarif problem is scalar
[in]basesbases
[in]gbasesgeom bases
[in]disc_ordersdiscretization orders
[in]polyspolygons
[in]polys_3dpolyhedra
[in]assemblerassembler
[in]samplersampler for the local element
[in]n_pointsis the size of the output.
[in]funfunction to used
[out]resultscalar value
[in]use_sampleruses the sampler or not
[in]boundary_onlyinterpolates only at boundary elements

Definition at line 674 of file Evaluator.cpp.

References polyfem::assembler::Assembler::compute_scalar_value(), polyfem::utils::RefElementSampler::cube_points(), polyfem::mesh::Mesh::is_boundary_element(), polyfem::mesh::Mesh::is_cube(), polyfem::mesh::Mesh::is_simplex(), polyfem::mesh::Mesh::is_volume(), polyfem::logger(), polyfem::autogen::p_nodes_2d(), polyfem::autogen::p_nodes_3d(), polyfem::autogen::q_nodes_2d(), polyfem::autogen::q_nodes_3d(), polyfem::utils::RefElementSampler::sample_polygon(), polyfem::utils::RefElementSampler::sample_polyhedron(), and polyfem::utils::RefElementSampler::simplex_points().

Referenced by polyfem::io::OutGeometryData::save_volume(), and polyfem::io::OutGeometryData::save_wire().

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

◆ compute_stress_at_quadrature_points()

void polyfem::io::Evaluator::compute_stress_at_quadrature_points ( const mesh::Mesh mesh,
const bool  is_problem_scalar,
const std::vector< basis::ElementBases > &  bases,
const std::vector< basis::ElementBases > &  gbases,
const Eigen::VectorXi &  disc_orders,
const assembler::Assembler assembler,
const Eigen::MatrixXd &  fun,
const double  t,
Eigen::MatrixXd &  result,
Eigen::VectorXd &  von_mises 
)
static

compute von mises stress at quadrature points for the function fun, also compute the interpolated function

Parameters
[in]meshmesh
[in]is_problem_scalarif problem is scalar
[in]basesbases
[in]gbasesgeom bases
[in]disc_ordersdiscretization orders
[in]assemblerassembler
[in]funfunction to use
[out]resultoutput displacement
[out]von_misesoutput von mises

Definition at line 283 of file Evaluator.cpp.

References polyfem::assembler::Assembler::compute_scalar_value(), polyfem::assembler::Assembler::compute_tensor_value(), polyfem::mesh::Mesh::dimension(), polyfem::mesh::Mesh::is_cube(), polyfem::mesh::Mesh::is_simplex(), polyfem::mesh::Mesh::is_volume(), polyfem::logger(), polyfem::mesh::Mesh::n_elements(), and polyfem::quadrature::Quadrature::points.

Referenced by polyfem::io::OutGeometryData::export_data().

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

◆ compute_tensor_value()

void polyfem::io::Evaluator::compute_tensor_value ( const mesh::Mesh mesh,
const bool  is_problem_scalar,
const std::vector< basis::ElementBases > &  bases,
const std::vector< basis::ElementBases > &  gbases,
const Eigen::VectorXi &  disc_orders,
const std::map< int, Eigen::MatrixXd > &  polys,
const std::map< int, std::pair< Eigen::MatrixXd, Eigen::MatrixXi > > &  polys_3d,
const assembler::Assembler assembler,
const utils::RefElementSampler sampler,
const int  n_points,
const Eigen::MatrixXd &  fun,
const double  t,
std::vector< assembler::Assembler::NamedMatrix > &  result,
const bool  use_sampler,
const bool  boundary_only 
)
static

compute tensor quantity (ie stress tensor or velocy)

Parameters
[in]meshmesh
[in]is_problem_scalarif problem is scalar
[in]basesbases
[in]gbasesgeom bases
[in]disc_ordersdiscretization orders
[in]polyspolygons
[in]polys_3dpolyhedra
[in]assemblerassembler
[in]samplersampler for the local element
[in]n_pointsis the size of the output.
[in]funfunction to used
[out]resultresulting tensor
[in]use_sampleruses the sampler or not
[in]boundary_onlyinterpolates only at boundary elements

Definition at line 772 of file Evaluator.cpp.

References polyfem::assembler::Assembler::compute_tensor_value(), polyfem::utils::RefElementSampler::cube_points(), polyfem::mesh::Mesh::dimension(), polyfem::mesh::Mesh::is_boundary_element(), polyfem::mesh::Mesh::is_cube(), polyfem::mesh::Mesh::is_simplex(), polyfem::mesh::Mesh::is_volume(), polyfem::logger(), polyfem::autogen::p_nodes_2d(), polyfem::autogen::p_nodes_3d(), polyfem::autogen::q_nodes_2d(), polyfem::autogen::q_nodes_3d(), polyfem::utils::RefElementSampler::sample_polygon(), polyfem::utils::RefElementSampler::sample_polyhedron(), and polyfem::utils::RefElementSampler::simplex_points().

Referenced by polyfem::io::OutGeometryData::save_volume().

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

◆ generate_linear_field()

Eigen::MatrixXd polyfem::io::Evaluator::generate_linear_field ( const int  n_bases,
const std::shared_ptr< mesh::MeshNodes mesh_nodes,
const Eigen::MatrixXd &  grad 
)
static

Definition at line 884 of file Evaluator.cpp.

References polyfem::utils::flatten(), and get_bases_position().

Referenced by polyfem::solver::NLHomoProblem::full_to_reduced(), polyfem::solver::NLHomoProblem::reduced_to_full(), and polyfem::State::solve_homogenization().

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

◆ get_bases_position()

Eigen::MatrixXd polyfem::io::Evaluator::get_bases_position ( const int  n_bases,
const std::shared_ptr< mesh::MeshNodes mesh_nodes 
)
static

Definition at line 871 of file Evaluator.cpp.

Referenced by polyfem::solver::NLHomoProblem::constraint_grad(), and generate_linear_field().

Here is the caller graph for this function:

◆ integrate_function()

Eigen::VectorXd polyfem::io::Evaluator::integrate_function ( const std::vector< basis::ElementBases > &  bases,
const std::vector< basis::ElementBases > &  gbases,
const Eigen::MatrixXd &  fun,
const int  dim,
const int  actual_dim 
)
static

Definition at line 892 of file Evaluator.cpp.

References polyfem::assembler::ElementAssemblyValues::compute(), da, interpolate_at_local_vals(), quadrature, and vals.

Referenced by polyfem::State::solve_homogenization_step(), and polyfem::State::solve_linear().

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

◆ interpolate_at_local_vals() [1/3]

void polyfem::io::Evaluator::interpolate_at_local_vals ( const int  el_index,
const int  dim,
const int  actual_dim,
const assembler::ElementAssemblyValues vals,
const Eigen::MatrixXd &  fun,
Eigen::MatrixXd &  result,
Eigen::MatrixXd &  result_grad 
)
static

Definition at line 559 of file Evaluator.cpp.

References polyfem::logger(), val, and vals.

Here is the call graph for this function:

◆ interpolate_at_local_vals() [2/3]

void polyfem::io::Evaluator::interpolate_at_local_vals ( const mesh::Mesh mesh,
const bool  is_problem_scalar,
const std::vector< basis::ElementBases > &  bases,
const std::vector< basis::ElementBases > &  gbases,
const int  el_index,
const Eigen::MatrixXd &  local_pts,
const Eigen::MatrixXd &  fun,
Eigen::MatrixXd &  result,
Eigen::MatrixXd &  result_grad 
)
static

interpolate solution and gradient at element (calls interpolate_at_local_vals with sol)

Parameters
[in]meshmesh
[in]is_problem_scalarif problem is scalar
[in]basesbases
[in]gbasesgeom bases
[in]el_indexelement index
[in]local_ptspoints in the reference element
[in]funfunction to use
[out]resultoutput
[out]result_gradoutput gradients

Definition at line 492 of file Evaluator.cpp.

References polyfem::mesh::Mesh::dimension(), and interpolate_at_local_vals().

Referenced by polyfem::solver::ComplianceForm::compute_partial_gradient_step(), polyfem::solver::ElasticForm::force_material_derivative(), polyfem::solver::InertiaForm::force_shape_derivative(), polyfem::solver::ElasticForm::force_shape_derivative(), polyfem::solver::BodyForm::force_shape_derivative(), polyfem::solver::AccelerationForm::get_integral_functional(), polyfem::solver::KineticForm::get_integral_functional(), polyfem::solver::TargetForm::get_integral_functional(), integrate_function(), polyfem::solver::AdjointTools::integrate_objective(), interpolate_at_local_vals(), polyfem::io::OutGeometryData::save_surface(), and polyfem::io::OutGeometryData::save_volume().

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

◆ interpolate_at_local_vals() [3/3]

void polyfem::io::Evaluator::interpolate_at_local_vals ( const mesh::Mesh mesh,
const int  actual_dim,
const std::vector< basis::ElementBases > &  bases,
const std::vector< basis::ElementBases > &  gbases,
const int  el_index,
const Eigen::MatrixXd &  local_pts,
const Eigen::MatrixXd &  fun,
Eigen::MatrixXd &  result,
Eigen::MatrixXd &  result_grad 
)
static

interpolate the function fun and its gradient at in element el_index for the local_pts in the reference element using bases bases interpolate solution and gradient at element (calls interpolate_at_local_vals with sol)

Parameters
[in]meshmesh
[in]actual_dimis the size of the problem (e.g., 1 for Laplace, dim for elasticity)
[in]basesbases
[in]gbasesgeom bases
[in]el_indexelement index
[in]local_ptspoints in the reference element
[in]funfunction to used
[out]resultoutput
[out]result_gradoutput gradients

Definition at line 510 of file Evaluator.cpp.

References polyfem::assembler::ElementAssemblyValues::compute(), polyfem::mesh::Mesh::dimension(), polyfem::mesh::Mesh::is_volume(), polyfem::logger(), val, and vals.

Here is the call graph for this function:

◆ interpolate_boundary_function()

void polyfem::io::Evaluator::interpolate_boundary_function ( const mesh::Mesh mesh,
const bool  is_problem_scalar,
const std::vector< basis::ElementBases > &  bases,
const std::vector< basis::ElementBases > &  gbases,
const Eigen::MatrixXd &  pts,
const Eigen::MatrixXi &  faces,
const Eigen::MatrixXd &  fun,
const bool  compute_avg,
Eigen::MatrixXd &  result 
)
static

computes integrated solution (fun) per surface face.

pts and faces are the boundary are the boundary on the rest configuration

Parameters
[in]meshmesh
[in]is_problem_scalarif problem is scalar
[in]basesbases
[in]gbasesgeom bases
[in]ptsboundary points
[in]facesboundary faces
[in]funfunction to used
[in]compute_avgif compute the average across elements
[out]resultresulting value

Definition at line 56 of file Evaluator.cpp.

References polyfem::basis::ElementBases::bases, polyfem::mesh::Mesh3D::cell_face(), polyfem::assembler::ElementAssemblyValues::compute(), polyfem::mesh::Mesh::face_barycenter(), faces, polyfem::assembler::AssemblyValues::global, polyfem::mesh::Mesh::is_boundary_face(), polyfem::mesh::Mesh::is_cube(), polyfem::mesh::Mesh::is_simplex(), polyfem::mesh::Mesh::is_volume(), polyfem::logger(), polyfem::mesh::Mesh3D::n_cell_faces(), polyfem::mesh::Mesh::n_elements(), polyfem::utils::BoundarySampler::quadrature_for_quad_face(), polyfem::utils::BoundarySampler::quadrature_for_tri_face(), polyfem::assembler::AssemblyValues::val, and vals.

Here is the call graph for this function:

◆ interpolate_function() [1/2]

void polyfem::io::Evaluator::interpolate_function ( const mesh::Mesh mesh,
const bool  is_problem_scalar,
const std::vector< basis::ElementBases > &  bases,
const Eigen::VectorXi &  disc_orders,
const std::map< int, Eigen::MatrixXd > &  polys,
const std::map< int, std::pair< Eigen::MatrixXd, Eigen::MatrixXi > > &  polys_3d,
const utils::RefElementSampler sampler,
const int  n_points,
const Eigen::MatrixXd &  fun,
Eigen::MatrixXd &  result,
const bool  use_sampler,
const bool  boundary_only 
)
static

interpolate the function fun.

Parameters
[in]meshmesh
[in]is_problem_scalarif problem is scalar
[in]basesbases
[in]disc_ordersdiscretization orders
[in]polyspolygons
[in]polys_3dpolyhedra
[in]samplersampler for the local element
[in]n_pointsis the size of the output.
[in]funfunction to used
[out]resultoutput
[in]use_sampleruses the sampler or not
[in]boundary_onlyinterpolates only at boundary elements

Definition at line 380 of file Evaluator.cpp.

References polyfem::mesh::Mesh::dimension(), and interpolate_function().

Referenced by average_grad_based_function(), interpolate_function(), polyfem::io::OutGeometryData::save_volume(), polyfem::io::OutGeometryData::save_volume_vector_field(), and polyfem::io::OutGeometryData::save_wire().

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

◆ interpolate_function() [2/2]

void polyfem::io::Evaluator::interpolate_function ( const mesh::Mesh mesh,
const int  actual_dim,
const std::vector< basis::ElementBases > &  basis,
const Eigen::VectorXi &  disc_orders,
const std::map< int, Eigen::MatrixXd > &  polys,
const std::map< int, std::pair< Eigen::MatrixXd, Eigen::MatrixXi > > &  polys_3d,
const utils::RefElementSampler sampler,
const int  n_points,
const Eigen::MatrixXd &  fun,
Eigen::MatrixXd &  result,
const bool  use_sampler,
const bool  boundary_only 
)
static

interpolate the function fun.

Parameters
[in]meshmesh
[in]actual_dimis the size of the problem (e.g., 1 for Laplace, dim for elasticity)
[in]basesbases
[in]disc_ordersdiscretization orders
[in]polyspolygons
[in]polys_3dpolyhedra
[in]samplersampler for the local element
[in]n_pointsis the size of the output.
[in]funfunction to used
[out]resultoutput
[in]use_sampleruses the sampler or not
[in]boundary_onlyinterpolates only at boundary elements

Definition at line 402 of file Evaluator.cpp.

References polyfem::basis::ElementBases::bases, polyfem::utils::RefElementSampler::cube_points(), polyfem::basis::ElementBases::evaluate_bases(), polyfem::basis::Basis::global(), polyfem::mesh::Mesh::is_boundary_element(), polyfem::mesh::Mesh::is_cube(), polyfem::mesh::Mesh::is_simplex(), polyfem::mesh::Mesh::is_volume(), polyfem::logger(), polyfem::autogen::p_nodes_2d(), polyfem::autogen::p_nodes_3d(), polyfem::autogen::q_nodes_2d(), polyfem::autogen::q_nodes_3d(), polyfem::utils::RefElementSampler::sample_polygon(), polyfem::utils::RefElementSampler::sample_polyhedron(), and polyfem::utils::RefElementSampler::simplex_points().

Here is the call graph for this function:

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