cb-geo / mpm

CB-Geo High-Performance Material Point Method
https://www.cb-geo.com/research/mpm
Other
238 stars 83 forks source link

[Feature] VTK output vars #684

Closed bodhinandach closed 3 years ago

bodhinandach commented 3 years ago

Describe the PR This PR solves issue #594 to output variables from JSON with unknown type. A new map to link the string specified in JSON and a new VariableType class is created. Also, this removes the default output variables of displacements, velocities, stresses, and strains.

Every time a user wants to output a variable, just add the string and type to the list specified in src/mpm.cc and at the initialise()function in particle.tcc for which variable to return using lambda function.

The JSON list "vtk" is ready back to be used.

Related Issues/PRs Issue #594

Additional context

  1. The current design work only for vector and tensor variables in particle, the scalar part is still ongoing development. (Done :heavy_check_mark:)
  2. @kks32 Maybe we might want to use the flat map that you test to have a fast retrieval. (Done using tsl_map :heavy_check_mark:)
codecov[bot] commented 3 years ago

Codecov Report

Merging #684 into develop will decrease coverage by 0.01%. The diff coverage is 95.59%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #684      +/-   ##
===========================================
- Coverage    96.68%   96.67%   -0.01%     
===========================================
  Files          123      123              
  Lines        25391    25560     +169     
===========================================
+ Hits         24549    24710     +161     
- Misses         842      850       +8     
Impacted Files Coverage Δ
include/mesh.h 100.00% <ø> (ø)
include/particles/particle_base.h 100.00% <ø> (ø)
include/solvers/mpm_base.h 0.00% <ø> (ø)
tests/io/write_mesh_particles.cc 87.27% <ø> (ø)
tests/io/write_mesh_particles_unitcell.cc 87.26% <0.00%> (-0.41%) :arrow_down:
include/solvers/mpm_base.tcc 76.09% <87.18%> (+0.48%) :arrow_up:
include/particles/particle.tcc 93.93% <91.67%> (-0.20%) :arrow_down:
include/mesh.tcc 84.13% <100.00%> (+0.23%) :arrow_up:
include/particles/particle.h 100.00% <100.00%> (ø)
tests/mesh_test_2d.cc 98.46% <100.00%> (+0.02%) :arrow_up:
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 11aba2b...9b388c2. Read the comment docs.