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] extended MPM #34

Draft
wants to merge 174 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
174 commits
Select commit Hold shift + click to select a range
90c00e1
:tada::sparkles:creat xmpm solver and ParticleXMPM class
yliang-sn Aug 1, 2020
06f4331
:construction: creat and initialise nodal properties for discontinuity
yliang-sn Aug 2, 2020
28c684f
:construction:update nodal properties function and update nodal enric…
yliang-sn Aug 2, 2020
8ba5a31
:construction:update:external force,internal force, compute strain rate
yliang-sn Aug 2, 2020
e5a61ed
:construction:apply velocity constraints discontinuity
yliang-sn Aug 2, 2020
07bd480
:construction:compute updated position
yliang-sn Aug 2, 2020
2beb5ac
:hammer:
yliang-sn Aug 3, 2020
2ddda95
:hammer::construction:self contact for XMPM and boundary condation
yliang-sn Aug 5, 2020
e4a1265
:hammer:move the node_xmpm function to a separate file
yliang-sn Aug 5, 2020
e185bb4
:bug:miss some functions for node_xmpm.tcc
yliang-sn Aug 5, 2020
c399266
:hammer:add const
yliang-sn Aug 5, 2020
cf3a06b
:construction:clang format
yliang-sn Aug 6, 2020
32b51bb
:constructor:discontinuity function
Aug 15, 2020
67ae1db
:hammer::construction:clean xmpmparticle class
Aug 16, 2020
6f9da8b
:hammer:change discontinuouty_point_line name
Aug 16, 2020
030993a
:hammer:separate the discontinuity functions into different files
Aug 16, 2020
f4792f4
:pencil::hammer::construction:clean up particleXMPM class
Aug 17, 2020
701cdd9
:pencil::hammer::construction:clean the discontinuity base class
Aug 17, 2020
7c58d82
:pencil:clean discontinuity3d class
Aug 17, 2020
c3ad208
:constructuin:assign friction coefficient for nodes
Aug 17, 2020
ce0c7b3
Update include/mesh.h
yliang-sn Aug 25, 2020
2d95f12
:tada::sparkles:creat xmpm solver and ParticleXMPM class
yliang-sn Aug 1, 2020
41a05a1
:construction: creat and initialise nodal properties for discontinuity
yliang-sn Aug 2, 2020
54e7b4d
:construction:update nodal properties function and update nodal enric…
yliang-sn Aug 2, 2020
332e940
:construction:update:external force,internal force, compute strain rate
yliang-sn Aug 2, 2020
c24c3f4
:construction:apply velocity constraints discontinuity
yliang-sn Aug 2, 2020
faec00b
:construction:compute updated position
yliang-sn Aug 2, 2020
d94e611
:hammer:
yliang-sn Aug 3, 2020
4a8deb6
:hammer::construction:self contact for XMPM and boundary condation
yliang-sn Aug 5, 2020
ab32ab3
:hammer:move the node_xmpm function to a separate file
yliang-sn Aug 5, 2020
d7a5c85
:bug:miss some functions for node_xmpm.tcc
yliang-sn Aug 5, 2020
3b9b316
:hammer:add const
yliang-sn Aug 5, 2020
fee31b7
:construction:clang format
yliang-sn Aug 6, 2020
835db0a
:constructor:discontinuity function
Aug 15, 2020
201f6cf
:hammer::construction:clean xmpmparticle class
Aug 16, 2020
c1850df
:hammer:change discontinuouty_point_line name
Aug 16, 2020
6494559
:hammer:separate the discontinuity functions into different files
Aug 16, 2020
8152840
:pencil::hammer::construction:clean up particleXMPM class
Aug 17, 2020
71179ea
:pencil::hammer::construction:clean the discontinuity base class
Aug 17, 2020
435dccd
:pencil:clean discontinuity3d class
Aug 17, 2020
a62c285
:constructuin:assign friction coefficient for nodes
Aug 17, 2020
684f192
Update include/mesh.h
yliang-sn Aug 25, 2020
f1f6af3
:pencil::construction:delete the compute_strain function in XMPM
Aug 28, 2020
7869f64
:hammer:modify the solver scheme
Aug 31, 2020
91ff382
:hammer:use assert instead of if
Aug 31, 2020
84158b6
:hammer:update some comments and fix some code
Sep 1, 2020
f8cb643
:hammer:
Sep 1, 2020
0c86c24
:construction:xmpm solver test functions for 3d
Sep 7, 2020
2734df6
:construction:particle_xmpm test functions
Sep 7, 2020
85a8d68
:construction:check discontinuity in mesh
Sep 7, 2020
66332b0
add width of the discontinuity
Oct 1, 2020
48755b6
:construction:assign the levelset width and coefficient
Oct 4, 2020
ff7ff15
:construction:node_xmpm test functions
Oct 4, 2020
3be07a8
:hammer:modify node default enriched type
Oct 4, 2020
c2d9142
:hammer:modify the level set computation
Oct 4, 2020
44afbe0
:construction:output level set values
Oct 4, 2020
0af8791
:hammer:fix the issue about friction coefficient
Oct 5, 2020
8decf2b
:construction:compute the principal stress and strain
Oct 5, 2020
77b115f
Merge remote-tracking branch 'origin/refactor/resume' into solver/xmpm
Oct 5, 2020
2d64ccd
:hammer:velocity update by the enriched nodes
Oct 6, 2020
2372c0a
Merge remote-tracking branch 'origin/refactor/resume' into solver/xmpm
Oct 6, 2020
026ca2a
xmpm solver
yliang-sn Sep 8, 2021
c4140ea
xmpm solver
yliang-sn Sep 8, 2021
edf16fc
merge develop
yliang-sn Sep 8, 2021
512a160
clean oso part
yliang-sn Oct 7, 2021
8ce7850
clean oso hardcode
yliang-sn Oct 7, 2021
a71f048
clean hard code
yliang-sn Oct 8, 2021
3f8f0b0
Update cell.h
yliang-sn Oct 8, 2021
8316654
apply the clang format
yliang-sn Oct 8, 2021
8b5f813
make a separate file mesh_xmpm
yliang-sn Oct 18, 2021
b9d6385
find the cells at nodes
yliang-sn Oct 20, 2021
26291c8
make a separate file cell_xmpm.tcc
yliang-sn Oct 20, 2021
9aa5404
tidy the mark points generation
yliang-sn Oct 20, 2021
91fe5d5
merge master into xmpm
yliang-sn Oct 21, 2021
0ba0c01
solve the conflicts about hdf5
yliang-sn Oct 21, 2021
2462fe8
tidy the code and comments
yliang-sn Nov 3, 2021
138dd64
merge master into solver/xmpm
yliang-sn Nov 3, 2021
98d5aa3
add P3DXMPM particle type
yliang-sn Nov 4, 2021
128ea5c
clang formating
bodhinandach Nov 4, 2021
50138ee
clean the unsed variables
yliang-sn Nov 5, 2021
4f7965d
Merge branch 'xmpm_crackbranch' into solver/xmpm
yliang-sn Nov 5, 2021
b178b13
clean the unsed variables
yliang-sn Nov 5, 2021
f27b51c
clean the unsed variables
yliang-sn Nov 5, 2021
5aa3fbd
fix particle cc
bodhinandach Nov 5, 2021
730b803
Merge branch 'solver/xmpm' of https://github.com/geomechanics/mpm int…
yliang-sn Nov 5, 2021
652dec6
remove hardcode in mohr_coulomb.tcc
yliang-sn Nov 5, 2021
7daa8d8
remove typo
yliang-sn Nov 5, 2021
170658c
update write_mesh_particles.cc
yliang-sn Nov 5, 2021
99179d8
update write_mesh_particles.cc
yliang-sn Nov 5, 2021
302708d
resolve bugs in test part
yliang-sn Nov 5, 2021
708682d
define XMPM group for XMPM functions and variables
yliang-sn Nov 6, 2021
93497aa
add comment "\ingroup XMPM" and initialise_xmpm function
yliang-sn Nov 6, 2021
76fbda1
delete discontinuity_enrich_ initialization in the node.tcc
yliang-sn Nov 7, 2021
1bb55d5
defgroup xmpm
yliang-sn Nov 7, 2021
3b72509
tidy the code
yliang-sn Nov 7, 2021
288371e
add the pod_particle_xmpm class
yliang-sn Nov 7, 2021
66da947
Merge branch 'master' of https://github.com/geomechanics/mpm into sol…
yliang-sn Nov 15, 2021
533f5f8
clang format
bodhinandach Nov 16, 2021
70112b5
xmpm modification after discussions
bodhinandach Nov 17, 2021
ecb6523
Merge branch 'master' into solver/xmpm
yliang-sn Nov 18, 2021
7f2a4c5
fix mpi bug
yliang-sn Nov 19, 2021
72cda05
add build* in the gitignore file
yliang-sn Nov 19, 2021
cf74a4c
build class NodeXMPM
yliang-sn Nov 24, 2021
e94af7c
fix momentum computation bug
yliang-sn Dec 2, 2021
2f3c90c
refactor the input
yliang-sn Dec 7, 2021
5861c38
construction of the XMPM framework
yliang-sn Feb 10, 2022
5fbd843
Merge branch 'master' into xmpm-branch
yliang-sn Feb 10, 2022
d1a1fa8
contact detection criterion 2
yliang-sn Feb 11, 2022
0c39cd6
determine the cell type for each discontinuity with the node level se…
yliang-sn Feb 12, 2022
a6047c9
swithch to use function compute_elastic_tensor and compute_elasto_pla…
yliang-sn Feb 12, 2022
55372a3
remove debug code
yliang-sn Feb 13, 2022
f8a50b6
move unsed variables and functions
yliang-sn Feb 13, 2022
fa144ed
update nodal level set values
yliang-sn Feb 20, 2022
9b2488f
construction
yliang-sn Feb 20, 2022
65c4ae6
construction
yliang-sn Feb 20, 2022
f656347
remove unused functions and adjust the order
yliang-sn Feb 21, 2022
9596cac
add mls to compute the nodal level set values
yliang-sn Feb 25, 2022
2197fa9
Cleanup git and cmakelist
bodhinandach Feb 25, 2022
cac768b
Make elastic plastic tensor calculation public
bodhinandach Feb 25, 2022
92519ab
Add minor modifications
bodhinandach Feb 25, 2022
440c0c4
revert apply_velocity_constraints to pure virtual
bodhinandach Feb 25, 2022
b082bda
Some cleanups
bodhinandach Feb 25, 2022
42a88ac
minor correction until initialization
bodhinandach Feb 26, 2022
1f6db40
finish initiation_discontinuity
bodhinandach Feb 27, 2022
f4d38bc
Finishing check without propagation
bodhinandach Feb 27, 2022
0d47e70
Commit 1 for propagation of discontinuity
bodhinandach Feb 28, 2022
268629f
Commit 2 of propagation of discontinuity
bodhinandach Feb 28, 2022
02a898b
add mls option in the input file
yliang-sn Feb 28, 2022
855c2b7
perform initialise after initiation
yliang-sn Feb 28, 2022
baa7214
refactor to add usl/usf/musl option
yliang-sn Mar 1, 2022
d47e787
add musl option 2
yliang-sn Mar 1, 2022
5641025
Fix error in velocity/displacement update in explicit XMPM solver
yliang-sn Mar 1, 2022
319ce31
add irregular cell and fix a bug in check particle levelset function
yliang-sn Mar 1, 2022
e320983
merge master into xmpm-branch
yliang-sn Mar 1, 2022
35c6e91
out put in XMPM Solver
yliang-sn Mar 1, 2022
64cc03f
Merge branch 'master' into xmpm-branch
yliang-sn Mar 2, 2022
c450f90
fix bug in displacement update in xmpm
yliang-sn Mar 2, 2022
7b70a30
small bug to determine the initiation region
yliang-sn Mar 3, 2022
66bd670
don't update cell type after inserting mark points
yliang-sn Mar 4, 2022
7183f3f
modify single to multiple for spurious potential tip cell
yliang-sn Mar 7, 2022
172b4ba
Merge branch 'xmpm-branch' into xmpm-interaction
yliang-sn Mar 7, 2022
f2e020b
adjust the order of discontinuity search and update for multiple she…
yliang-sn Mar 7, 2022
14735de
create point class
yliang-sn Mar 8, 2022
ab00445
Merge branch 'master-point' into xmpm-interaction
yliang-sn Mar 8, 2022
f021f56
define variables list for point class
yliang-sn Mar 8, 2022
ac07f3e
Merge branch 'master-point' into xmpm-interaction
yliang-sn Mar 8, 2022
e57b7d2
change output name of points
yliang-sn Mar 8, 2022
8612256
Merge branch 'master-point' into xmpm-interaction
yliang-sn Mar 8, 2022
26e68f2
fix bug: input parameters in the function
yliang-sn Mar 8, 2022
cd6d611
Merge branch 'master-point' into xmpm-interaction
yliang-sn Mar 8, 2022
9b66da7
add variables in pointbase class
yliang-sn Mar 8, 2022
a6a4803
Merge branch 'master-point' into xmpm-interaction
yliang-sn Mar 8, 2022
e1bccda
fix error
yliang-sn Mar 9, 2022
8731c37
Merge branch 'master-point' into xmpm-interaction
yliang-sn Mar 9, 2022
2394798
define the parameters to const
yliang-sn Mar 9, 2022
1cae4bb
Merge branch 'master-point' into xmpm-interaction
yliang-sn Mar 9, 2022
a1bc394
create discontinuity point class instead of structure
yliang-sn Mar 9, 2022
5b0bcec
clean duplicate code in pointbase construction function
yliang-sn Mar 9, 2022
4c214da
output discontinuity point in XMPM solver
yliang-sn Mar 9, 2022
460f2b4
add option to output discontinuity_id for discontinuity points
yliang-sn Mar 10, 2022
054e1ba
interaction strategy for multiple shear band
yliang-sn Mar 11, 2022
9842a8f
termination of the discontinuity propagation
yliang-sn Mar 15, 2022
218fb56
interaction between discontinuities
yliang-sn Mar 17, 2022
fe6eb04
merge with master
yliang-sn Sep 3, 2022
eeaf5f1
merge with master
yliang-sn Sep 3, 2022
ed34610
OpenMP Works correctly
bodhinandach Sep 4, 2022
97eee3f
Some optimizations
bodhinandach Sep 11, 2022
b342f1f
major refactor for mesh_xmpm
bodhinandach Sep 12, 2022
9d39cba
optimize cell node and particle xmpm
bodhinandach Sep 12, 2022
b21ebf2
OMP work in progress:optimization and fix an assign node type bug in …
yliang-sn Sep 19, 2022
29dc37e
fix a bug: detect the node type and assign the correct discontinuity id
yliang-sn Sep 21, 2022
9e7ccb6
Merge branch 'master' of https://github.com/geomechanics/mpm into xmp…
bodhinandach Sep 25, 2022
3d2c044
Make codecov works
bodhinandach Sep 25, 2022
f78245a
test functions in progress
yliang-sn Oct 10, 2022
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
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,10 @@ include_directories(BEFORE
${mpm_SOURCE_DIR}/include/solvers/
${mpm_SOURCE_DIR}/include/solvers/mpm_scheme/
${mpm_SOURCE_DIR}/include/utilities/
${mpm_SOURCE_DIR}/include/xmpm/
${mpm_SOURCE_DIR}/external/
${mpm_SOURCE_DIR}/tests/include/
${mpm_SOURCE_DIR}/include/points/
)

