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

Utilies related to export of geometry. More...

#include <OutData.hpp>

Collaboration diagram for polyfem::io::OutGeometryData:
[legend]

Classes

struct  ExportOptions
 different export flags More...
 

Public Member Functions

void init_sampler (const polyfem::mesh::Mesh &mesh, const double vismesh_rel_area)
 unitalize the ref element sampler
 
void build_grid (const polyfem::mesh::Mesh &mesh, const double spacing)
 builds the grid to export the solution
 
void export_data (const State &state, const Eigen::MatrixXd &sol, const Eigen::MatrixXd &pressure, const bool is_time_dependent, const double tend_in, const double dt, const ExportOptions &opts, const std::string &vis_mesh_path, const std::string &nodes_path, const std::string &solution_path, const std::string &stress_path, const std::string &mises_path, const bool is_contact_enabled, std::vector< SolutionFrame > &solution_frames) const
 exports everytihng, txt, vtu, etc
 
void save_vtu (const std::string &path, const State &state, const Eigen::MatrixXd &sol, const Eigen::MatrixXd &pressure, const double t, const double dt, const ExportOptions &opts, const bool is_contact_enabled, std::vector< SolutionFrame > &solution_frames) const
 saves the vtu file for time t
 
void save_volume (const std::string &path, const State &state, const Eigen::MatrixXd &sol, const Eigen::MatrixXd &pressure, const double t, const double dt, const ExportOptions &opts, std::vector< SolutionFrame > &solution_frames) const
 saves the volume vtu file
 
void save_surface (const std::string &export_surface, const State &state, const Eigen::MatrixXd &sol, const Eigen::MatrixXd &pressure, const double t, const double dt_in, const ExportOptions &opts, const bool is_contact_enabled, std::vector< SolutionFrame > &solution_frames) const
 saves the surface vtu file for for surface quantites, eg traction forces
 
void save_contact_surface (const std::string &export_surface, const State &state, const Eigen::MatrixXd &sol, const Eigen::MatrixXd &pressure, const double t, const double dt_in, const ExportOptions &opts, const bool is_contact_enabled, std::vector< SolutionFrame > &solution_frames) const
 saves the surface vtu file for for constact quantites, eg contact or friction forces
 
void save_wire (const std::string &name, const State &state, const Eigen::MatrixXd &sol, const double t, const ExportOptions &opts, std::vector< SolutionFrame > &solution_frames) const
 saves the wireframe
 
void save_points (const std::string &path, const State &state, const Eigen::MatrixXd &sol, const ExportOptions &opts, std::vector< SolutionFrame > &solution_frames) const
 saves the nodal values
 
void save_pvd (const std::string &name, const std::function< std::string(int)> &vtu_names, int time_steps, double t0, double dt, int skip_frame=1) const
 save a PVD of a time dependent simulation
 

Static Public Member Functions

static void extract_boundary_mesh (const mesh::Mesh &mesh, const int n_bases, const std::vector< basis::ElementBases > &bases, const std::vector< mesh::LocalBoundary > &total_local_boundary, Eigen::MatrixXd &node_positions, Eigen::MatrixXi &boundary_edges, Eigen::MatrixXi &boundary_triangles, std::vector< Eigen::Triplet< double > > &displacement_map_entries)
 extracts the boundary mesh
 

Private Member Functions

void build_vis_boundary_mesh (const mesh::Mesh &mesh, const std::vector< basis::ElementBases > &bases, const std::vector< basis::ElementBases > &gbases, const std::vector< mesh::LocalBoundary > &total_local_boundary, const Eigen::MatrixXd &solution, const int problem_dim, Eigen::MatrixXd &boundary_vis_vertices, Eigen::MatrixXd &boundary_vis_local_vertices, Eigen::MatrixXi &boundary_vis_elements, Eigen::MatrixXi &boundary_vis_elements_ids, Eigen::MatrixXi &boundary_vis_primitive_ids, Eigen::MatrixXd &boundary_vis_normals, Eigen::MatrixXd &displaced_boundary_vis_normals) const
 builds the boundary mesh for visualization
 
