Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Solver] Two-Phase One-Point Explicit #680

Open
wants to merge 211 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
211 commits
Select commit Hold shift + click to select a range
bbf7c51
Add twophase particle functions
tianchiTJ Jun 29, 2020
f3f6fb2
:computer: Refactor particle to handle scalar and vector properties
kks32 Jun 29, 2020
ad09dfa
:dart: Add testing to particle refactor of scalar properties
kks32 Jun 29, 2020
ac84455
Merge remote-tracking branch 'origin/develop' into solver/two-phase-e…
tianchiTJ Jun 30, 2020
26e5ed9
Add explicit twophase solver
tianchiTJ Jul 1, 2020
e68ab89
:computer: Compute mass free function
kks32 Jul 4, 2020
d40b6b0
Merge branch 'develop' of https://github.com/cb-geo/mpm into refactor…
bodhinandach Jul 7, 2020
67303d8
:wrench: modify mass, mass_density_volume
bodhinandach Jul 8, 2020
0a6ac16
:wrench: modify compute_mass function
bodhinandach Jul 8, 2020
adfd93f
:wrench: refactor particle velocity and displacement
bodhinandach Jul 9, 2020
2b92b3f
:wrench: refactor nodal mass and volume
bodhinandach Jul 9, 2020
336cfe6
:wrench: refactor nodal velocity and acceleration
bodhinandach Jul 9, 2020
91d5c97
:wrench: refactor nodal momentum, external, and internal forces
bodhinandach Jul 9, 2020
8ed2eb8
:wrench: refactor nodal pressure
bodhinandach Jul 9, 2020
02911bf
:wrench: Add scalar and vector properties enum
bodhinandach Jul 9, 2020
0feaf6d
:wrench: aesthetic clean up order of initialise()
bodhinandach Jul 9, 2020
bcfb878
:wrench: fix particle vector_properties_ size order
bodhinandach Jul 9, 2020
99b9eea
:dart: add testings for update and return functions
bodhinandach Jul 9, 2020
315cfae
Merge branch 'develop' of https://github.com/cb-geo/mpm into refactor…
bodhinandach Jul 9, 2020
2f54b90
:wrench: add overload functions of mapping
bodhinandach Jul 9, 2020
0facda0
:construction: :dart: test nightly benchmarks with refactored particl…
bodhinandach Jul 9, 2020
4136654
:construction: :dart: refactor map_mass_momentum and tests
bodhinandach Jul 10, 2020
9da224f
Merge branch 'develop' of https://github.com/cb-geo/mpm into refactor…
bodhinandach Jul 10, 2020
cb71c90
:construction: :dart: refactor map_body_force and update_volume
bodhinandach Jul 10, 2020
52eb2b3
:construction: :dart: change assign_velocity to void and cleanup
bodhinandach Jul 10, 2020
a20a2ab
:dart: revert mass change in particle test
bodhinandach Jul 10, 2020
0a0cf7b
:construction: :dart: add return cell pointer and refactor compute_vo…
bodhinandach Jul 10, 2020
fe0f9bf
:wrench: add assert in return and update scalar and vector properties
bodhinandach Jul 10, 2020
b693709
:construction: :dart: return set traction and refactor map traction
bodhinandach Jul 10, 2020
5fc100e
:construction: :dart: refactor pressure smoothing
bodhinandach Jul 12, 2020
bfee43a
:construction: change assign pressure to update pressure
bodhinandach Jul 12, 2020
2727d34
:construction: :dart: refactor update_mass_pressure
bodhinandach Jul 12, 2020
f9602fd
:wrench: fix return value of interpolate vector properties
bodhinandach Jul 12, 2020
a3ee684
:construction: :dart: use interpolate functions in particle
bodhinandach Jul 12, 2020
45aa3ba
:construction: refactor pressure smoothing interpolation
bodhinandach Jul 13, 2020
212505e
:dart: fix and add pressure mapping test
bodhinandach Jul 13, 2020
1251bd7
:construction: add TODO notes in particle.tcc
bodhinandach Jul 13, 2020
27ea5d6
:dart: add test for assign and return scalar and vector property
bodhinandach Jul 13, 2020
b888b07
Merge branch 'develop' of https://github.com/cb-geo/mpm into refactor…
bodhinandach Jul 13, 2020
ae339f1
:wrench: clang format
bodhinandach Jul 13, 2020
7491c34
Add twophase explicit logger
tianchiTJ Jul 13, 2020
3e1aae3
Merge remote-tracking branch 'origin/refactor/particles' into solver/…
tianchiTJ Jul 13, 2020
f34b64c
:wrench: remove virtual in initialise particle
bodhinandach Jul 14, 2020
164491f
:dart: :construction_worker: revert benchmarks to gcc
bodhinandach Jul 14, 2020
3d35f45
:wrench: modify explanation as suggested
bodhinandach Jul 14, 2020
deb54a7
:construction: :dart: some minor corrections and test addition
bodhinandach Jul 15, 2020
fcfcf87
:hammer: Improve performance with vector
kks32 Jul 17, 2020
385fcca
:pencil: AssocVector
kks32 Jul 18, 2020
86341a6
:fire: Remove unnecessary files
kks32 Jul 20, 2020
c8b65cd
:fire: Delete flat_map
kks32 Jul 20, 2020
5421984
:pencil: External flat_map
kks32 Jul 20, 2020
23be100
:fire: Remove unused includes
kks32 Jul 20, 2020
83a1257
Merge branch 'refactor/particles' into refactor/particles-assocvec
bodhinandach Jul 20, 2020
fc8a8a2
Merge pull request #672 from kks32/refactor/particles-assocvec
cbgeo Jul 21, 2020
222ca55
:wrench: change flat map initialisation
bodhinandach Jul 21, 2020
da461c3
:pencil: External flat_map
kks32 Jul 20, 2020
532aca8
:wrench: add mpm_properties
bodhinandach Jul 21, 2020
b017a99
:wrench: clang-format
bodhinandach Jul 21, 2020
6de587f
:wrench: add functions and container in node
bodhinandach Jul 21, 2020
9f42d94
:wrench: add functions and container in particle
bodhinandach Jul 21, 2020
da1682e
:construction: cosmetic changes as suggested
bodhinandach Jul 21, 2020
3e1f9ff
:construction: add boolean property
bodhinandach Jul 22, 2020
a687fa8
Merge branch 'refactor/particles_properties' of https://github.com/cb…
bodhinandach Jul 22, 2020
47c5f48
:wrench: modify function calls
bodhinandach Jul 22, 2020
6e2913b
Merge branch 'develop' into refactor/particles
ezrayst Jul 24, 2020
4899191
Merge branch 'develop' of https://github.com/cb-geo/mpm into refactor…
bodhinandach Jul 25, 2020
b8a3932
:construction: :dart: add set_traction to boolean_properties and add …
bodhinandach Jul 25, 2020
f2a982c
Merge branch 'develop' of https://github.com/cb-geo/mpm into refactor…
bodhinandach Jul 25, 2020
68506c1
:wrench: fix particle_function for pressure smoothing
bodhinandach Jul 25, 2020
0666b0a
:construction: :dart: refactor and add test for nodal boolean properties
bodhinandach Jul 25, 2020
2858001
Modify twophase part based on new structure
tianchiTJ Jul 27, 2020
a893ffe
Merge remote-tracking branch 'origin/refactor/particles' into solver/…
tianchiTJ Jul 27, 2020
fc1e539
Modification for the merge
tianchiTJ Jul 27, 2020
16b1ed8
Remove the pressure_smoothing function
tianchiTJ Jul 28, 2020
416b314
Fix the bug for undefined nodal properties
tianchiTJ Jul 28, 2020
b32693e
Go back to old version
tianchiTJ Jul 29, 2020
46e0b67
Fix some bug in the test
tianchiTJ Jul 29, 2020
32989ad
clean up
tianchiTJ Jul 29, 2020
99882d2
Clean up
tianchiTJ Jul 29, 2020
6c066c3
:wrench: add assign_state_var and pressure and cleanup
bodhinandach Jul 28, 2020
aa7ddfe
Fix the compute mass bug
tianchiTJ Jul 29, 2020
85e76db
Merge branch 'develop' of https://github.com/cb-geo/mpm into solver/t…
bodhinandach Jul 29, 2020
3e29ecf
Some clean up work
tianchiTJ Jul 30, 2020
974a86d
Move pressure constraints functions
tianchiTJ Jul 30, 2020
5400fd2
Fix the error in the test
tianchiTJ Jul 30, 2020
178eff0
Add twophase particle test
tianchiTJ Jul 31, 2020
3da5b25
Add 3d twophase particle test
tianchiTJ Jul 31, 2020
c69843f
Add twophase_node
tianchiTJ Jul 31, 2020
6b1a3ce
Fix the bug in reading pore pressure constraints
tianchiTJ Aug 1, 2020
a015f4f
:construction: add free_surface detection
bodhinandach Aug 1, 2020
9fe7d02
Move pore pressure into state_variables
tianchiTJ Aug 1, 2020
966d51a
:wrench: modify map_pressure_to_nodes in twophase
bodhinandach Aug 1, 2020
56bc776
:construction: revert back assign state vars to void, though keeping …
bodhinandach Aug 1, 2020
bff49ec
Fix the test
tianchiTJ Aug 2, 2020
feaa3d1
Remove the assign_pore_pressure
tianchiTJ Aug 2, 2020
a118f4d
:wrench: add an option to do free surface or not
bodhinandach Aug 2, 2020
dc7eeab
Merge branch 'solver/two-phase-explicit' of https://github.com/cb-geo…
bodhinandach Aug 2, 2020
284a0dd
:dart: :construction: add REQUIRE_THROWS in assign pressure
bodhinandach Aug 2, 2020
cbd3ef9
:wrench: fix free surface detection input
bodhinandach Aug 2, 2020
82d8ab0
Delete pore_pressure()
tianchiTJ Aug 3, 2020
ed844c9
Fix the nodal pressure constraints
tianchiTJ Aug 3, 2020
3cad6b3
Add twophase_node test
tianchiTJ Aug 4, 2020
1961366
:construction: :dart: categorize tests
bodhinandach Aug 4, 2020
cae6cfe
Fix bug in twophase_node test
tianchiTJ Aug 4, 2020
095fe39
Merge branch 'solver/two-phase-explicit' of https://github.com/cb-geo…
bodhinandach Aug 4, 2020
4919e84
Merge branch 'feature/vtk-output-statevars' of https://github.com/cb-…
bodhinandach Aug 5, 2020
d6681a8
Inpute gravity in initialise pore pressure
tianchiTJ Aug 5, 2020
b70e28d
:construction: remove pore_pressure from tensor data and cleanup
bodhinandach Aug 5, 2020
a853aac
Add liquid traction
tianchiTJ Aug 5, 2020
afc5b15
Modify the apply pressure constraint
tianchiTJ Aug 5, 2020
c6f4d7b
Some clean up
tianchiTJ Aug 5, 2020
52f5e0d
Add test for watertable
tianchiTJ Aug 5, 2020
8b09a3c
Add solver test
tianchiTJ Aug 6, 2020
48298d7
Modify two_phase node test
tianchiTJ Aug 6, 2020
a281034
Merge branch 'develop' of https://github.com/cb-geo/mpm into solver/t…
bodhinandach Aug 8, 2020
cde881d
:wrench: :dart: fix write json in test
bodhinandach Aug 8, 2020
bb2fcc0
Merge branch 'develop' of https://github.com/cb-geo/mpm into solver/t…
bodhinandach Aug 10, 2020
493ddb4
:wrench::dart: merge with develop and vtk branch and fix conflict
bodhinandach Aug 10, 2020
7cb30f9
:wrench: bug fix in MPI transfer
bodhinandach Aug 11, 2020
01c999c
:wrench: bug fix for damping, test is failing
bodhinandach Aug 11, 2020
becdfaa
Change the input names for pressure constraints
tianchiTJ Aug 11, 2020
eff342f
Fix the test bug of "damping"
tianchiTJ Aug 11, 2020
7f2f40d
:wrench: :dart: fix test category
bodhinandach Aug 11, 2020
55a5eed
Fix the bug for damping
tianchiTJ Aug 12, 2020
be2bbb9
Correct the files names
tianchiTJ Aug 12, 2020
304f54a
:wrench: modify some free-surface functions as suggested
bodhinandach Aug 12, 2020
98b7763
:wrench::fire: add hdf5 data structure for twophase
bodhinandach Aug 12, 2020
311be05
:wrench::art: cleanup typo
bodhinandach Aug 12, 2020
708c6d0
:wrench: hdf5 output and initialization in twophase
bodhinandach Aug 13, 2020
ae45f5d
:dart: hdf5 twophase particle tested
bodhinandach Aug 13, 2020
656f384
Correct the error in "assign_permeability"
tianchiTJ Aug 13, 2020
7239a63
Merge branch 'solver/two-phase-explicit' of https://github.com/cb-geo…
bodhinandach Aug 14, 2020
c68fbd5
:wrench: add mpi_data_twophase to mesh
bodhinandach Aug 14, 2020
8bb993b
:construction: :dart: add particle twophase mpi data transfer test
bodhinandach Aug 14, 2020
783c17e
:wrench: fix bug in initiating liquid state variables
bodhinandach Aug 14, 2020
b208bf4
:wrench: modify assign permeability and material() call
bodhinandach Aug 14, 2020
29aeb9c
:wrench: :art: modify cmake list to deactivate HDF5 offsetof warnings
bodhinandach Aug 15, 2020
82bef32
Merge branch 'feature/vtk-output-vars' of https://github.com/cb-geo/m…
bodhinandach Aug 15, 2020
af1abe1
Merge branch 'develop' of https://github.com/cb-geo/mpm into solver/t…
bodhinandach Aug 17, 2020
6ac4a1b
Add warning information for particle pore pressure
tianchiTJ Aug 17, 2020
64c8bab
Merge branch 'solver/two-phase-explicit' of https://github.com/cb-geo…
bodhinandach Aug 17, 2020
617efba
:wrench: modify initialise_particle
bodhinandach Aug 18, 2020
288b8aa
:construction: change hdf5 output
bodhinandach Aug 18, 2020
ec91bc0
:hammer: Use void* to return particle POD
kks32 Aug 19, 2020
5af4700
:hammer: Use std::shared_ptr<void> to handle PODs
kks32 Aug 19, 2020
dc2ec42
:pencil: :construction: cleanup hdf5_ptr()
bodhinandach Aug 20, 2020
4806e09
:construction: :dart: remove hdf5() and replace completely to hdf5_ptr()
bodhinandach Aug 20, 2020
65d579e
:construction: change initialise_particle input arguments
bodhinandach Aug 20, 2020
859e174
Merge branch 'develop' of https://github.com/cb-geo/mpm into solver/t…
bodhinandach Aug 20, 2020
174c5d0
:construction: :wrench: :dart: modify two phase explicit solver and i…
bodhinandach Aug 20, 2020
0b3fd01
Merge branch 'refactor/serialization' of https://github.com/cb-geo/mp…
bodhinandach Aug 20, 2020
1571da3
:wrench: fix conflict with serialize refactoring
bodhinandach Aug 20, 2020
594aa68
:construction: some modification of deserialize and serialize functio…
bodhinandach Aug 21, 2020
2b6cf4b
:construction: add serialize and deserialize in twophase particle
bodhinandach Aug 21, 2020
c602ced
:construction: :dart: fix bugs in particle_twophase SD and create tes…
bodhinandach Aug 22, 2020
4dedd01
Merge branch 'develop' of https://github.com/cb-geo/mpm into solver/t…
bodhinandach Aug 23, 2020
7081c0e
Merge branch 'refactor/serialization' of https://github.com/cb-geo/mp…
bodhinandach Aug 23, 2020
a4dfb76
:wrench: change if throw to assert
bodhinandach Aug 23, 2020
6992ada
:construction: add particle_types_ and modify write_hdf5()
bodhinandach Aug 24, 2020
8b7f384
:construction: chang read_hdf5
bodhinandach Aug 24, 2020
7f42f58
Merge branch 'refactor/serialization' of https://github.com/cb-geo/mp…
bodhinandach Aug 24, 2020
78a0e5a
:dart: reactivate resume test
bodhinandach Aug 24, 2020
c919841
:construction: renaming HDF5Particle as PODParticle
bodhinandach Aug 25, 2020
2a2a1a8
:wrench: fix hdf5_ptr casting
bodhinandach Aug 25, 2020
80b2817
:wrench: change hdf5 naming to pod
bodhinandach Aug 25, 2020
f7c0af9
:pencil: cleanup documentation and comments
bodhinandach Aug 25, 2020
5eebcf3
:pencil: change naming h5_test to pod_test
bodhinandach Aug 25, 2020
bf1fb24
Merge branch 'develop' of https://github.com/cb-geo/mpm into solver/t…
bodhinandach Aug 26, 2020
0ace406
:construction: :wrench: add write hdf5 twophase
bodhinandach Sep 12, 2020
2005506
:construction::wrench: add function to read particle hdf5 with specif…
bodhinandach Sep 12, 2020
c0ffa57
:wrench: change format back to original read
bodhinandach Sep 13, 2020
5366faf
Merge branch 'hotfix/mpi-buffer' of https://github.com/cb-geo/mpm int…
bodhinandach Sep 23, 2020
5e04ad3
Merge branch 'hotfix/deserialize_particle_bug' of https://github.com/…
bodhinandach Sep 28, 2020
37428ed
:wrench: :dart: add density and svars fix in twophase deserialization
bodhinandach Sep 28, 2020
0df173e
Merge branch 'hotfix/deserialize_particle_bug' of https://github.com/…
bodhinandach Sep 28, 2020
902e10b
Merge branch 'develop' of https://github.com/cb-geo/mpm into solver/t…
bodhinandach Sep 28, 2020
b69d846
:wrench: fix check non equal
bodhinandach Sep 28, 2020
d05373f
:wrench: :construction: :dart: modify 2phase serialization test
bodhinandach Sep 28, 2020
2149eaf
:wrench: add mpi barrier after transfer halo particles
bodhinandach Sep 29, 2020
e24d2f1
:wrench: :construction: modify map mixture
bodhinandach Oct 5, 2020
2a741de
:construction: :dart: modify solver as suggested and add test for npa…
bodhinandach Oct 5, 2020
7f96225
:construction: modify as suggested
bodhinandach Oct 6, 2020
974764a
:dart: :construction: radial basis function test
bodhinandach Oct 20, 2020
33f5e97
:construction: :dart: add 2D free surface detection test
bodhinandach Oct 21, 2020
f272ee7
:construction: add check cell status in mapping volume
bodhinandach Oct 21, 2020
0738ab2
:construction: change default value for particle density fs detection
bodhinandach Oct 21, 2020
79820f2
:dart: add 3D fsd test
bodhinandach Oct 21, 2020
5abd743
:construction: take id out of the while loop
bodhinandach Oct 21, 2020
e3127d1
:construction: add parallel free surface detection by density method
bodhinandach Oct 23, 2020
6e40958
Merge branch 'develop' of https://github.com/cb-geo/mpm into solver/t…
bodhinandach Oct 23, 2020
b79e05a
:dart: add test for illegal functions from base class make gravity const
bodhinandach Oct 23, 2020
5763fd0
:construction: remove mass check throw
bodhinandach Oct 23, 2020
c2b48f2
Add test file for read particle scalar properties
tianchiTJ Oct 23, 2020
9f3cc4a
Add test function for read_pressure_constraints
tianchiTJ Oct 23, 2020
f6022df
Add test functions for pressure constraint
tianchiTJ Oct 23, 2020
1b34a27
:construction: :dart: modify write mesh particle
bodhinandach Oct 29, 2020
ad851bf
Change the density tolerance
tianchiTJ Nov 3, 2020
ae2b6fe
:construction: correct some suggestions
bodhinandach Nov 4, 2020
b8a7d89
:construction: move multiphase functions outside mesh.tcc
bodhinandach Nov 4, 2020
ae92ec0
:construction: add groups in cell and node functions
bodhinandach Nov 4, 2020
62e065c
:dart: modify test to fix error in assertion
bodhinandach Nov 4, 2020
32f1c5a
:construction: :dart: change nPhase to NPhase in nodes
bodhinandach Nov 4, 2020
2b195ee
Correct the names of nodal phases
tianchiTJ Nov 4, 2020
689d9fb
Merge branch 'solver/two-phase-explicit' of https://github.com/cb-geo…
tianchiTJ Nov 4, 2020
c24b27e
:construction: cleanup as suggested
bodhinandach Nov 17, 2020
4f550b1
:construction: use iterate_over function with lambda function input
bodhinandach Nov 17, 2020
2ddbf23
:construction: modify particle and node functions as suggested
bodhinandach Nov 17, 2020
fe725f6
:construction: additional fixes on assertion and some info
bodhinandach Nov 17, 2020
eae0fbf
:dart: :construction: remove throw test
bodhinandach Nov 17, 2020
72dbc24
:construction: grouping node multiphase
bodhinandach Nov 23, 2020
2ad9bc2
:dart: :construction: fix test error due to initialise twophase
bodhinandach Nov 23, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,4 @@ configure.scan
*missing
*stamp-h1
benchmarks/
bin/
35 changes: 24 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ if (HDF5_FOUND)
include_directories(${HDF5_INCLUDE_DIRS})
link_libraries(${HDF5_LIBRARIES} ${HDF5_HL_LIBRARIES} ${HDF5_CXX_HL_LIBRARIES})
add_definitions(${HDF5_DEFINITIONS})
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-invalid-offsetof")
bodhinandach marked this conversation as resolved.
Show resolved Hide resolved
endif()