# mpm executable
Expand All @@ -186,6 +188,7 @@ SET(mpm_src
${mpm_SOURCE_DIR}/src/geometry.cc
${mpm_SOURCE_DIR}/src/pod_particle.cc
${mpm_SOURCE_DIR}/src/pod_particle_twophase.cc
${mpm_SOURCE_DIR}/src/pod_particle_xmpm.cc
${mpm_SOURCE_DIR}/src/io/io.cc
${mpm_SOURCE_DIR}/src/io/io_mesh.cc
${mpm_SOURCE_DIR}/src/io/logger.cc
Expand All @@ -198,6 +201,8 @@ SET(mpm_src
${mpm_SOURCE_DIR}/src/node.cc
${mpm_SOURCE_DIR}/src/particle.cc
${mpm_SOURCE_DIR}/src/quadrature.cc
${mpm_SOURCE_DIR}/src/discontinuity.cc
${mpm_SOURCE_DIR}/src/point.cc
)
add_executable(mpm ${mpm_SOURCE_DIR}/src/main.cc ${mpm_src} ${mpm_vtk})

Expand Down Expand Up @@ -299,6 +304,7 @@ if(MPM_BUILD_TESTING)
${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_scheme_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
Expand All @@ -311,6 +317,12 @@ if(MPM_BUILD_TESTING)
${mpm_SOURCE_DIR}/tests/solvers/mpm_semi_implicit_navierstokes_unitcell_test.cc
${mpm_SOURCE_DIR}/tests/solvers/mpm_semi_implicit_twophase_test.cc
${mpm_SOURCE_DIR}/tests/solvers/mpm_semi_implicit_twophase_unitcell_test.cc
${mpm_SOURCE_DIR}/tests/solvers/xmpm_explicit_usf_test.cc
${mpm_SOURCE_DIR}/tests/solvers/xmpm_explicit_usf_unitcell_test.cc
${mpm_SOURCE_DIR}/tests/solvers/xmpm_explicit_usl_test.cc
${mpm_SOURCE_DIR}/tests/solvers/xmpm_explicit_usl_unitcell_test.cc
${mpm_SOURCE_DIR}/tests/solvers/xmpm_explicit_musl_test.cc
${mpm_SOURCE_DIR}/tests/solvers/xmpm_explicit_musl_unitcell_test.cc
)
add_executable(mpmtest_unit ${mpm_src} ${test_src_unit})
add_executable(mpmtest_small ${mpm_src} ${test_src_small})
Expand Down
180 changes: 180 additions & 0 deletions include/cells/cell.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@
#include "Eigen/LU"

#include "affine_transform.h"
#include "discontinuity_element.h"
#include "element.h"
#include "geometry.h"
#include "logger.h"
#include "map.h"
#include "node_base.h"
#include "node_xmpm.h"
#include "quadrature.h"

namespace mpm {
Expand Down Expand Up @@ -217,6 +219,172 @@ class Cell {
//! Return previous mpi rank
unsigned previous_mpirank() const;

/**
* \defgroup XMPM Functions dealing with XMPM
*/
/**@{*/

//! Assign discontinuity element type
//! \ingroup XMPM
//! \param[in] the enriched type
//! \param[in] dis_id the discontinuity id
void assign_discontinuity_type(mpm::EnrichType type, unsigned dis_id);

//! Initialize discontinuity element properties
//! \ingroup XMPM
void initialise_element_properties_discontinuity();

//! Assign the normal direction of the discontinuity in the cell
//! \ingroup XMPM
//! \param[in] the normal direction
void assign_normal_discontinuity(VectorDim normal, unsigned dis_id);

//! Assign the constant parameters of the discontinuity in the cell
//! \ingroup XMPM
//! \param[in] the constant parameters
//! \param[in] dis_id the discontinuity id
void assign_d_discontinuity(double d, unsigned dis_id) {
this->discontinuity_element_[dis_id]->assign_d(d);
};

//! Assign the normal direction of the discontinuity in the cell
//! \ingroup XMPM
//! \param[in] the normal direction
//! \param[in] the plane constant
//! \param[in] dis_id the discontinuity id
void assign_normal_discontinuity(VectorDim normal, double d, unsigned dis_id);

//! Return the normal direction of the discontinuity in the cell
//! \ingroup XMPM
//! \retval the normal direction of the discontinuity
//! \param[in] the number of the discontinuity
VectorDim normal_discontinuity(unsigned dis_id) {
if (discontinuity_element_[dis_id] == nullptr)
return Eigen::Matrix<double, Tdim, 1>::Zero();
return discontinuity_element_[dis_id]->normal_discontinuity();
};

//! Return discontinuity element type
//! \ingroup XMPM
//! \param[in] discontinuity id
unsigned element_discontinuity_type(unsigned dis_id);

//! Find the potential tip element
//! \ingroup XMPM
//! \param[in] discontinuity id
void find_potential_tip_cell(unsigned dis_id);

//! Determine tip element
//! \ingroup XMPM
//! \param[in] discontinuity id
void find_tip_cell(unsigned dis_id);

//! Compute normal vector of discontinuity by the nodal level set values
//! \ingroup XMPM
//! \param[in] discontinuity id
void compute_normal_vector_discontinuity(unsigned dis_id);

//! Compute the discontinuity plane by the nodal level set values
//! \ingroup XMPM
//! \param[in] true: compute by the enriched nodes
//! \param[in] discontinuity id
void compute_plane_discontinuity(bool enrich, unsigned dis_id);

//! Compute the discontinuity point: the average coordinates of the
//! \ingroup XMPM
//! \param[in] mark points list
//! \param[in] the id of the discontinuity
void compute_discontinuity_point(std::vector<VectorDim>& coordinates,
unsigned dis_id);

//! Return the product of the maximum and minimum nodal level set value
//! \ingroup XMPM
//! \param[in] discontinuity id
//! \retval the product of the maximum and minimum nodal level set value
double product_levelset(unsigned dis_id);

//! Return the constant value of the discontinuity plane
//! \ingroup XMPM
//! \param[in] discontinuity id
double d_discontinuity(unsigned dis_id) {
return this->discontinuity_element_[dis_id]->d_discontinuity();
}

//! Determine the celltype by the nodal level set
//! \ingroup XMPM
//! \param[in] discontinuity id
void determine_crossed_cell(unsigned dis_id);

//! Compute the nodal level set values by plane equations
//! \ingroup XMPM
//! \param[in] discontinuity id
void compute_nodal_levelset_equation(unsigned dis_id);

//! Compute the area of the discontinuity
//! \ingroup XMPM
void compute_area_discontinuity(unsigned dis_id);

//! Return the area of the discontinuity
//! \ingroup XMPM
//! \param[in] discontinuity id
double discontinuity_area(unsigned dis_id) {
return this->discontinuity_element_[dis_id]->area();
}

//! Assign the area of the discontinuity to nodes
//! \ingroup XMPM
//! \param[in] discontinuity id
void assign_cohesion_area(unsigned dis_id);

//! Reset the size of the discontinuity
//! \ingroup XMPM
//! \param[in] the number of the discontinuity
void reset_discontinuity_size(int size) {
discontinuity_element_.resize(size, nullptr);
};

//! Assign interaction element type
//! \param[in] the interaction type
void assign_interaction_type(unsigned dis_id, mpm::InteractionType type) {
std::lock_guard<std::mutex> guard(cell_mutex_);
this->discontinuity_element_[dis_id]->assign_interaction_type(type);
}

//! Return interaction element type
//! \retval the interaction type
unsigned interaction_type(unsigned dis_id) {
if (discontinuity_element_[dis_id] == nullptr)
return mpm::InteractionType::Propagate;
return this->discontinuity_element_[dis_id]->interaction_type();
}

//! Return the maximum displacement
//! \param[in] the number of the discontinuity
//! \retval the maximum displacement
double max_dudx(unsigned dis_id) {
return this->discontinuity_element_[dis_id]->max_dudx();
}

//! Assign the maximum displacement
//! \param[in] max_dudx the maximum displacement
//! \param[in] the number of the discontinuity
void assign_max_dudx(double max_dudx, unsigned dis_id) {
this->discontinuity_element_[dis_id]->assign_max_dudx(max_dudx);
}

//! Return the discontinuity id which can propagates in this cell
//! \retval discontinuity id
unsigned dis_id() { return dis_id_; }

//! Assign the discontinuity id which can propagates in this cell
//! \param[in] dis_id discontinuity id
void assign_dis_id(unsigned dis_id) {
std::lock_guard<std::mutex> guard(cell_mutex_);
dis_id_ = dis_id;
}

/**@}*/

/**
* \defgroup Implicit Functions dealing with implicit MPM
*/
Expand Down Expand Up @@ -526,6 +694,17 @@ class Cell {
std::vector<Eigen::MatrixXd> correction_matrix_twophase_;
/**@}*/

/**
* \defgroup XMPM Variables for XMPM
*/
/**@{*/
//! discontinuity element list
std::vector<std::shared_ptr<DiscontinuityElement<Tdim>>>
discontinuity_element_{nullptr};
//! discontinuity id which propagates normally in this cell
unsigned dis_id_;
/**@}*/

//! Logger
std::unique_ptr<spdlog::logger> console_;
}; // Cell class
Expand All @@ -534,5 +713,6 @@ class Cell {
#include "cell.tcc"
#include "cell_implicit.tcc"
#include "cell_multiphase.tcc"
#include "cell_xmpm.tcc"

#endif // MPM_CELL_H_
2 changes: 2 additions & 0 deletions include/cells/cell.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ bool mpm::Cell<Tdim>::initialise() {
dn_dx_centroid_ = element_->dn_dx(xi_centroid, this->nodal_coordinates_,
zero, identity_matrix);

dis_id_ = std::numeric_limits<unsigned>::max();

status = true;
} else {
throw std::runtime_error(
Expand Down
Loading