void build_vis_mesh (const mesh::Mesh &mesh, const Eigen::VectorXi &disc_orders, const std::vector< basis::ElementBases > &gbases, const std::map< int, Eigen::MatrixXd > &polys, const std::map< int, std::pair< Eigen::MatrixXd, Eigen::MatrixXi > > &polys_3d, const bool boundary_only, Eigen::MatrixXd &points, Eigen::MatrixXi &tets, Eigen::MatrixXi &el_id, Eigen::MatrixXd &discr) const
 builds visualzation mesh, upsampled mesh used for visualization the visualization mesh is a dense mesh per element all disconnected it also retuns the mapping to element id and discretization of every elment works in 2 and 3d.
 
void build_high_order_vis_mesh (const mesh::Mesh &mesh, const Eigen::VectorXi &disc_orders, const std::vector< basis::ElementBases > &bases, Eigen::MatrixXd &points, std::vector< std::vector< int > > &elements, Eigen::MatrixXi &el_id, Eigen::MatrixXd &discr) const
 builds high-der visualzation mesh per element all disconnected it also retuns the mapping to element id and discretization of every elment works in 2 and 3d.
 
void save_volume_vector_field (const State &state, const Eigen::MatrixXd &points, const ExportOptions &opts, const std::string &name, const Eigen::VectorXd &field, paraviewo::ParaviewWriter &writer) const
 

Private Attributes

utils::RefElementSampler ref_element_sampler
 used to sample the solution
 
Eigen::MatrixXd grid_points
 grid mesh points to export solution sampled on a grid
 
Eigen::MatrixXi grid_points_to_elements
 grid mesh mapping to fe elements
 
Eigen::MatrixXd grid_points_bc
 grid mesh boundaries
 

Detailed Description

Utilies related to export of geometry.

Definition at line 44 of file OutData.hpp.

Member Function Documentation

◆ build_grid()

void polyfem::io::OutGeometryData::build_grid ( const polyfem::mesh::Mesh mesh,
const double  spacing 
)

builds the grid to export the solution

Parameters
[in]meshmesh
[in]spacinggrid spacing, <=0 mean no grid

Definition at line 2319 of file OutData.cpp.

References polyfem::mesh::Mesh::barycentric_coords(), polyfem::mesh::Mesh::bounding_box(), polyfem::mesh::Mesh::elements_boxes(), grid_points, grid_points_bc, grid_points_to_elements, polyfem::mesh::Mesh::is_simplex(), polyfem::mesh::Mesh::is_volume(), polyfem::logger(), x, y, and z.

Referenced by polyfem::State::build_basis().

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

◆ build_high_order_vis_mesh()

void polyfem::io::OutGeometryData::build_high_order_vis_mesh ( const mesh::Mesh mesh,
const Eigen::VectorXi &  disc_orders,
const std::vector< basis::ElementBases > &  bases,
Eigen::MatrixXd &  points,
std::vector< std::vector< int > > &  elements,
Eigen::MatrixXi &  el_id,
Eigen::MatrixXd &  discr 
) const
private

builds high-der visualzation mesh per element all disconnected it also retuns the mapping to element id and discretization of every elment works in 2 and 3d.

if the mesh is not simplicial it gets tri/tet halized

Parameters
[in]meshmesh
[in]disc_ordersdiscretization orders
[in]basesbases
[out]pointsmesh points
[out]elementsmesh high-order cells
[out]el_idmapping from points to elements id
[out]discrmapping from points to discretization order

Definition at line 788 of file OutData.cpp.

References polyfem::mesh::Mesh::dimension(), polyfem::mesh::Mesh::is_cube(), polyfem::mesh::Mesh::is_linear(), polyfem::mesh::Mesh::is_polytope(), polyfem::mesh::Mesh::is_simplex(), polyfem::mesh::Mesh::is_volume(), polyfem::logger(), polyfem::mesh::Mesh::n_face_vertices(), polyfem::autogen::p_nodes_2d(), polyfem::autogen::p_nodes_3d(), polyfem::autogen::q_nodes_2d(), and polyfem::autogen::q_nodes_3d().

Referenced by save_volume().

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

◆ build_vis_boundary_mesh()

void polyfem::io::OutGeometryData::build_vis_boundary_mesh ( const mesh::Mesh mesh,
const std::vector< basis::ElementBases > &  bases,
const std::vector< basis::ElementBases > &  gbases,
const std::vector< mesh::LocalBoundary > &  total_local_boundary,
const Eigen::MatrixXd &  solution,
const int  problem_dim,
Eigen::MatrixXd &  boundary_vis_vertices,
Eigen::MatrixXd &  boundary_vis_local_vertices,
Eigen::MatrixXi &  boundary_vis_elements,
Eigen::MatrixXi &  boundary_vis_elements_ids,
Eigen::MatrixXi &  boundary_vis_primitive_ids,
Eigen::MatrixXd &  boundary_vis_normals,
Eigen::MatrixXd &  displaced_boundary_vis_normals 
) const
private

