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

Fastscape #26

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
43 changes: 38 additions & 5 deletions src/AVD.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,45 @@
/*@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**
** Project : LaMEM
** License : MIT, see LICENSE file for details
** Contributors : Anton Popov, Boris Kaus, see AUTHORS file for complete list
** Organization : Institute of Geosciences, Johannes-Gutenberg University, Mainz
** Contact : [email protected], [email protected]
** Copyright (c) 2011-2015, JGU Mainz, Anton Popov, Boris Kaus
** All rights reserved.
**
** This software was developed at:
**
** Institute of Geosciences
** Johannes-Gutenberg University, Mainz
** Johann-Joachim-Becherweg 21
** 55128 Mainz, Germany
**
** project: LaMEM
** filename: AVD.c
**
** LaMEM is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published
** by the Free Software Foundation, version 3 of the License.
**
** LaMEM is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
** See the GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with LaMEM. If not, see <http://www.gnu.org/licenses/>.
**
**
** Contact:
** Boris Kaus [[email protected]]
** Anton Popov [[email protected]]
**
**
** Main development team:
** Anton Popov [[email protected]]
** Boris Kaus [[email protected]]
** Tobias Baumann
** Adina Pusok
** Arthur Bauville
**
** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @*/

//---------------------------------------------------------------------------
//........ Routines based on the Approximate Voronoi Diagram (AVD) .......
//---------------------------------------------------------------------------
Expand Down
43 changes: 38 additions & 5 deletions src/AVD.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,45 @@
/*@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**
** Project : LaMEM
** License : MIT, see LICENSE file for details
** Contributors : Anton Popov, Boris Kaus, see AUTHORS file for complete list
** Organization : Institute of Geosciences, Johannes-Gutenberg University, Mainz
** Contact : [email protected], [email protected]
** Copyright (c) 2011-2015, JGU Mainz, Anton Popov, Boris Kaus
** All rights reserved.
**
** This software was developed at:
**
** Institute of Geosciences
** Johannes-Gutenberg University, Mainz
** Johann-Joachim-Becherweg 21
** 55128 Mainz, Germany
**
** project: LaMEM
** filename: AVD.h
**
** LaMEM is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published
** by the Free Software Foundation, version 3 of the License.
**
** LaMEM is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
** See the GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with LaMEM. If not, see <http://www.gnu.org/licenses/>.
**
**
** Contact:
** Boris Kaus [[email protected]]
** Anton Popov [[email protected]]
**
**
** Main development team:
** Anton Popov [[email protected]]
** Boris Kaus [[email protected]]
** Tobias Baumann
** Adina Pusok
** Arthur Bauville
**
** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @*/

//---------------------------------------------------------------------------
//.......... Routines based on Approximate Voronoi Diagram (AVD) .........
//---------------------------------------------------------------------------
Expand Down
60 changes: 45 additions & 15 deletions src/JacRes.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,42 @@
/*@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**
** Project : LaMEM
** License : MIT, see LICENSE file for details
** Contributors : Anton Popov, Boris Kaus, see AUTHORS file for complete list
** Organization : Institute of Geosciences, Johannes-Gutenberg University, Mainz
** Contact : [email protected], [email protected]
** Copyright (c) 2011-2015, JGU Mainz, Anton Popov, Boris Kaus
** All rights reserved.
**
** This software was developed at:
**
** Institute of Geosciences
** Johannes-Gutenberg University, Mainz
** Johann-Joachim-Becherweg 21
** 55128 Mainz, Germany
**
** project: LaMEM
** filename: JacRes.c
**
** LaMEM is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published
** by the Free Software Foundation, version 3 of the License.
**
** LaMEM is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
** See the GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with LaMEM. If not, see <http://www.gnu.org/licenses/>.
**
**
** Contact:
** Boris Kaus [[email protected]]
** Anton Popov [[email protected]]
**
**
** Main development team:
** Anton Popov [[email protected]]
** Boris Kaus [[email protected]]
** Tobias Baumann
** Adina Pusok
** Arthur Bauville
**
** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @*/
//---------------------------------------------------------------------------
Expand Down Expand Up @@ -56,7 +88,7 @@ PetscErrorCode JacResCreate(JacRes *jr, FB *fb)
ctrl->pShiftAct = 0;
ctrl->pLithoVisc = 1;
ctrl->initGuess = 1;
ctrl->mfmax = 1.0;
ctrl->mfmax = 0.15;
ctrl->lmaxit = 25;
ctrl->lrtol = 1e-6;
ctrl->actTemp = 0; // diffusion is not active by default (otherwise we have to define thermal properties in all cases)
Expand All @@ -71,7 +103,7 @@ PetscErrorCode JacResCreate(JacRes *jr, FB *fb)

