21 #include <Eigen/Eigen> 24 using namespace Eigen;
47 double solidlo[3], solidhi[3];
48 double solidsublo[3], solidsubhi[3];
50 vector<Eigen::Vector3d>
x;
51 vector<Eigen::Vector3d>
x0;
54 vector<Eigen::Vector3d>
rp;
55 vector<Eigen::Vector3d>
rp0;
56 vector<Eigen::Vector3d>
xpc;
57 vector<Eigen::Vector3d>
xpc0;
60 vector<Eigen::Vector3d>
v;
63 vector<Eigen::Vector3d>
a;
65 vector<Eigen::Vector3d>
mbp;
66 vector<Eigen::Vector3d>
f;
71 vector<Eigen::Matrix3d>
L;
72 vector<Eigen::Matrix3d>
F;
73 vector<Eigen::Matrix3d>
R;
74 vector<Eigen::Matrix3d>
D;
75 vector<Eigen::Matrix3d>
Finv;
76 vector<Eigen::Matrix3d>
Fdot;
77 vector<Eigen::Matrix3d>
Di;
107 vector<vector< Eigen::Vector3d >>
wfd_pn;
108 vector<vector< Eigen::Vector3d >>
wfd_np;
121 void options(vector<string> *, vector<string>::iterator);
124 void compute_mass_nodes(
bool);
125 void compute_velocity_nodes(
bool);
126 void compute_velocity_nodes_APIC(
bool);
127 void compute_external_forces_nodes(
bool);
128 void compute_internal_forces_nodes_TL();
129 void compute_internal_forces_nodes_UL(
bool);
130 void compute_particle_velocities_and_positions();
131 void compute_particle_acceleration();
132 void update_particle_velocities(
double);
133 void compute_rate_deformation_gradient_TL();
136 void compute_rate_deformation_gradient_TL_APIC();
137 void compute_rate_deformation_gradient_UL_USL();
138 void compute_rate_deformation_gradient_UL_MUSL();
139 void compute_rate_deformation_gradient_UL_APIC();
140 void update_deformation_gradient();
141 void update_stress();
142 void compute_inertia_tensor(
string);
143 void compute_deformation_gradient();
144 void update_particle_domain();
146 void copy_particle(
int,
int);
147 void pack_particle(
int, vector<double> &);
150 void unpack_particle(
int &, vector<int>,
double[]);
153 void populate(vector<string>);
154 void read_mesh(
string);
155 void read_file(
string);
157 const map<string, string> usage ={
158 {
"region",
"Usage: solid(solid-ID, \033[1;32mregion\033[0m, region-ID, N_ppc1D, material-ID, cell-size, T0)\n"},
159 {
"mesh",
"Usage: solid(solid-ID, \033[1;32mmesh\033[0m, meshfile, material-ID, h, T0)\n"},
160 {
"file",
"Usage: solid(solid-ID, \033[1;32mfile\033[0m, filename, material-ID, h, T0)\n"}
162 const map<string, int> Nargs = {
vector< double > damage_init
Particles' damage initiation variable.
Definition: solid.h:88
vector< vector< Eigen::Vector3d > > wfd_np
Array of arrays (matrix) of the derivative of the weight functions effectively the transpose of wfd_...
Definition: solid.h:108
vector< Eigen::Matrix3d > vol0PK1
Transpose of the 1st Piola-Kirchhoff matrix times vol0.
Definition: solid.h:70
vector< double > T
Particles' temperature.
Definition: solid.h:89
vector< Eigen::Matrix3d > sigma
Stress matrix.
Definition: solid.h:68
string method_type
Either tlmpm, tlcpdi, tlcpdi2, ulmpm, ulcpdi, or ulcpdi2 (all kinds of MPM supported) ...
Definition: solid.h:115
vector< Eigen::Vector3d > v
Particles' current velocity.
Definition: solid.h:60
void init(double *, double *)
Create the array of nodes. Give them their position, tag, and type.
Definition: grid.cpp:79
vector< vector< double > > wf_pn
Array of arrays (matrix) of the weight functions .
Definition: solid.h:103
vector< vector< int > > neigh_pn
List of the nodes neighbouring a given particle.
Definition: solid.h:100
vector< vector< Eigen::Vector3d > > wfd_pn
Array of arrays (matrix) of the derivative of the weight functions .
Definition: solid.h:107
vector< double > eff_plastic_strain_rate
Particles' effective plastic strain rate.
Definition: solid.h:86
vector< vector< double > > wf_np
Array of arrays (matrix) of the weight functions effectively the transpose of wf_pn.
Definition: solid.h:104
vector< double > J
Determinant of the deformation matrix.
Definition: solid.h:79
vector< Eigen::Vector3d > a
Particles' acceleration.
Definition: solid.h:63
vector< Eigen::Vector3d > f
Particles' internal forces.
Definition: solid.h:66
vector< Eigen::Matrix3d > Fdot
Rate of deformation gradient matrix.
Definition: solid.h:76
vector< Eigen::Matrix3d > L
Velocity gradient matrix.
Definition: solid.h:71
vector< Eigen::Vector3d > x
Particles' current position.
Definition: solid.h:50
vector< Eigen::Matrix3d > F
Deformation gradient matrix.
Definition: solid.h:72
vector< double > vol
Particles' current volume.
Definition: solid.h:81
vector< tagint > ptag
Unique identifier for particles in the system.
Definition: solid.h:45
string id
Solid id.
Definition: solid.h:38
vector< double > rho0
Particles' reference density.
Definition: solid.h:82
vector< Eigen::Matrix3d > D
Symmetric part of L.
Definition: solid.h:74
bigint np
Total number of particles in the domain.
Definition: solid.h:39
double mtot
Total mass.
Definition: solid.h:43
vector< Eigen::Vector3d > rp0
Reference domain vector (CPDI1)
Definition: solid.h:55
double vtot
Total volume.
Definition: solid.h:42
vector< int > numneigh_np
Number of nodes neighbouring a given node.
Definition: solid.h:99
int comm_n
Number of double to pack for particle exchange between CPU.
Definition: solid.h:41
vector< double > rho
Particles' current density.
Definition: solid.h:83
vector< double > damage
Particles' damage variable.
Definition: solid.h:87
int nc
Number of corners per particles: .
Definition: solid.h:58
vector< Eigen::Matrix3d > R
Rotation matrix.
Definition: solid.h:73
vector< double > mass
Particles' current mass.
Definition: solid.h:84
vector< int > mask
Particles' group mask.
Definition: solid.h:92
vector< Eigen::Vector3d > v_update
Particles' velocity at time t+dt.
Definition: solid.h:61
vector< double > pH_regu
Particles' regularized hydrostatic pressure.
Definition: solid.h:91
vector< double > eff_plastic_strain
Particles' effective plastic strain.
Definition: solid.h:85
vector< Eigen::Vector3d > rp
Current domain vector (CPDI1)
Definition: solid.h:54
vector< int > numneigh_pn
Number of nodes neighbouring a given particle.
Definition: solid.h:98
vector< Eigen::Vector3d > x0
Particles' reference position.
Definition: solid.h:51
vector< Eigen::Matrix3d > Finv
Inverse of the deformation gradient matrix.
Definition: solid.h:75
class Grid * grid
Pointer to the background grid.
Definition: solid.h:113
vector< vector< double > > wf_pn_corners
Array of arrays (matrix) of the weight functions evaluated at the corners of the particle's domain (...
Definition: solid.h:105
Definition: material.h:45
vector< Eigen::Vector3d > xpc
Current position of the corners of the particles' domain (CPDI2o)
Definition: solid.h:56
vector< Eigen::Matrix3d > strain_el
Elastic strain matrix.
Definition: solid.h:69
vector< Eigen::Vector3d > xpc0
Reference position of the corners of the particles' domain (CPDI2)
Definition: solid.h:57
Definition: pointers.h:29
vector< Eigen::Vector3d > mbp
Particles' external forces times mass.
Definition: solid.h:65
vector< vector< int > > neigh_np
List of the particles neighbouring a given node.
Definition: solid.h:101
int np_local
Number of local particles (in this CPU)
Definition: solid.h:40
double max_p_wave_speed
Maximum of the particle wave speed.
Definition: solid.h:95
struct Mat * mat
Pointer to the material.
Definition: solid.h:111
void grow(int)
Allocate memory for the vectors used for local nodes or resize them.
Definition: grid.cpp:460
vector< Eigen::Matrix3d > Di
Inertia tensor.
Definition: solid.h:77
vector< double > ienergy
Particles' internal energy.
Definition: solid.h:90
vector< double > vol0
Particles' reference volume.
Definition: solid.h:80