builds the boundary mesh for visualization

Parameters
[in]meshmesh
[in]basesbases
[in]gbasesgeometric bases
[in]total_local_boundaryboundaries
[in]solutionsolution
[in]problem_dimdimension of the problem
[out]boundary_vis_verticesboundary visualization mesh vertices
[out]boundary_vis_local_verticesboundary visualization mesh vertices pre image in ref element
[out]boundary_vis_elementsboundary visualization mesh connectivity
[out]boundary_vis_elements_idsboundary visualization mesh elements ids
[out]boundary_vis_primitive_idsboundary visualization mesh edge/face id
[out]boundary_vis_normalsboundary visualization mesh normals
[out]displaced_boundary_vis_normalsboundary visualization mesh normals after displacement is applied

Definition at line 397 of file OutData.cpp.

References polyfem::mesh::Mesh::is_volume(), polyfem::utils::BoundarySampler::normal_for_polygon_edge(), polyfem::utils::BoundarySampler::normal_for_quad_edge(), polyfem::utils::BoundarySampler::normal_for_quad_face(), polyfem::utils::BoundarySampler::normal_for_tri_edge(), polyfem::utils::BoundarySampler::normal_for_tri_face(), polyfem::utils::RefElementSampler::num_samples(), ref_element_sampler, polyfem::utils::BoundarySampler::sample_parametric_quad_edge(), polyfem::utils::BoundarySampler::sample_parametric_quad_face(), polyfem::utils::BoundarySampler::sample_parametric_tri_edge(), polyfem::utils::BoundarySampler::sample_parametric_tri_face(), polyfem::utils::BoundarySampler::sample_polygon_edge(), and vals.

Referenced by save_surface().

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

◆ build_vis_mesh()

void polyfem::io::OutGeometryData::build_vis_mesh ( const mesh::Mesh mesh,
const Eigen::VectorXi &  disc_orders,
const std::vector< basis::ElementBases > &  gbases,
const std::map< int, Eigen::MatrixXd > &  polys,
const std::map< int, std::pair< Eigen::MatrixXd, Eigen::MatrixXi > > &  polys_3d,
const bool  boundary_only,
Eigen::MatrixXd &  points,
Eigen::MatrixXi &  tets,
Eigen::MatrixXi &  el_id,
Eigen::MatrixXd &  discr 
) const
private

builds visualzation mesh, upsampled mesh used for visualization the visualization mesh is a dense mesh per element all disconnected it also retuns the mapping to element id and discretization of every elment works in 2 and 3d.

if the mesh is not simplicial it gets tri/tet halized

Parameters
[in]meshmesh
[in]disc_ordersdiscretization orders
[in]gbasesgeometric bases
[in]polyspolygons
[in]polys_3dpolyhedra
[in]boundary_onlyis build only elements touching the boundary
[out]pointsmesh points
[out]tetsmesh cells
[out]el_idmapping from points to elements id
[out]discrmapping from points to discretization order

Definition at line 645 of file OutData.cpp.

References 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(), ref_element_sampler, and polyfem::utils::RefElementSampler::simplex_volume().

Referenced by save_volume().

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

◆ export_data()

void polyfem::io::OutGeometryData::export_data ( const State state,
const Eigen::MatrixXd &  sol,
const Eigen::MatrixXd &  pressure,
const bool  is_time_dependent,
const double  tend_in,
const double  dt,
const ExportOptions opts,
const std::string &  vis_mesh_path,
const std::string &  nodes_path,
const std::string &  solution_path,
const std::string &  stress_path,
const std::string &  mises_path,
const bool  is_contact_enabled,
std::vector< SolutionFrame > &  solution_frames 
) const

exports everytihng, txt, vtu, etc

Parameters
[in]statestate to get the data
[in]solsolution
[in]pressurepressure
[in]is_time_dependentif the sim is time dependent
[in]tend_inend time
[in]dtdelta t
[in]optsexport options
[in]vis_mesh_pathvtu path
[in]nodes_pathpath to save nodes
[in]solution_pathpath to save solution
[in]stress_pathpath to save stress tensor
[in]mises_pathpath to save von mises stresses
[in]is_contact_enabledif contact is enabled
[out]solution_framessaves the output here instead of vtu

