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

strain softening #106

Merged
merged 42 commits into from
Apr 13, 2023
Merged
Show file tree
Hide file tree
Changes from 39 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
1cc975f
strain softening from interfaces.txt working for cohesion and frictio…
jamisonassuncao Mar 9, 2023
f84a85a
read weakening_seed from interfaces.txt and if negative, use initial …
jamisonassuncao Mar 9, 2023
90c2396
calc_visc checks if strain softenins is from interfaces.txt or comman…
jamisonassuncao Mar 10, 2023
51ccb85
small if correction
jamisonassuncao Mar 11, 2023
7fc2274
fixed problem where interfaces.txt required strain softening paramete…
jamisonassuncao Mar 16, 2023
4a94c21
uses weakening_min as weakening_seed if no parameters are given in th…
jamisonassuncao Mar 16, 2023
1ffdf59
small changes
jamisonassuncao Mar 22, 2023
dde063a
add missing 'make all' command to build mandyoc image (#110)
rafaelmds Mar 31, 2023
c7b811d
fix typo in line break character (#111)
rafaelmds Mar 31, 2023
6029915
change order of parse options function (#112)
rafaelmds Mar 31, 2023
ae5d56c
strain softening from interfaces.txt working for cohesion and frictio…
jamisonassuncao Mar 9, 2023
c2b489c
read weakening_seed from interfaces.txt and if negative, use initial …
jamisonassuncao Mar 9, 2023
74bff6d
calc_visc checks if strain softenins is from interfaces.txt or comman…
jamisonassuncao Mar 10, 2023
ea7933a
small if correction
jamisonassuncao Mar 11, 2023
68b04dd
fixed problem where interfaces.txt required strain softening paramete…
jamisonassuncao Mar 16, 2023
3cb3ddf
uses weakening_min as weakening_seed if no parameters are given in th…
jamisonassuncao Mar 16, 2023
b8313cb
small changes
jamisonassuncao Mar 22, 2023
aa5bc76
fixed previous issues where the interfaces files was read incorrectly…
jamisonassuncao Apr 1, 2023
1802f39
Merge branch 'strain-softening' of https://github.com/ggciag/mandyoc …
jamisonassuncao Apr 1, 2023
c9dc35e
calc_visc conflict solving
jamisonassuncao Apr 1, 2023
96b259e
solved conflict with SMSwarm_3d.cpp
jamisonassuncao Apr 1, 2023
d0e90ac
fix check of number of layers read from seed command and interfaces f…
rafaelmds Apr 3, 2023
cc722d8
strain softening from interfaces.txt working for cohesion and frictio…
jamisonassuncao Mar 9, 2023
5bed887
read weakening_seed from interfaces.txt and if negative, use initial …
jamisonassuncao Mar 9, 2023
f2259d5
calc_visc checks if strain softenins is from interfaces.txt or comman…
jamisonassuncao Mar 10, 2023
fca5895
small if correction
jamisonassuncao Mar 11, 2023
e766367
fixed problem where interfaces.txt required strain softening paramete…
jamisonassuncao Mar 16, 2023
1470938
uses weakening_min as weakening_seed if no parameters are given in th…
jamisonassuncao Mar 16, 2023
0df5729
small changes
jamisonassuncao Mar 22, 2023
7eae1d8
fixed previous issues where the interfaces files was read incorrectly…
jamisonassuncao Apr 1, 2023
90d5e04
strain softening from interfaces.txt working for cohesion and frictio…
jamisonassuncao Mar 9, 2023
74dfd1a
read weakening_seed from interfaces.txt and if negative, use initial …
jamisonassuncao Mar 9, 2023
dba714f
calc_visc checks if strain softenins is from interfaces.txt or comman…
jamisonassuncao Mar 10, 2023
fd028f3
small if correction
jamisonassuncao Mar 11, 2023
353e56f
fixed problem where interfaces.txt required strain softening paramete…
jamisonassuncao Mar 16, 2023
026675b
solved small conflict
jamisonassuncao Apr 3, 2023
11c8915
Merge branch 'strain-softening' of https://github.com/ggciag/mandyoc …
jamisonassuncao Apr 3, 2023
7ec985e
fixed weakening arrays construction
jamisonassuncao Apr 3, 2023
82b0cfd
default weakening start value is 0.0
jamisonassuncao Apr 3, 2023
2d7391c
Update src/reader.cpp to truncate friction angle values
jamisonassuncao Apr 10, 2023
4c2814c
set default weakening_seed to be set by rand_r()
jamisonassuncao Apr 11, 2023
35db50d
documentation + reference changing
jamisonassuncao Apr 11, 2023
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 docker/mandyoc/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ COPY --chown=${USER}:${USER} . ${MANDYOC_DIR}
RUN mkdir -p ${HOME}/.local/bin && \
cd ${MANDYOC_DIR} && \
make clear && \
make all && \
make install

# =============================================================================
Expand Down
38 changes: 15 additions & 23 deletions src/DMSwarm_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ extern PetscInt seed_layer_size;
extern PetscBool seed_layer_set;
extern PetscBool strain_seed_constant;

extern PetscBool weakening_from_interfaces_file;

// From param.txt and interfaces.txt
extern PetscInt WITH_NON_LINEAR;
extern PetscInt PLASTICITY;
extern PetscScalar *weakening_seed;
extern PetscScalar weakening_min;

extern PetscReal *strain_seed_layer;
extern PetscInt strain_seed_layer_size;
extern PetscBool strain_seed_layer_set;
Expand Down Expand Up @@ -442,31 +450,15 @@ PetscErrorCode createSwarm_2d()
layer_array[p] = n_interfaces;
}

// Load initial strain_array with weakening_seed to or random value
rand_r(&seed_strain);
strain_array[p]=random_initial_strain*(float)rand_r(&seed_strain)/RAND_MAX;

if (seed_layer_set == PETSC_TRUE) {
if (seed_layer_size == 1 && layer_array[p] == seed_layer[0]) {
if (strain_seed_constant == PETSC_TRUE) {
strain_array[p] = strain_seed_layer[0];
} else {
strain_array[p] += strain_seed_layer[0];
}
}
else {
for (int k = 0; k < seed_layer_size; k++) {
if (layer_array[p] == seed_layer[k]) {
if (strain_seed_constant == PETSC_TRUE) {
strain_array[p] = strain_seed_layer[k];
} else {
strain_array[p] += strain_seed_layer[k];
}
}
}
}
if (weakening_seed[layer_array[p]] >= 0) {
strain_array[p] = weakening_seed[layer_array[p]];
}
else
{
strain_array[p] = random_initial_strain*(float)rand_r(&seed_strain)/RAND_MAX;
}


}
}

Expand Down
32 changes: 11 additions & 21 deletions src/DMSwarm_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ extern PetscInt print_step_files;

extern PetscReal random_initial_strain;

// From param.txt and interfaces.txt
extern PetscInt WITH_NON_LINEAR;
extern PetscInt PLASTICITY;
extern PetscScalar *weakening_seed;

extern PetscInt *seed_layer;
extern PetscInt seed_layer_size;
Expand Down Expand Up @@ -475,28 +479,14 @@ PetscErrorCode createSwarm_3d()
//printf("entrei!\n");
}

