Skip to content

Commit

Permalink
lagged G term, parallel issues still
Browse files Browse the repository at this point in the history
  • Loading branch information
wortiz committed Apr 19, 2024
1 parent be006fd commit 2c73cab
Show file tree
Hide file tree
Showing 16 changed files with 733 additions and 25 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,7 @@ set(GOMA_INCLUDES
include/wr_exo.h
include/wr_side_data.h
include/wr_soln.h
include/compute_lagged_variables.h
include/brkfix/bbb.h
include/brkfix/exo_utils.h
include/brkfix/fix.h
Expand Down Expand Up @@ -784,6 +785,7 @@ set(GOMA_SOURCES
src/wr_exo.c
src/wr_side_data.c
src/wr_soln.c
src/compute_lagged_variables.cpp
src/brkfix/bbb.c
src/brkfix/setup_fix_data.cpp
src/brkfix/fix_exo_file.c)
Expand Down
29 changes: 29 additions & 0 deletions include/compute_lagged_variables.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#ifndef GOMA_COMPUTE_LAGGED_VARIABLES_H
#define GOMA_COMPUTE_LAGGED_VARIABLES_H

#ifdef __cplusplus
extern "C" {
#endif

#include "exo_struct.h"
#include "dpi.h"

struct Lagged_Variables {
double *lagged_variables[MAX_PROB_VAR];
int local_count;
int global_count;
int local_rows;
int *local_node_to_lagged;
double *exchange_lagged[MAX_PROB_VAR];
int *mapping_index;
int *index;
};

void setup_lagged_variables(Exo_DB *exo, Dpi *dpi, struct Lagged_Variables *lv);
int compute_lagged_variables(Exo_DB * exo, Dpi *dpi, dbl * x, dbl *x_old, dbl *x_older, dbl *xdot, dbl *xdot_old, struct Lagged_Variables *lv);

#ifdef __cplusplus
}
#endif

#endif // GOMA_COMPUTE_LAGGED_VARIABLES_H
1 change: 1 addition & 0 deletions include/dp_comm.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,5 @@ EXTERN void exchange_node(Comm_Ex *cx, /* cx - ptr to communications exchange in
Dpi *d, /* dpi - distributed processing info */
double *a); /* x - local processor node-based vector */

EXTERN void exchange_node_int(Comm_Ex *cx, Dpi *dpi, int *x);
#endif /* GOMA_DP_COMM_H */
1 change: 1 addition & 0 deletions include/linalg/sparse_matrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ struct g_GomaSparseMatrix {
GomaGlobalOrdinal n_rows;
GomaGlobalOrdinal n_cols;
GomaGlobalOrdinal nnz;
int *map_to_subsystem;
// Create matrix with given rows and columns
// coo_rows and coo_cols are the COO representation of the matrix ordered by row
// local_nnz is the number of non-zero entries in the local partition
Expand Down
2 changes: 1 addition & 1 deletion include/mm_as.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ extern BASIS_FUNCTIONS_STRUCT **bfd;
extern BASIS_FUNCTIONS_STRUCT **bfi;
extern BASIS_FUNCTIONS_STRUCT **bfex;
extern struct Shell_Block **shell_blocks;
extern struct Field_Variables *fv, *fv_sens;
extern struct Field_Variables *fv, *fv_sens, *fv_lagged;
extern struct Diet_Field_Variables *fv_dot_dot, *fv_dot_dot_old;
extern struct Diet_Field_Variables *fv_old, *fv_dot, *fv_dot_old;
extern struct External_Field_Variables *efv;
Expand Down
2 changes: 2 additions & 0 deletions include/mm_as_structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#ifndef GOMA_MM_AS_STRUCTS_H
#define GOMA_MM_AS_STRUCTS_H

#include "compute_lagged_variables.h"
#include "el_elm.h"
#include "mm_elem_block_structs.h"
#include "mm_mp_const.h"
Expand Down Expand Up @@ -912,6 +913,7 @@ struct Uniform_Problem_Description {
turbulent_information *turbulent_info;
int strong_bc_replace;
dbl strong_penalty;
struct Lagged_Variables *lv;
};
typedef struct Uniform_Problem_Description UPD_STRUCT;
/*____________________________________________________________________________*/
Expand Down
9 changes: 9 additions & 0 deletions include/mm_post_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,15 @@ typedef struct Post_Processing_Averages {
} pp_Average;

enum AverageExtraTypes {
AVG_LAGGED_G11,
AVG_LAGGED_G12,
AVG_LAGGED_G13,
AVG_LAGGED_G21,
AVG_LAGGED_G22,
AVG_LAGGED_G23,
AVG_LAGGED_G31,
AVG_LAGGED_G32,
AVG_LAGGED_G33,
AVG_DENSITY,
AVG_HEAVISIDE,
AVG_VISCOSITY,
Expand Down
9 changes: 5 additions & 4 deletions src/ad_momentum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,8 @@ void ad_fluid_stress(ADType Pi[DIM][DIM]) {
if (evss_f) {
for (int a = 0; a < VIM; a++) {
for (int b = 0; b < VIM; b++) {
gamma_cont[a][b] = ad_fv->G[a][b] + ad_fv->G[b][a];
//gamma_cont[a][b] = ad_fv->G[a][b] + ad_fv->G[b][a];
gamma_cont[a][b] = fv_lagged->G[a][b] + fv_lagged->G[b][a];
}
}
} else {
Expand Down Expand Up @@ -1330,7 +1331,7 @@ int ad_calc_pspg(ADType pspg[DIM],
}
} else {
for (p = 0; p < WIM; p++) {
div_G[p] = 0.;
div_G[p] = fv_lagged->div_G[p];
}
}

Expand Down Expand Up @@ -1924,7 +1925,7 @@ int ad_assemble_stress_sqrt_conf(dbl tt, /* parameter to vary time integration f

int eqn, var;
int peqn, pvar;
int evss_gradv = 0;
int evss_gradv = 1;

int i, j, status, mode;
ADType v[DIM]; /* Velocity field. */
Expand Down Expand Up @@ -2110,7 +2111,7 @@ int ad_assemble_stress_sqrt_conf(dbl tt, /* parameter to vary time integration f
g[a][b] = ad_fv->grad_v[a][b];
gt[a][b] = ad_fv->grad_v[b][a];
} else {
g[a][b] = ad_fv->G[a][b];
g[a][b] = fv_lagged->G[a][b];
gt[b][a] = g[a][b];
}
}
Expand Down
Loading

0 comments on commit 2c73cab

Please sign in to comment.