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/material_id #674

Closed jgiven100 closed 4 years ago

jgiven100 commented 4 years ago

Describe the PR Adding the option to update material_id based on pset_id for a single input file (i.e. particles.txt).

Related Issues/PRs https://github.com/cb-geo/mpm/issues/671

Additional context Input JSON must include new section "material_sets":

"material_sets":[
    {
      "material_id": 0,
      "pset_id": 0
    },
    {
      "material_id": 1,
      "pset_id": 1
    }
]

And the "mesh:" section must include:

"update_materials": true
codecov[bot] commented 4 years ago

Codecov Report

Merging #674 into develop will increase coverage by 0.08%. The diff coverage is 88.89%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #674      +/-   ##
===========================================
+ Coverage    96.54%   96.62%   +0.08%     
===========================================
  Files          122      122              
  Lines        25270    25295      +25     
===========================================
+ Hits         24396    24440      +44     
+ Misses         874      855      -19     
Impacted Files Coverage Δ
tests/io/write_mesh_particles.cc 87.67% <80.00%> (-0.42%) :arrow_down:
include/solvers/mpm_base.tcc 73.53% <92.31%> (+4.09%) :arrow_up:
tests/mpm_explicit_usf_test.cc 100.00% <100.00%> (ø)
tests/mpm_explicit_usl_test.cc 100.00% <100.00%> (ø)
src/io/io.cc 86.79% <0.00%> (+0.94%) :arrow_up:

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 b14691d...86268c1. Read the comment docs.

jgiven100 commented 4 years ago

@kks32 Yes, works with material_sets and all particles are correctly updated.

@ezrayst and I quickly changed the assign_particles function to include an output that showed us the original and updated material_id.

Unfortunately didn't grab any screenshots.

kks32 commented 4 years ago

For doing the test we also need entity_sets.json file

ezrayst commented 4 years ago

@kks32 for resume function, don't we get the material from the current material_id stored in .h5 file for each particle? This means we would not pass this function anymore right?

jgiven100 commented 4 years ago

I tested a simple case using resume and stress &displacement outputs matched non-resume outputs

kks32 commented 4 years ago

@jgiven100 thanks for testing resume. For testing you can add it to tests/io/write_mesh_particles.cc JSON object and write to a file.

jgiven100 commented 4 years ago

@kks32 within tests/io/write_mesh_particles.cc are you thinking:

kks32 commented 4 years ago

@jgiven100 I was thinking writing an entitiy_sets.json file, if we don't already do that and see if we can assign material ids to particle sets.

jgiven100 commented 4 years ago

the current implementation of particle generator is creating pset_id: 0 so the procedure I've described is assigning material_id: 1 based on a particle set without having to include an entity_sets.json

"material_sets": [
    {
      "material_id": 1,
      "pset_id": 0
    }
  ],
kks32 commented 4 years ago

Could you please fix clangfomat issue: https://app.circleci.com/pipelines/github/cb-geo/mpm/1009/workflows/d64c9659-c6c3-4bd2-b72b-60b008c8772f/jobs/5597

jgiven100 commented 4 years ago

@kks32 & @ezrayst The material_id is now updated via material_sets based particle set defined in entity_sets.json instead of pset_id created by particle generator

kks32 commented 4 years ago

@bodhinandach are you happy, could you approve before I merge?

jgiven100 commented 4 years ago

@kks32 oops I got excited and already merged. Sorry!