// read from options
ierr = getScalarParam(fb, _OPTIONAL_, "gravity", ctrl->grav, 3, 1.0); CHKERRQ(ierr);
ierr = getScalarParam(fb, _OPTIONAL_, "FSSA", &ctrl->FSSA, 1, 1); CHKERRQ(ierr);
ierr = getScalarParam(fb, _OPTIONAL_, "FSSA", &ctrl->FSSA, 1, 1.0); CHKERRQ(ierr);
ierr = getIntParam (fb, _OPTIONAL_, "FSSA_allVel", &ctrl->FSSA_allVel, 1, 1.0); CHKERRQ(ierr);
ierr = getScalarParam(fb, _OPTIONAL_, "shear_heat_eff", &ctrl->shearHeatEff, 1, 1.0); CHKERRQ(ierr);
ierr = getScalarParam(fb, _OPTIONAL_, "biot", &ctrl->biot, 1, 1.0); CHKERRQ(ierr);
Expand Down Expand Up @@ -148,7 +180,7 @@ PetscErrorCode JacResCreate(JacRes *jr, FB *fb)
|| (m->Kb || m->beta)) need_top_open = 1;

// set default stabilization viscosity
if(!m->eta_st) m->eta_st = ctrl->eta_min/scal->viscosity;
//if(!m->eta_st) m->eta_st = ctrl->eta_min/scal->viscosity;

}

Expand Down Expand Up @@ -267,7 +299,7 @@ PetscErrorCode JacResCreate(JacRes *jr, FB *fb)
if(ctrl->tauUlt) PetscPrintf(PETSC_COMM_WORLD, " Ultimate yield stress : %g %s \n", ctrl->tauUlt, scal->lbl_stress_si);
if(ctrl->rho_fluid) PetscPrintf(PETSC_COMM_WORLD, " Fluid density : %g %s \n", ctrl->rho_fluid, scal->lbl_density);
if(ctrl->mfmax) PetscPrintf(PETSC_COMM_WORLD, " Max. melt fraction (viscosity, density) : %g \n", ctrl->mfmax);
if(ctrl->lmaxit) PetscPrintf(PETSC_COMM_WORLD, " Rheology iteration number : %lld \n", (LLD) ctrl->lmaxit);
if(ctrl->lmaxit) PetscPrintf(PETSC_COMM_WORLD, " Rheology iteration number : %d \n", ctrl->lmaxit);
if(ctrl->lrtol) PetscPrintf(PETSC_COMM_WORLD, " Rheology iteration tolerance : %g \n", ctrl->lrtol);
if(ctrl->Adiabatic_gr) PetscPrintf(PETSC_COMM_WORLD, " Adiabatic gradient : %g \n", ctrl->Adiabatic_gr);
if(ctrl->Phasetrans) PetscPrintf(PETSC_COMM_WORLD, " Phase transitions are active @ \n");
Expand Down Expand Up @@ -1930,11 +1962,9 @@ PetscErrorCode JacResCopyPres(JacRes *jr, Vec x)
PetscFunctionReturn(0);
}
//---------------------------------------------------------------------------
PetscErrorCode JacResInitPres(JacRes *jr,TSSol *ts)