Definition at line 940 of file OutData.cpp.

References polyfem::State::assembler, polyfem::State::bases, polyfem::io::Evaluator::compute_stress_at_quadrature_points(), polyfem::mesh::Mesh::dimension(), polyfem::State::disc_orders, polyfem::State::geom_bases(), polyfem::State::in_node_to_node, polyfem::assembler::Problem::is_scalar(), polyfem::logger(), polyfem::State::mesh, polyfem::State::n_bases, polyfem::State::problem, polyfem::io::OutGeometryData::ExportOptions::reorder_output, polyfem::State::rhs, save_vtu(), and polyfem::utils::unflatten().

Referenced by polyfem::State::export_data().

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

◆ extract_boundary_mesh()

void polyfem::io::OutGeometryData::extract_boundary_mesh ( const mesh::Mesh mesh,
const int  n_bases,
const std::vector< basis::ElementBases > &  bases,
const std::vector< mesh::LocalBoundary > &  total_local_boundary,
Eigen::MatrixXd &  node_positions,
Eigen::MatrixXi &  boundary_edges,
Eigen::MatrixXi &  boundary_triangles,
std::vector< Eigen::Triplet< double > > &  displacement_map_entries 
)
static

extracts the boundary mesh

Parameters
[in]meshmesh
[in]n_basesnumber of bases
[in]basesbases
[in]total_local_boundarymesh boundaries
[out]node_positionsnodes positions
[out]boundary_edgesedges
[out]boundary_trianglestriangles
[out]displacement_mapmap of collision mesh vertices to nodes, empty if identity

Definition at line 145 of file OutData.cpp.

References polyfem::basis::ElementBases::bases, polyfem::basis::Basis::global(), polyfem::mesh::Mesh::has_poly(), polyfem::mesh::Mesh::is_conforming(), polyfem::mesh::Mesh::is_cube(), polyfem::mesh::Mesh::is_simplex(), polyfem::mesh::Mesh::is_simplicial(), polyfem::mesh::Mesh::is_volume(), polyfem::basis::ElementBases::local_nodes_for_primitive(), polyfem::logger(), and polyfem::mesh::Mesh::n_faces().

Referenced by polyfem::solver::LayerThicknessForm::build_collision_mesh(), polyfem::solver::ProxyContactForceForm::build_collision_mesh(), and polyfem::State::build_collision_mesh().

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

◆ init_sampler()

void polyfem::io::OutGeometryData::init_sampler ( const polyfem::mesh::Mesh mesh,
const double  vismesh_rel_area 
)

unitalize the ref element sampler

Parameters
[in]meshmesh
[in]vismesh_rel_arearelative sampling size

Definition at line 2314 of file OutData.cpp.

References polyfem::utils::RefElementSampler::init(), polyfem::mesh::Mesh::is_volume(), polyfem::mesh::Mesh::n_elements(), and ref_element_sampler.

Referenced by polyfem::State::load_mesh(), and polyfem::State::load_mesh().

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

◆ save_contact_surface()

void polyfem::io::OutGeometryData::save_contact_surface ( const std::string &  export_surface,
const State state,
const Eigen::MatrixXd &  sol,
const Eigen::MatrixXd &  pressure,
const double  t,
const double  dt_in,
const ExportOptions opts,
const bool  is_contact_enabled,
std::vector< SolutionFrame > &  solution_frames 
) const

saves the surface vtu file for for constact quantites, eg contact or friction forces

Parameters
[in]export_surfacefilename
[in]statestate to get the data
[in]solsolution
[in]pressurepressure
[in]ttime
[in]dt_indelta_t
[in]optsexport options
[in]is_contact_enabledif contact is enabled
[out]solution_framessaves the output here instead of vtu

Definition at line 1968 of file OutData.cpp.

References polyfem::State::args, polyfem::State::collision_mesh, polyfem::io::OutGeometryData::ExportOptions::contact_forces, polyfem::solver::SolveData::contact_form, polyfem::mesh::Mesh::dimension(), polyfem::io::OutGeometryData::ExportOptions::friction_forces, polyfem::solver::SolveData::friction_form, polyfem::State::mesh, polyfem::State::solve_data, polyfem::io::OutGeometryData::ExportOptions::solve_export_to_file, polyfem::solver::SolveData::time_integrator, polyfem::utils::unflatten(), and polyfem::io::OutGeometryData::ExportOptions::use_hdf5.