# OpenMP
Expand Down Expand Up @@ -142,8 +143,10 @@ include_directories(BEFORE
${mpm_SOURCE_DIR}/include/loads_bcs/
${mpm_SOURCE_DIR}/include/materials/
${mpm_SOURCE_DIR}/include/particles/
${mpm_SOURCE_DIR}/include/particles/pod_particles
${mpm_SOURCE_DIR}/include/solvers/
${mpm_SOURCE_DIR}/include/solvers/mpm_scheme/
${mpm_SOURCE_DIR}/include/utilities/
${mpm_SOURCE_DIR}/external/
${mpm_SOURCE_DIR}/tests/include/
)
Expand All @@ -157,7 +160,8 @@ SET(mpm_src
${mpm_SOURCE_DIR}/src/functions/linear_function.cc
${mpm_SOURCE_DIR}/src/functions/sin_function.cc
${mpm_SOURCE_DIR}/src/geometry.cc
${mpm_SOURCE_DIR}/src/hdf5_particle.cc
${mpm_SOURCE_DIR}/src/pod_particle.cc
${mpm_SOURCE_DIR}/src/pod_particle_twophase.cc
${mpm_SOURCE_DIR}/src/io/io.cc
${mpm_SOURCE_DIR}/src/io/io_mesh.cc
${mpm_SOURCE_DIR}/src/io/logger.cc
Expand Down Expand Up @@ -191,6 +195,7 @@ if(MPM_BUILD_TESTING)
${mpm_SOURCE_DIR}/tests/elements/triangle_quadrature_test.cc
${mpm_SOURCE_DIR}/tests/functions/linear_function_test.cc
${mpm_SOURCE_DIR}/tests/functions/sin_function_test.cc
${mpm_SOURCE_DIR}/tests/functions/radial_basis_function_test.cc
${mpm_SOURCE_DIR}/tests/graph_test.cc
${mpm_SOURCE_DIR}/tests/interface_test.cc
${mpm_SOURCE_DIR}/tests/io/io_mesh_ascii_test.cc
Expand All @@ -205,25 +210,33 @@ if(MPM_BUILD_TESTING)
${mpm_SOURCE_DIR}/tests/materials/newtonian_test.cc
${mpm_SOURCE_DIR}/tests/materials/norsand_test.cc
${mpm_SOURCE_DIR}/tests/materials/material_utility_test.cc
${mpm_SOURCE_DIR}/tests/mesh_free_surface_test.cc
${mpm_SOURCE_DIR}/tests/mesh_neighbours_test.cc
${mpm_SOURCE_DIR}/tests/mesh_test_2d.cc
${mpm_SOURCE_DIR}/tests/mesh_test_3d.cc
${mpm_SOURCE_DIR}/tests/mpi_transfer_particle_test.cc
${mpm_SOURCE_DIR}/tests/nodes/nodal_properties_test.cc
${mpm_SOURCE_DIR}/tests/nodes/node_map_test.cc
${mpm_SOURCE_DIR}/tests/nodes/node_test.cc
${mpm_SOURCE_DIR}/tests/nodes/node_twophase_test.cc
${mpm_SOURCE_DIR}/tests/nodes/node_vector_test.cc
${mpm_SOURCE_DIR}/tests/particles/particle_cell_crossing_test.cc
${mpm_SOURCE_DIR}/tests/particles/particle_test.cc
${mpm_SOURCE_DIR}/tests/particles/particle_twophase_test.cc
${mpm_SOURCE_DIR}/tests/particles/particle_traction_test.cc
${mpm_SOURCE_DIR}/tests/particles/particle_vector_test.cc
${mpm_SOURCE_DIR}/tests/particles/particle_serialize_deserialize_test.cc
${mpm_SOURCE_DIR}/tests/particles/particle_serialize_deserialize_twophase_test.cc
${mpm_SOURCE_DIR}/tests/point_in_cell_test.cc
${mpm_SOURCE_DIR}/tests/solvers/mpm_explicit_usf_test.cc
${mpm_SOURCE_DIR}/tests/solvers/mpm_explicit_usf_unitcell_test.cc
${mpm_SOURCE_DIR}/tests/solvers/mpm_explicit_usl_test.cc
${mpm_SOURCE_DIR}/tests/solvers/mpm_explicit_usl_unitcell_test.cc
${mpm_SOURCE_DIR}/tests/solvers/mpm_explicit_twophase_usf_test.cc
${mpm_SOURCE_DIR}/tests/solvers/mpm_explicit_twophase_usf_unitcell_test.cc
${mpm_SOURCE_DIR}/tests/solvers/mpm_explicit_twophase_usl_test.cc
${mpm_SOURCE_DIR}/tests/solvers/mpm_explicit_twophase_usl_unitcell_test.cc
${mpm_SOURCE_DIR}/tests/solvers/mpm_scheme_test.cc
${mpm_SOURCE_DIR}/tests/nodal_properties_test.cc
${mpm_SOURCE_DIR}/tests/node_map_test.cc
${mpm_SOURCE_DIR}/tests/node_test.cc
${mpm_SOURCE_DIR}/tests/node_vector_test.cc
${mpm_SOURCE_DIR}/tests/particle_cell_crossing_test.cc
${mpm_SOURCE_DIR}/tests/particle_serialize_deserialize_test.cc
${mpm_SOURCE_DIR}/tests/particle_test.cc
${mpm_SOURCE_DIR}/tests/particle_traction_test.cc
${mpm_SOURCE_DIR}/tests/particle_vector_test.cc
${mpm_SOURCE_DIR}/tests/point_in_cell_test.cc
)
add_executable(mpmtest ${mpm_src} ${test_src})
add_test(NAME mpmtest COMMAND $<TARGET_FILE:mpmtest>)
Expand Down
52 changes: 51 additions & 1 deletion include/cell.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,50 @@ class Cell {
//! Return previous mpi rank
unsigned previous_mpirank() const;

/**
* \defgroup MultiPhase Functions dealing with multi-phase MPM
*/
/**@{*/

//! Assign solving status
//! \ingroup MultiPhase
//! \param[in] status Cell solving status for parallel free-surface detection
void assign_solving_status(bool status) { solving_status_ = status; }

//! Return solving status of a cell: active (if a particle is present in all
//! MPI rank)
//! \ingroup MultiPhase
bool solving_status() const { return solving_status_; }

//! Assign free surface
//! \ingroup MultiPhase
//! \param[in] free_surface boolean indicating free surface cell
void assign_free_surface(bool free_surface) { free_surface_ = free_surface; };

//! Return free surface bool
//! \ingroup MultiPhase
//! \retval free_surface_ indicating free surface cell
bool free_surface() const { return free_surface_; };

//! Assign volume traction to node
//! \ingroup MultiPhase
//! \param[in] volume_fraction cell volume fraction
void assign_volume_fraction(double volume_fraction) {
volume_fraction_ = volume_fraction;
bodhinandach marked this conversation as resolved.
Show resolved Hide resolved
};

//! Return cell volume fraction
//! \ingroup MultiPhase
//! \retval volume_fraction_ cell volume fraction
double volume_fraction() const { return volume_fraction_; };

//! Map cell volume to the nodes
//! \ingroup MultiPhase
//! \param[in] phase to map volume
void map_cell_volume_to_nodes(unsigned phase);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this affect GIMP and other non-local algorithms?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... That's a good point, but I don't think the free-surface detection can be used for non-local MPM yet in general, so I am expecting this function won't work well too for non-local MPM.


/**@}*/

private:
//! Approximately check if a point is in a cell
//! \param[in] point Coordinates of point
Expand Down Expand Up @@ -264,11 +308,17 @@ class Cell {
//! Normal of face
//! first-> face_id, second->vector of the normal
std::map<unsigned, Eigen::VectorXd> face_normals_;
//! Solving status
bool solving_status_{false};
//! Free surface bool
bool free_surface_{false};
//! Volume fraction
double volume_fraction_{0.0};
//! Logger
std::unique_ptr<spdlog::logger> console_;
}; // Cell class
} // namespace mpm

