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

Consolidating and simplifying command-line options #195

Merged
merged 10 commits into from
Aug 10, 2021
15 changes: 9 additions & 6 deletions demo/mpfao/mpfao.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,15 +208,18 @@ int main(int argc, char **argv) {
ierr = TDySetDiscretizationMethod(tdy,MPFA_O); CHKERRQ(ierr);

/* Create and distribute the mesh */
MPI_Comm comm = PETSC_COMM_WORLD;
DM dm;
ierr = TDyCreateDM(&dm); CHKERRQ(ierr);
ierr = DMCreate(comm, &dm); CHKERRQ(ierr);
ierr = DMSetType(dm, DMPLEX); CHKERRQ(ierr);
ierr = DMSetFromOptions(dm); CHKERRQ(ierr);
if (perturb) {ierr = PerturbInteriorVertices(dm,perturbation); CHKERRQ(ierr);}
ierr = TDyDistributeDM(&dm); CHKERRQ(ierr);
ierr = TDySetDM(tdy,dm); CHKERRQ(ierr);

ierr = TDySetFromOptions(tdy); CHKERRQ(ierr);

ierr = PetscOptionsBegin(PETSC_COMM_WORLD,NULL,"Sample Options","");
ierr = PetscOptionsBegin(comm,NULL,"Sample Options","");
CHKERRQ(ierr);
ierr = PetscOptionsInt ("-problem","Problem number","",problem,&problem,NULL);
CHKERRQ(ierr);
Expand Down Expand Up @@ -286,26 +289,26 @@ int main(int argc, char **argv) {

#if defined(DEBUG)
PetscViewer viewer;
ierr = PetscViewerASCIIOpen(PETSC_COMM_WORLD,"K.mat",&viewer); CHKERRQ(ierr);
ierr = PetscViewerASCIIOpen(comm,"K.mat",&viewer); CHKERRQ(ierr);
ierr = MatView(K,viewer); CHKERRQ(ierr);
ierr = PetscViewerDestroy(&viewer); CHKERRQ(ierr);

ierr = PetscViewerASCIIOpen(PETSC_COMM_WORLD,"trans.mat",&viewer); CHKERRQ(ierr);
ierr = PetscViewerASCIIOpen(comm,"trans.mat",&viewer); CHKERRQ(ierr);
ierr = MatView(tdy->Trans_mat,viewer); CHKERRQ(ierr);
ierr = PetscViewerDestroy(&viewer); CHKERRQ(ierr);
#endif

// Solve system
KSP ksp;
ierr = KSPCreate(PETSC_COMM_WORLD,&ksp); CHKERRQ(ierr);
ierr = KSPCreate(comm,&ksp); CHKERRQ(ierr);
ierr = KSPSetOperators(ksp,K,K); CHKERRQ(ierr);
ierr = KSPSetFromOptions(ksp); CHKERRQ(ierr);
ierr = KSPSetUp(ksp); CHKERRQ(ierr);
ierr = KSPSolve(ksp,F,U); CHKERRQ(ierr);

PetscReal normp, normv;
ierr = TDyComputeErrorNorms(tdy,U,&normp,&normv);
ierr = PetscPrintf(PETSC_COMM_WORLD,"%e %e\n",normp,normv);CHKERRQ(ierr);
ierr = PetscPrintf(comm,"%e %e\n",normp,normv);CHKERRQ(ierr);

ierr = TDyOutputRegression(tdy,U);

Expand Down
16 changes: 8 additions & 8 deletions demo/mpfao/mpfao.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,27 @@ standard_parallel=
pressure = 1.0e-12 relative

[mpfao-prob1]
input_arguments=-problem 1 -tdy_regression_test -tdy_regression_test_num_cells_per_process 2 -tdy_regression_test_filename mpfao-prob1 -tdy_output_mesh
input_arguments=-problem 1 -dm_plex_simplex 0 -dm_plex_box_faces 8,8 -dm_plex_box_lower 0,0 -dm_plex_box_upper 1,1 -tdy_regression_test -tdy_regression_test_num_cells_per_process 2 -tdy_regression_test_filename mpfao-prob1 -tdy_output_mesh

[mpfao-prob2]
input_arguments=-problem 2 -tdy_regression_test -tdy_regression_test_num_cells_per_process 2 -tdy_regression_test_filename mpfao-prob2
input_arguments=-problem 2 -dm_plex_simplex 0 -dm_plex_box_faces 8,8 -dm_plex_box_lower 0,0 -dm_plex_box_upper 1,1 -tdy_regression_test -tdy_regression_test_num_cells_per_process 2 -tdy_regression_test_filename mpfao-prob2

[mpfao-prob3]
input_arguments=-problem 3 -tdy_regression_test -tdy_regression_test_num_cells_per_process 2 -tdy_regression_test_filename mpfao-prob3
input_arguments=-problem 3 -dm_plex_simplex 0 -dm_plex_box_faces 8,8 -dm_plex_box_lower 0,0 -dm_plex_box_upper 1,1 -tdy_regression_test -tdy_regression_test_num_cells_per_process 2 -tdy_regression_test_filename mpfao-prob3

[mpfao-prob4]
input_arguments=-problem 4 -tdy_regression_test -tdy_regression_test_num_cells_per_process 2 -tdy_regression_test_filename mpfao-prob4
input_arguments=-problem 4 -dm_plex_simplex 0 -dm_plex_box_faces 8,8 -dm_plex_box_lower 0,0 -dm_plex_box_upper 1,1 -tdy_regression_test -tdy_regression_test_num_cells_per_process 2 -tdy_regression_test_filename mpfao-prob4

[mpfao-64xy-3z-wedge]
input_arguments=-problem 4 -tdy_regression_test -tdy_regression_test_num_cells_per_process 2 -tdy_regression_test_filename mpfao-64xy-3z-wedge -mesh_filename ../../share/meshes/64xy_3z_wedge.exo
input_arguments=-problem 4 -dm_plex_ѕimplex 0 -tdy_regression_test -tdy_regression_test_num_cells_per_process 2 -tdy_regression_test_filename mpfao-64xy-3z-wedge -dm_plex_filename ../../share/meshes/64xy_3z_wedge.exo

[mpfao-3d-prob]
input_arguments=-N 4 -dim 3 -tdy_regression_test -tdy_regression_test_num_cells_per_process 2 -tdy_regression_test_filename mpfao-3d-prob
input_arguments=-dm_plex_dim 3 -dm_plex_simplex 0 -dm_plex_box_faces 4,4,4 -dm_plex_box_lower 0,0,0 -dm_plex_box_upper 1,1,1 -tdy_regression_test -tdy_regression_test_num_cells_per_process 2 -tdy_regression_test_filename mpfao-3d-prob

[mpfao-prob3-np3]
np=3
input_arguments=-problem 3 -tdy_regression_test -tdy_regression_test_num_cells_per_process 2 -tdy_regression_test_filename mpfao-prob3-np3
input_arguments=-problem 3 -dm_plex_simplex 0 -dm_plex_box_faces 8,8 -dm_plex_box_lower 0,0 -dm_plex_box_upper 1,1 -tdy_regression_test -tdy_regression_test_num_cells_per_process 2 -tdy_regression_test_filename mpfao-prob3-np3

[mpfao-prob3-perturb-np3]
np=3
input_arguments=-problem 3 -perturb -tdy_regression_test -tdy_regression_test_num_cells_per_process 2 -tdy_regression_test_filename mpfao-prob3-perturb-np3
input_arguments=-problem 3 -dm_plex_simplex 0 -dm_plex_box_faces 8,8 -dm_plex_box_lower 0,0 -dm_plex_box_upper 1,1 -perturb -tdy_regression_test -tdy_regression_test_num_cells_per_process 2 -tdy_regression_test_filename mpfao-prob3-perturb-np3
8 changes: 4 additions & 4 deletions demo/richards/richards.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ standard_parallel=
pressure = 1.0e-12 relative

[richards-driver-snes-prob1]
input_arguments=-dim 3 -Nx 2 -Ny 2 -Nz 2 -tdy_water_density exponential -tdy_regression_test -tdy_regression_test_num_cells_per_process 2 -tdy_regression_test_filename richards-driver-snes-prob1 -tdy_final_time 3.1536e3 -tdy_dt_max 600. -tdy_dt_growth_factor 1.5 -tdy_timers -tdy_init_file richards_driver_snes_prob1_3x3x3_random.vec -tdy_time_integration_method SNES
input_arguments=-tdy_generate_mesh -dm_plex_simplex 0 -dm_plex_dim 3 -dm_plex_box_faces 2,2,2 -dm_plex_box_lower 0,0,0 -dm_plex_box_upper 1,1,1 -tdy_water_density exponential -tdy_regression_test -tdy_regression_test_num_cells_per_process 2 -tdy_regression_test_filename richards-driver-snes-prob1 -tdy_final_time 3.1536e3 -tdy_dt_max 600. -tdy_dt_growth_factor 1.5 -tdy_timers -tdy_init_file richards_driver_snes_prob1_3x3x3_random.vec -tdy_time_integration_method SNES

[richards-driver-ts-prob1]
input_arguments=-dim 3 -Nx 3 -Ny 3 -Nz 3 -tdy_water_density exponential -tdy_regression_test -tdy_regression_test_num_cells_per_process 2 -tdy_regression_test_filename richards-driver-ts-prob1 -tdy_final_time 3.1536e3 -tdy_dt_max 600. -tdy_dt_growth_factor 1.5 -tdy_init_with_random_field -tdy_time_integration_method TS
input_arguments=-tdy_generate_mesh -dm_plex_simplex 0 -dm_plex_dim 3 -dm_plex_box_faces 3,3,3 -dm_plex_box_lower 0,0,0 -dm_plex_box_upper 1,1,1 -tdy_water_density exponential -tdy_regression_test -tdy_regression_test_num_cells_per_process 2 -tdy_regression_test_filename richards-driver-ts-prob1 -tdy_final_time 3.1536e3 -tdy_dt_max 600. -tdy_dt_growth_factor 1.5 -tdy_init_with_random_field -tdy_time_integration_method TS

[richards-driver-snes-prob1-np4]
np=4
input_arguments=-dim 3 -Nx 2 -Ny 2 -Nz 2 -tdy_water_density exponential -tdy_regression_test -tdy_regression_test_num_cells_per_process 1 -tdy_regression_test_filename richards-driver-snes-prob1-np4 -tdy_final_time 3.1536e3 -tdy_dt_max 600. -tdy_dt_growth_factor 1.5 -tdy_init_with_random_field -tdy_time_integration_method SNES
input_arguments=-tdy_generate_mesh -dm_plex_simplex 0 -dm_plex_dim 3 -dm_plex_box_faces 2,2,2 -dm_plex_box_lower 0,0,0 -dm_plex_box_upper 1,1,1 -tdy_water_density exponential -tdy_regression_test -tdy_regression_test_num_cells_per_process 1 -tdy_regression_test_filename richards-driver-snes-prob1-np4 -tdy_final_time 3.1536e3 -tdy_dt_max 600. -tdy_dt_growth_factor 1.5 -tdy_init_with_random_field -tdy_time_integration_method SNES

[richards-driver-ts-prob1-np4]
np=4
timeout=300.
input_arguments=-dim 3 -Nx 3 -Ny 3 -Nz 3 -tdy_water_density exponential -tdy_regression_test -tdy_regression_test_num_cells_per_process 1 -tdy_regression_test_filename richards-driver-ts-prob1-np4 -tdy_final_time 3.1536e3 -tdy_dt_max 600. -tdy_dt_growth_factor 1.5 -tdy_timers -tdy_init_with_random_field -tdy_time_integration_method TS
input_arguments=-tdy_generate_mesh -dm_plex_simplex 0 -dm_plex_dim 3 -dm_plex_box_faces 3,3,3 -dm_plex_box_lower 0,0,0 -dm_plex_box_upper 1,1,1 -tdy_water_density exponential -tdy_regression_test -tdy_regression_test_num_cells_per_process 1 -tdy_regression_test_filename richards-driver-ts-prob1-np4 -tdy_final_time 3.1536e3 -tdy_dt_max 600. -tdy_dt_growth_factor 1.5 -tdy_timers -tdy_init_with_random_field -tdy_time_integration_method TS

6 changes: 3 additions & 3 deletions demo/richards/richards_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ int main(int argc, char **argv) {
PetscBool print_intermediate = PETSC_FALSE;
PetscMPIInt rank, size;
TDy tdy = PETSC_NULL;
TDyIOFormat format = HDF5Format;
TDyIOFormat format = HDF5Format;

ierr = TDyInit(argc, argv); CHKERRQ(ierr);
ierr = TDyCreate(&tdy); CHKERRQ(ierr);
Expand All @@ -19,7 +19,7 @@ int main(int argc, char **argv) {
ierr = MPI_Comm_rank(PETSC_COMM_WORLD,&rank); CHKERRQ(ierr);
ierr = MPI_Comm_size(PETSC_COMM_WORLD,&size); CHKERRQ(ierr);
PetscPrintf(PETSC_COMM_WORLD,"Beginning Richards Driver simulation.\n");
ierr = PetscOptionsBegin(PETSC_COMM_WORLD,NULL,"Sample Options","");
ierr = PetscOptionsBegin(PETSC_COMM_WORLD,NULL,"Sample Options","");
CHKERRQ(ierr);
ierr = PetscOptionsInt("-successful_exit_code",
"Code passed on successful completion","",
Expand All @@ -44,7 +44,7 @@ int main(int argc, char **argv) {
ierr = TDyIOSetMode(tdy,format);CHKERRQ(ierr);
ierr = TDyIOWriteVec(tdy); CHKERRQ(ierr);
}
ierr = TDyTimeIntegratorRunToTime(tdy,tdy->ti->final_time);
ierr = TDyTimeIntegratorRunToTime(tdy,tdy->ti->final_time);
CHKERRQ(ierr);
if (size == 1) {ierr = TDyIOWriteVec(tdy); CHKERRQ(ierr);}
ierr = TDyOutputRegression(tdy,tdy->solution); CHKERRQ(ierr);
Expand Down
8 changes: 4 additions & 4 deletions demo/th/th.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ standard_parallel=
pressure = 1.0e-12 relative

#[th-driver-snes-prob1]
#input_arguments=-dim 3 -Nx 2 -Ny 2 -Nz 2 -tdy_water_density exponential -tdy_regression_test -tdy_regression_test_num_cells_per_process 2 -tdy_regression_test_filename th-driver-snes-prob1 -tdy_final_time 3.1536e3 -tdy_dt_max 600. -tdy_dt_growth_factor 1.5 -tdy_timers -tdy_init_with_random_field -tdy_time_integration_method SNES
#input_arguments=-tdy_generate_mesh -dm_plex_simplex 0 -dm_plex_dim 3 -dm_plex_box_faces 2,2,2 -dm_plex_box_lower 0,0,0 -dm_plex_box_upper 1,1,1 -tdy_water_density exponential -tdy_regression_test -tdy_regression_test_num_cells_per_process 2 -tdy_regression_test_filename th-driver-snes-prob1 -tdy_final_time 3.1536e3 -tdy_dt_max 600. -tdy_dt_growth_factor 1.5 -tdy_timers -tdy_init_with_random_field -tdy_time_integration_method SNES

[th-driver-ts-prob1]
input_arguments=-dim 3 -Nx 2 -Ny 2 -Nz 2 -tdy_water_density exponential -tdy_regression_test -tdy_regression_test_num_cells_per_process 2 -tdy_regression_test_filename th-driver-ts-prob1 -tdy_final_time 3.1536e3 -tdy_dt_max 600. -tdy_dt_growth_factor 1.5 -tdy_init_with_random_field -tdy_time_integration_method TS
input_arguments=-tdy_generate_mesh -dm_plex_simplex 0 -dm_plex_dim 3 -dm_plex_box_faces 2,2,2 -dm_plex_box_lower 0,0,0 -dm_plex_box_upper 1,1,1 -tdy_water_density exponential -tdy_regression_test -tdy_regression_test_num_cells_per_process 2 -tdy_regression_test_filename th-driver-ts-prob1 -tdy_final_time 3.1536e3 -tdy_dt_max 600. -tdy_dt_growth_factor 1.5 -tdy_init_with_random_field -tdy_time_integration_method TS

#[th-driver-snes-prob1-np4]
#np=4
#input_arguments=-dim 3 -Nx 2 -Ny 2 -Nz 2 -tdy_water_density exponential -tdy_regression_test -tdy_regression_test_num_cells_per_process 1 -tdy_regression_test_filename th-driver-snes-prob1-np4 -tdy_final_time 3.1536e3 -tdy_dt_max 600. -tdy_dt_growth_factor 1.5 -tdy_init_with_random_field -tdy_time_integration_method SNES
#input_arguments=-tdy_generate_mesh -dm_plex_simplex 0 -dm_plex_dim 3 -dm_plex_box_faces 2,2,2 -dm_plex_box_lower 0,0,0 -dm_plex_box_upper 1,1,1 -tdy_water_density exponential -tdy_regression_test -tdy_regression_test_num_cells_per_process 1 -tdy_regression_test_filename th-driver-snes-prob1-np4 -tdy_final_time 3.1536e3 -tdy_dt_max 600. -tdy_dt_growth_factor 1.5 -tdy_init_with_random_field -tdy_time_integration_method SNES

[th-driver-ts-prob1-np4]
np=4
timeout=300.
input_arguments=-dim 3 -Nx 2 -Ny 2 -Nz 2 -tdy_water_density exponential -tdy_regression_test -tdy_regression_test_num_cells_per_process 1 -tdy_regression_test_filename th-driver-ts-prob1-np4 -tdy_final_time 3.1536e3 -tdy_dt_max 600. -tdy_dt_growth_factor 1.5 -tdy_timers -tdy_init_with_random_field -tdy_time_integration_method TS
input_arguments=-tdy_generate_mesh -dm_plex_simplex 0 -dm_plex_dim 3 -dm_plex_box_faces 2,2,2 -dm_plex_box_lower 0,0,0 -dm_plex_box_upper 1,1,1 -tdy_water_density exponential -tdy_regression_test -tdy_regression_test_num_cells_per_process 1 -tdy_regression_test_filename th-driver-ts-prob1-np4 -tdy_final_time 3.1536e3 -tdy_dt_max 600. -tdy_dt_growth_factor 1.5 -tdy_timers -tdy_init_with_random_field -tdy_time_integration_method TS

10 changes: 10 additions & 0 deletions include/private/tdyconditionsimpl.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#if !defined(TDYCONDITIONS_H)
#define TDYCONDITIONS_H

#include <petsc.h>

PETSC_INTERN PetscErrorCode TDyConstantBoundaryPressureFn(TDy,PetscReal*,PetscReal*,void*);
PETSC_INTERN PetscErrorCode TDyConstantBoundaryVelocityFn(TDy,PetscReal*,PetscReal*,void*);

#endif

21 changes: 1 addition & 20 deletions include/private/tdycoreimpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,8 @@ struct _p_TDy {
TDyTimeIntegrator ti;
TDySetupFlags setupflags;
TDyIO io;
PetscBool init_with_random_field;
PetscBool init_from_file;
char init_file[PETSC_MAX_PATH_LEN];

// options that determine the behavior(s) of the dycore
TDyOptions options;

/* arrays of the size of the Hasse diagram */
Expand All @@ -56,9 +54,6 @@ struct _p_TDy {
PetscInt ncv,nfv; /* number of {cell|face} vertices */

/* non-linear function of liquid pressure */
PetscInt rho_type;
PetscInt mu_type;
PetscInt enthalpy_type;
PetscReal *rho, *drho_dP, *d2rho_dP2; /* density of water [kg m-3]*/
PetscReal *vis, *dvis_dP, *d2vis_dP2; /* viscosity of water [Pa s] */
PetscReal *h, *dh_dP, *dh_dT; /* enthalpy of water */
Expand Down Expand Up @@ -101,12 +96,6 @@ struct _p_TDy {
void *soildensityctx;
void *soilspecificheatctx;

/* method-specific information*/
TDyMethod method;
TDyMode mode;
TDyQuadratureType qtype;
PetscBool allow_unsuitable_mesh;

/* Wheeler-Yotov */
PetscInt *vmap; /* [cell,local_vertex] --> global_vertex */
PetscInt *emap; /* [cell,local_vertex,direction] --> global_face */
Expand All @@ -122,9 +111,6 @@ struct _p_TDy {
PetscInt *faces;

/* MPFA-O */
PetscInt mpfao_gmatrix_method;
PetscInt mpfao_bc_type;

TDyMesh *mesh;
PetscReal ****subc_Gmatrix; /* Gmatrix for subcells */
PetscReal ***Trans;
Expand All @@ -149,12 +135,7 @@ struct _p_TDy {

PetscInt *closureSize, **closure, maxClosureSize;

PetscBool output_mesh;
PetscBool regression_testing;
TDyRegression *regression;

/* Timers enabled? */
PetscBool enable_timers;
};


Expand Down
1 change: 0 additions & 1 deletion include/private/tdydmimpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

#include <petsc.h>

PETSC_EXTERN PetscErrorCode TDyCreateDM(DM*);
PETSC_EXTERN PetscErrorCode TDyDistributeDM(DM*);

#endif
Expand Down
10 changes: 5 additions & 5 deletions include/private/tdymaterialpropertiesimpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ PETSC_INTERN PetscBool TDyIsThermalConductivytSet(TDy);
PETSC_INTERN PetscBool TDyIsSoilSpecificHeatSet(TDy);
PETSC_INTERN PetscBool TDyIsSoilDensitySet(TDy);

PETSC_INTERN PetscErrorCode TDySoilDensityFunctionDefault(TDy,PetscReal*,PetscReal*,void*);
PETSC_INTERN PetscErrorCode TDySoilSpecificHeatFunctionDefault(TDy,PetscReal*,PetscReal*,void*);
PETSC_INTERN PetscErrorCode TDyPermeabilityFunctionDefault(TDy,PetscReal *,PetscReal *,void*);
PETSC_INTERN PetscErrorCode TDyThermalConductivityFunctionDefault(TDy,PetscReal *,PetscReal *,void*);
PETSC_INTERN PetscErrorCode TDyPorosityFunctionDefault(TDy,PetscReal *,PetscReal *,void*);
PETSC_INTERN PetscErrorCode TDyConstantSoilDensityFunction(TDy,PetscReal*,PetscReal*,void*);
PETSC_INTERN PetscErrorCode TDyConstantSoilSpecificHeatFunction(TDy,PetscReal*,PetscReal*,void*);
PETSC_INTERN PetscErrorCode TDyConstantPermeabilityFunction(TDy,PetscReal *,PetscReal *,void*);
PETSC_INTERN PetscErrorCode TDyConstantThermalConductivityFunction(TDy,PetscReal *,PetscReal *,void*);
PETSC_INTERN PetscErrorCode TDyConstantPorosityFunction(TDy,PetscReal *,PetscReal *,void*);
Comment on lines +29 to +33
Copy link
Member

Choose a reason for hiding this comment

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

Not pertinent to the name change, but we may want to make these vectorizable, taking arguments (TDy, PetscInt, const PetscReal *, PetscReal *, void *).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That's a good idea and one we should adopt.


#endif

66 changes: 50 additions & 16 deletions include/private/tdyoptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,56 @@

#include <petsc.h>

typedef struct{
PetscReal gravity_constant;

// Default values for material properties
PetscReal default_porosity;
PetscReal default_permeability;
PetscReal default_soil_density;
PetscReal default_soil_specific_heat;
PetscReal default_thermal_conductivity;

// Default values for characteristic curves
PetscReal default_residual_saturation;
PetscReal default_gardner_n;
PetscReal default_vangenuchten_m;
PetscReal default_vangenutchen_alpha;
typedef struct {

// Model settings
PetscReal gravity_constant;
TDyMode mode;
TDyWaterDensityType rho_type;
PetscInt mu_type;
PetscInt enthalpy_type;

// Numerics settings
TDyMethod method;
TDyQuadratureType qtype;
PetscInt mpfao_gmatrix_method;
PetscInt mpfao_bc_type;
PetscBool tpf_allow_all_meshes;

// Constant material properties
PetscReal porosity;
PetscReal permeability;
PetscReal soil_density;
PetscReal soil_specific_heat;
PetscReal thermal_conductivity;

// Characteristic curve parameters
PetscReal residual_saturation;
PetscReal gardner_n;
PetscReal vangenuchten_m;
PetscReal vangenuchten_alpha;

// Constant boundary values
PetscReal boundary_pressure;
PetscReal boundary_temperature;
PetscReal boundary_velocity; // (normal component)

// Initial conditions
PetscBool init_with_random_field;
PetscBool init_from_file;
char init_file[PETSC_MAX_PATH_LEN];

// Mesh-related options
PetscBool generate_mesh;
PetscBool read_mesh;
char mesh_file[PETSC_MAX_PATH_LEN];

// I/O settings
PetscBool output_mesh;
PetscBool regression_testing;

// Timers enabled?
PetscBool enable_timers;
} TDyOptions;

#endif
#endif
12 changes: 0 additions & 12 deletions src/interface/ftn/tdydmf.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,11 @@
#include "tdycore.h"

#ifdef PETSC_HAVE_FORTRAN_CAPS
#define tdycreatedm_ TDYCREATEDM
#define tdydistributedm_ TDYDISTRIBUTEDM
#elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) && !defined(FORTRANDOUBLEUNDERSCORE)
#define tdycreatedm_ tdycreatedm
#define tdydistributedm_ tdydistributedm
#endif

#if defined(__cplusplus)
extern "C" {
#endif
PETSC_EXTERN void tdycreatedm_(DM *dm,int *__ierr){
*__ierr = TDyCreateDM(dm);
}
#if defined(__cplusplus)
}
#endif

#if defined(__cplusplus)
extern "C" {
#endif
Expand Down
Loading