Referenced by save_vtu().

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

◆ save_points()

void polyfem::io::OutGeometryData::save_points ( const std::string &  path,
const State state,
const Eigen::MatrixXd &  sol,
const ExportOptions opts,
std::vector< SolutionFrame > &  solution_frames 
) const

saves the nodal values

Parameters
[in]pathfilename
[in]statestate to get the data
[in]solsolution
[in]optsexport options
[out]solution_framessaves the output here instead of vtu

Definition at line 2250 of file OutData.cpp.

References polyfem::mesh::Mesh::dimension(), polyfem::State::dirichlet_nodes, polyfem::State::dirichlet_nodes_position, polyfem::mesh::Mesh::get_node_id(), polyfem::assembler::Problem::is_scalar(), polyfem::State::mesh, polyfem::State::problem, polyfem::io::OutGeometryData::ExportOptions::solve_export_to_file, and polyfem::io::OutGeometryData::ExportOptions::use_hdf5.

Referenced by save_vtu().

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

◆ save_pvd()

void polyfem::io::OutGeometryData::save_pvd ( const std::string &  name,
const std::function< std::string(int)> &  vtu_names,
int  time_steps,
double  t0,
double  dt,
int  skip_frame = 1 
) const

save a PVD of a time dependent simulation

Parameters
[in]namefilename
[in]vtu_namesnames of the vtu files
[in]time_stepstotal time stesp
[in]t0initial time
[in]dtdelta t
[in]skip_frameevery which frame to skip

Definition at line 2306 of file OutData.cpp.

Referenced by polyfem::State::save_timestep().

Here is the caller graph for this function:

◆ save_surface()

void polyfem::io::OutGeometryData::save_surface ( const std::string &  export_surface,
const State state,
const Eigen::MatrixXd &  sol,
const Eigen::MatrixXd &  pressure,
const double  t,
const double  dt_in,
const ExportOptions opts,
const bool  is_contact_enabled,
std::vector< SolutionFrame > &  solution_frames 
) const

saves the surface vtu file for for surface quantites, eg traction forces

Parameters
[in]export_surfacefilename
[in]statestate to get the data
[in]solsolution
[in]pressurepressure
[in]ttime
[in]dt_indelta_t
[in]optsexport options
[in]is_contact_enabledif contact is enabled
[out]solution_framessaves the output here instead of vtu

Definition at line 1769 of file OutData.cpp.

References polyfem::State::assembler, polyfem::State::bases, polyfem::io::OutGeometryData::ExportOptions::body_ids, build_vis_boundary_mesh(), polyfem::assembler::Assembler::compute_tensor_value(), polyfem::mesh::Mesh::dimension(), polyfem::State::disc_orders, polyfem::mesh::Mesh::edge_length(), polyfem::State::geom_bases(), polyfem::mesh::Mesh::get_body_id(), polyfem::mesh::Mesh::get_boundary_id(), polyfem::io::Evaluator::interpolate_at_local_vals(), polyfem::mesh::Mesh::is_cube(), polyfem::assembler::Problem::is_scalar(), polyfem::mesh::Mesh::is_simplex(), polyfem::mesh::Mesh::is_volume(), polyfem::State::mass_matrix_assembler, polyfem::io::OutGeometryData::ExportOptions::material_params, polyfem::State::mesh, polyfem::State::mixed_assembler, polyfem::assembler::Assembler::parameters(), polyfem::State::pressure_bases, polyfem::State::problem, polyfem::mesh::Mesh::quad_area(), polyfem::io::OutGeometryData::ExportOptions::solve_export_to_file, polyfem::State::total_local_boundary, polyfem::mesh::Mesh::tri_area(), and polyfem::io::OutGeometryData::ExportOptions::use_hdf5.

Referenced by save_vtu().

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

◆ save_volume()

void polyfem::io::OutGeometryData::save_volume ( const std::string &  path,
const State state,
const Eigen::MatrixXd &  sol,
const Eigen::MatrixXd &  pressure,
const double  t,
const double  dt,
const ExportOptions opts,
std::vector< SolutionFrame > &  solution_frames 
) const

saves the volume vtu file