#include "cell.tcc"

#endif // MPM_CELL_H_
#endif // MPM_CELL_H_
16 changes: 15 additions & 1 deletion include/cell.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ inline Eigen::Matrix<double, 2, 1> mpm::Cell<2>::local_coordinates_point(
if (indices.size() == 3) {
// 2 0
// |\
// | \
// | \
// c | \ b
// | \
// | \
Expand Down Expand Up @@ -844,3 +844,17 @@ template <unsigned Tdim>
inline unsigned mpm::Cell<Tdim>::previous_mpirank() const {
return this->previous_mpirank_;
}

//! Map cell volume to nodes
template <unsigned Tdim>
void mpm::Cell<Tdim>::map_cell_volume_to_nodes(unsigned phase) {
if (this->status()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we doing this only for cells with particles? The function looks generic so adding this for only cells with particles looks strange. Could we instead pass it as a function argument?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only do this for cells with particles as otherwise, the nodes_->update_volume() will be called as many numbers as the MPI thread. Therefore, without checking the status(), we won't have the free_surface detection working in parallel.

// Check if cell volume is set
if (volume_ <= std::numeric_limits<double>::lowest())
this->compute_volume();

for (unsigned i = 0; i < nodes_.size(); ++i) {
nodes_[i]->update_volume(true, phase, volume_ / nnodes_);
}
}
}
bodhinandach marked this conversation as resolved.
Show resolved Hide resolved
11 changes: 11 additions & 0 deletions include/io/io_mesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,17 @@ class IOMesh {
virtual std::vector<Eigen::Matrix<double, 6, 1>> read_particles_stresses(
const std::string& particles_stresses) = 0;

//! Read particle scalar properties
//! \param[in] scalar_file file name with particle scalar properties
//! \retval Vector of particles scalar properties
virtual std::vector<std::tuple<mpm::Index, double>>
read_particles_scalar_properties(const std::string& scalar_file) = 0;

//! Read pressure constraints file
//! \param[in] pressure_constraints_files file name with pressure constraints
virtual std::vector<std::tuple<mpm::Index, double>> read_pressure_constraints(
const std::string& _pressure_constraints_file) = 0;

//! Read nodal euler angles file
//! \param[in] nodal_euler_angles_file file name with nodal id and respective
//! euler angles
Expand Down
12 changes: 12 additions & 0 deletions include/io/io_mesh_ascii.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,18 @@ class IOMeshAscii : public IOMesh<Tdim> {
std::vector<Eigen::Matrix<double, 6, 1>> read_particles_stresses(
const std::string& particles_stresses) override;

//! Read particle scalar properties
//! \param[in] scalar_file file name with particle scalar properties
//! \retval Vector of particles scalar properties
std::vector<std::tuple<mpm::Index, double>> read_particles_scalar_properties(
const std::string& scalar_file) override;

//! Read pressure constraints file
//! \param[in] pressure_constraints_files file name with pressure
//! constraints
std::vector<std::tuple<mpm::Index, double>> read_pressure_constraints(
const std::string& pressure_constraints_file) override;

//! Read nodal euler angles file
//! \param[in] nodal_euler_angles_file file name with nodal id and respective
//! euler angles
Expand Down
Loading