// Load initial strain_array with weakening_seed to or random value
rand_r(&seed_strain);
strain_array[p]=random_initial_strain*(float)rand_r(&seed_strain)/RAND_MAX;

if (seed_layer_set == PETSC_TRUE) {
if (seed_layer_size == 1 && layer_array[p] == seed_layer[0]) {
if (strain_seed_constant == PETSC_TRUE) {
strain_array[p] = strain_seed_layer[0];
} else {
strain_array[p] += strain_seed_layer[0];
}
}
else {
for (int k = 0; k < seed_layer_size; k++) {
if (layer_array[p] == seed_layer[k]) {
if (strain_seed_constant == PETSC_TRUE) {
strain_array[p] = strain_seed_layer[k];
} else {
strain_array[p] += strain_seed_layer[k];
}
}
}
}
if (weakening_seed[layer_array[p]] >= 0) {
strain_array[p] = weakening_seed[layer_array[p]];
}
else
{
strain_array[p] = random_initial_strain*(float)rand_r(&seed_strain)/RAND_MAX;
}
/////!!!!
/*if (rank==0){
Expand Down
9 changes: 6 additions & 3 deletions src/DMSwarm_move.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ typedef struct {
} Stokes3d;

double calc_visco_ponto(double T, double P, double x, double z,double geoq_ponto,double e2_inva,double strain_cumulate,
double A, double n_exp, double QE, double VE);
double A, double n_exp, double QE, double VE, PetscInt layer_number);

extern DM dms;

Expand Down Expand Up @@ -383,7 +383,8 @@ PetscErrorCode moveSwarm(int dimensions, PetscReal dt)


rarray[p] = calc_visco_ponto(tp,Pp,cx,cz,inter_geoq[layer_array[p]],E2_invariant,strain_fac[p],
inter_A[layer_array[p]], inter_n[layer_array[p]], inter_Q[layer_array[p]], inter_V[layer_array[p]]);
inter_A[layer_array[p]], inter_n[layer_array[p]], inter_Q[layer_array[p]], inter_V[layer_array[p]], layer_array[p]);
// PetscPrintf(PETSC_COMM_WORLD, "p: %d, strain: %E\n", p, strain_fac[p]);



Expand Down Expand Up @@ -575,8 +576,10 @@ PetscErrorCode moveSwarm(int dimensions, PetscReal dt)


rarray[p] = calc_visco_ponto(tp,Pp,cx,cz,inter_geoq[layer_array[p]],E2_invariant,strain_fac[p],
inter_A[layer_array[p]], inter_n[layer_array[p]], inter_Q[layer_array[p]], inter_V[layer_array[p]]);
inter_A[layer_array[p]], inter_n[layer_array[p]], inter_Q[layer_array[p]], inter_V[layer_array[p]], layer_array[p]);

// PetscPrintf(PETSC_COMM_WORLD, "p: %d, strain: %E\n", p, strain_fac[p]);

array[3*p ] += dt * vx;
array[3*p+1] += dt * vy;
array[3*p+2] += dt * vz;
Expand Down
Loading