Parameters
[in]pathfilename
[in]statestate to get the data
[in]solsolution
[in]pressurepressure
[in]ttime
[in]dtdelta t
[in]optsexport options
[out]solution_framessaves the output here instead of vtu

Definition at line 1196 of file OutData.cpp.

References polyfem::io::OutGeometryData::ExportOptions::acceleration, polyfem::utils::append_rows_of_zeros(), polyfem::State::ass_vals_cache, polyfem::State::assembler, polyfem::io::Evaluator::average_grad_based_function(), polyfem::State::bases, polyfem::io::OutGeometryData::ExportOptions::body_ids, polyfem::io::OutGeometryData::ExportOptions::boundary_only, build_high_order_vis_mesh(), build_vis_mesh(), polyfem::assembler::ElementAssemblyValues::compute(), polyfem::io::Evaluator::compute_scalar_value(), polyfem::io::Evaluator::compute_tensor_value(), polyfem::mesh::Mesh::dimension(), polyfem::State::disc_orders, polyfem::io::OutGeometryData::ExportOptions::discretization_order, polyfem::assembler::Problem::exact(), polyfem::io::OutGeometryData::ExportOptions::forces, polyfem::State::geom_bases(), polyfem::mesh::Mesh::get_body_id(), polyfem::mesh::Obstacle::get_edge_connectivity(), polyfem::mesh::Obstacle::get_face_connectivity(), polyfem::mesh::Obstacle::get_vertex_connectivity(), grid_points, grid_points_bc, grid_points_to_elements, polyfem::assembler::Problem::has_exact_sol(), polyfem::io::Evaluator::interpolate_at_local_vals(), polyfem::io::Evaluator::interpolate_function(), polyfem::mesh::Mesh::is_cube(), polyfem::assembler::Problem::is_scalar(), polyfem::mesh::Mesh::is_simplex(), polyfem::assembler::Problem::is_time_dependent(), polyfem::mesh::Mesh::is_volume(), polyfem::State::mass_matrix_assembler, polyfem::io::OutGeometryData::ExportOptions::material_params, polyfem::State::mesh, polyfem::State::mixed_assembler, polyfem::State::n_bases, polyfem::mesh::Mesh::n_face_vertices(), polyfem::mesh::Obstacle::n_vertices(), polyfem::solver::SolveData::named_forms(), polyfem::mesh::Obstacle::ndof(), polyfem::io::OutGeometryData::ExportOptions::nodes, polyfem::State::obstacle, polyfem::autogen::p_nodes_2d(), polyfem::autogen::p_nodes_3d(), polyfem::assembler::Assembler::parameters(), polyfem::State::polys, polyfem::State::polys_3d, polyfem::State::pressure_bases, polyfem::State::problem, polyfem::autogen::q_nodes_2d(), polyfem::autogen::q_nodes_3d(), ref_element_sampler, save_volume_vector_field(), polyfem::io::OutGeometryData::ExportOptions::scalar_values, polyfem::io::OutGeometryData::ExportOptions::sol_on_grid, polyfem::State::solve_data, polyfem::io::OutGeometryData::ExportOptions::solve_export_to_file, polyfem::io::OutGeometryData::ExportOptions::tensor_values, polyfem::solver::SolveData::time_integrator, polyfem::utils::unflatten(), polyfem::io::OutGeometryData::ExportOptions::use_hdf5, polyfem::io::OutGeometryData::ExportOptions::use_sampler, polyfem::io::OutGeometryData::ExportOptions::use_spline, polyfem::mesh::Obstacle::v(), vals, and polyfem::io::OutGeometryData::ExportOptions::velocity.

Referenced by save_vtu().

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

◆ save_volume_vector_field()

void polyfem::io::OutGeometryData::save_volume_vector_field ( const State state,
const Eigen::MatrixXd &  points,
const ExportOptions opts,
const std::string &  name,
const Eigen::VectorXd &  field,
paraviewo::ParaviewWriter &  writer 
) const
private

Definition at line 1740 of file OutData.cpp.

References polyfem::State::bases, polyfem::io::OutGeometryData::ExportOptions::boundary_only, polyfem::State::disc_orders, polyfem::io::Evaluator::interpolate_function(), polyfem::State::mesh, polyfem::mesh::Obstacle::n_vertices(), polyfem::mesh::Obstacle::ndof(), polyfem::State::obstacle, polyfem::State::polys, polyfem::State::polys_3d, polyfem::State::problem, ref_element_sampler, polyfem::io::OutGeometryData::ExportOptions::solve_export_to_file, polyfem::utils::unflatten(), and polyfem::io::OutGeometryData::ExportOptions::use_sampler.