PetscErrorCode JacResInitPres(JacRes *jr)
{
FDSTAG *fs;

BCCtx *bc;
SolVarCell *svCell;
const PetscScalar *p;
Expand All @@ -1951,7 +1981,7 @@ PetscErrorCode JacResInitPres(JacRes *jr,TSSol *ts)
fixPhase = bc->fixPhase;

// check activation
if(!bc->initPres || ts->istep>0) PetscFunctionReturn(0);
if(!bc->initPres) PetscFunctionReturn(0);

// get grid coordinate bounds in z-direction
ierr = FDSTAGGetGlobalBox(fs, NULL, NULL, &bz, NULL, NULL, &ez); CHKERRQ(ierr);
Expand Down Expand Up @@ -2001,7 +2031,7 @@ PetscErrorCode JacResInitPres(JacRes *jr,TSSol *ts)
PetscFunctionReturn(0);
}
//---------------------------------------------------------------------------
PetscErrorCode JacResInitLithPres(JacRes *jr, AdvCtx *actx,TSSol *ts)
PetscErrorCode JacResInitLithPres(JacRes *jr, AdvCtx *actx)
{
FDSTAG *fs;
SolVarCell *svCell;
Expand All @@ -2017,7 +2047,7 @@ PetscErrorCode JacResInitLithPres(JacRes *jr, AdvCtx *actx,TSSol *ts)
PetscFunctionBeginUser;

// check activation
if(!jr->ctrl.initLithPres || ts->istep >0) PetscFunctionReturn(0);
if(!jr->ctrl.initLithPres) PetscFunctionReturn(0);

// print
PrintStart(&t, "Initializing pressure with lithostatic pressure", NULL);
Expand Down
47 changes: 40 additions & 7 deletions src/JacRes.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,42 @@
/*@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**
** Project : LaMEM
** License : MIT, see LICENSE file for details
** Contributors : Anton Popov, Boris Kaus, see AUTHORS file for complete list
** Organization : Institute of Geosciences, Johannes-Gutenberg University, Mainz
** Contact : [email protected], [email protected]
** Copyright (c) 2011-2015, JGU Mainz, Anton Popov, Boris Kaus
** All rights reserved.
**
** This software was developed at:
**
** Institute of Geosciences
** Johannes-Gutenberg University, Mainz
** Johann-Joachim-Becherweg 21
** 55128 Mainz, Germany
**
** project: LaMEM
** filename: JacRes.h
**
** LaMEM is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published
** by the Free Software Foundation, version 3 of the License.
**
** LaMEM is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
** See the GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with LaMEM. If not, see <http://www.gnu.org/licenses/>.
**
**
** Contact:
** Boris Kaus [[email protected]]
** Anton Popov [[email protected]]
**
**
** Main development team:
** Anton Popov [[email protected]]
** Boris Kaus [[email protected]]
** Tobias Baumann
** Adina Pusok
** Arthur Bauville
**
** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @*/
//---------------------------------------------------------------------------
Expand All @@ -25,6 +57,7 @@ struct Dike;
struct Tensor2RN;
struct PData;
struct AdvCtx;
//struct ConstEqCtx;

//---------------------------------------------------------------------------
//..................... Deviatoric solution variables ...................
Expand Down Expand Up @@ -312,10 +345,10 @@ PetscErrorCode JacResCopyVel(JacRes *jr, Vec x);
PetscErrorCode JacResCopyPres(JacRes *jr, Vec x);

// initialize pressure
PetscErrorCode JacResInitPres(JacRes *jr,TSSol *ts);
PetscErrorCode JacResInitPres(JacRes *jr);

// initialize pressure to lithostatic pressure
PetscErrorCode JacResInitLithPres(JacRes *jr, AdvCtx *actx, TSSol *ts);
PetscErrorCode JacResInitLithPres(JacRes *jr, AdvCtx *actx);

// copy residuals from local to global vectors, enforce boundary constraints
PetscErrorCode JacResCopyRes(JacRes *jr, Vec f);
Expand Down
45 changes: 40 additions & 5 deletions src/JacResAux.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,46 @@
/*@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**
** Project : LaMEM
** License : MIT, see LICENSE file for details
** Contributors : Anton Popov, Boris Kaus, see AUTHORS file for complete list
** Organization : Institute of Geosciences, Johannes-Gutenberg University, Mainz
** Contact : [email protected], [email protected]
** Copyright (c) 2011-2015, JGU Mainz, Anton Popov, Boris Kaus
** All rights reserved.
**
** This software was developed at:
**
** Institute of Geosciences
** Johannes-Gutenberg University, Mainz
** Johann-Joachim-Becherweg 21
** 55128 Mainz, Germany
**
** project: LaMEM
** filename: JacResAux.c
**
** LaMEM is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published
** by the Free Software Foundation, version 3 of the License.
**
** LaMEM is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
** See the GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with LaMEM. If not, see <http://www.gnu.org/licenses/>.
**
**
** Contact:
** Boris Kaus [[email protected]]
** Anton Popov [[email protected]]
**
**
** Main development team:
** Anton Popov [[email protected]]
** Boris Kaus [[email protected]]
** Tobias Baumann
** Adina Pusok
** Arthur Bauville
**
** ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @*/
//---------------------------------------------------------------------------

#include "LaMEM.h"
#include "scaling.h"
#include "bc.h"
Expand All @@ -17,6 +51,7 @@
#include "tools.h"
#include "Tensor.h"
#include "parsing.h"

//---------------------------------------------------------------------------
#define gradComp(v, dx, bdx1, fdx1, bdx2, fdx2, dvdx, dvdx1, dvdx2, vc) \
dvdx = ( v[9] - v[4])/dx; \
Expand Down
Loading
Loading