Referenced by save_volume().

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

◆ save_vtu()

void polyfem::io::OutGeometryData::save_vtu ( const std::string &  path,
const State state,
const Eigen::MatrixXd &  sol,
const Eigen::MatrixXd &  pressure,
const double  t,
const double  dt,
const ExportOptions opts,
const bool  is_contact_enabled,
std::vector< SolutionFrame > &  solution_frames 
) const

saves the vtu file for time t

Parameters
[in]pathfilename
[in]statestate to get the data
[in]solsolution
[in]pressurepressure
[in]ttime
[in]dtdelta t
[in]optsexport options
[in]is_contact_enabledif contact is enabled
[out]solution_framessaves the output here instead of vtu

Definition at line 1113 of file OutData.cpp.

References polyfem::io::OutGeometryData::ExportOptions::contact_forces, polyfem::io::OutGeometryData::ExportOptions::file_extension(), polyfem::io::OutGeometryData::ExportOptions::friction_forces, polyfem::logger(), polyfem::State::mesh, polyfem::State::n_bases, polyfem::io::OutGeometryData::ExportOptions::points, polyfem::State::rhs, save_contact_surface(), save_points(), save_surface(), save_volume(), save_wire(), polyfem::io::OutGeometryData::ExportOptions::solve_export_to_file, polyfem::io::OutGeometryData::ExportOptions::surface, polyfem::io::OutGeometryData::ExportOptions::volume, and polyfem::io::OutGeometryData::ExportOptions::wire.

Referenced by export_data(), polyfem::State::save_subsolve(), and polyfem::State::save_timestep().

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

◆ save_wire()

void polyfem::io::OutGeometryData::save_wire ( const std::string &  name,
const State state,
const Eigen::MatrixXd &  sol,
const double  t,
const ExportOptions opts,
std::vector< SolutionFrame > &  solution_frames 
) const

saves the wireframe

Parameters
[in]namefilename
[in]statestate to get the data
[in]solsolution
[in]ttime
[in]optsexport options
[out]solution_framessaves the output here instead of vtu

Definition at line 2062 of file OutData.cpp.

References polyfem::State::assembler, polyfem::State::bases, polyfem::io::Evaluator::compute_scalar_value(), polyfem::mesh::Mesh::dimension(), polyfem::State::disc_orders, polyfem::assembler::Problem::exact(), faces, polyfem::State::geom_bases(), polyfem::assembler::Problem::has_exact_sol(), polyfem::io::Evaluator::interpolate_function(), polyfem::mesh::Mesh::is_cube(), polyfem::assembler::Problem::is_scalar(), polyfem::mesh::Mesh::is_simplex(), polyfem::mesh::Mesh::is_volume(), polyfem::State::mesh, polyfem::State::polys, polyfem::State::polys_3d, polyfem::State::problem, ref_element_sampler, polyfem::utils::RefElementSampler::simplex_points(), polyfem::io::OutGeometryData::ExportOptions::solve_export_to_file, and polyfem::io::OutGeometryData::ExportOptions::use_hdf5.

Referenced by save_vtu().

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

Member Data Documentation

◆ grid_points

Eigen::MatrixXd polyfem::io::OutGeometryData::grid_points
private

grid mesh points to export solution sampled on a grid

Definition at line 273 of file OutData.hpp.

Referenced by build_grid(), and save_volume().

◆ grid_points_bc

Eigen::MatrixXd polyfem::io::OutGeometryData::grid_points_bc
private

grid mesh boundaries

Definition at line 277 of file OutData.hpp.

Referenced by build_grid(), and save_volume().

◆ grid_points_to_elements

Eigen::MatrixXi polyfem::io::OutGeometryData::grid_points_to_elements
private

grid mesh mapping to fe elements

Definition at line 275 of file OutData.hpp.

Referenced by build_grid(), and save_volume().

◆ ref_element_sampler

utils::RefElementSampler polyfem::io::OutGeometryData::ref_element_sampler
private

used to sample the solution

Definition at line 270 of file OutData.hpp.

Referenced by build_vis_boundary_mesh(), build_vis_mesh(), init_sampler(), save_volume(), save_volume_vector_field(), and save_wire().


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