LifeV
|
implements a non-linear transient mixed-hybrid FE Darcy solver. More...
#include <DarcySolverTransientNonLinear.hpp>
Public Types | |
typedef MeshType | mesh_Type |
Typedef for mesh template. More... | |
typedef DarcySolverTransientNonLinear< mesh_Type > | darcySolverTransientNonLinear_Type |
Self typedef. More... | |
typedef DarcySolverLinear< mesh_Type > | darcySolverLinear_Type |
Darcy solver class. More... | |
typedef DarcySolverNonLinear< mesh_Type > | darcySolverNonLinear_Type |
Darcy non linear solver class. More... | |
typedef DarcySolverTransient< mesh_Type > | darcySolverTransient_Type |
Darcy transient solver class. More... | |
typedef darcySolverLinear_Type::data_Type | data_Type |
Typedef for the data type. More... | |
typedef darcySolverLinear_Type::dataPtr_Type | dataPtr_Type |
Shared pointer for the data type. More... | |
typedef darcySolverLinear_Type::matrixFctPtr_Type | matrixFctPtr_Type |
Shared pointer to a matrix value function. More... | |
typedef darcySolverLinear_Type::vector_Type | vector_Type |
Distributed vector. More... | |
Constructors & destructor | |
DarcySolverTransientNonLinear () | |
Constructor for the class. More... | |
virtual | ~DarcySolverTransientNonLinear () |
Virtual destructor. More... | |
Methods | |
virtual void | setup () |
Set up the linear solver, the preconditioner for the linear system and the exporter to save the solution. More... | |
virtual void | solve () |
Solve the problem calling the non linear solver. More... | |
Set methods | |
void | setInversePermeability (const matrixFctPtr_Type &invPerm) |
Set the inverse of diffusion tensor. More... | |
Private Constructors | |
DarcySolverTransientNonLinear (const darcySolverTransientNonLinear_Type &) | |
Inhibited copy constructor. More... | |
Private Operators | |
darcySolverTransientNonLinear_Type & | operator= (const darcySolverTransientNonLinear_Type &) |
Inhibited assign operator. More... | |
Protected Methods | |
virtual void | resetVariables () |
Update all problem variables. More... | |
virtual void | localMatrixComputation (const UInt &iElem, MatrixElemental &elmatMix, MatrixElemental &elmatReactionTerm) |
Compute elementary matrices. More... | |
virtual void | localVectorComputation (const UInt &iElem, VectorElemental &elvecMix) |
Computes local vectors. More... | |
Additional Inherited Members | |
Public Types inherited from DarcySolverNonLinear< MeshType > | |
typedef MeshType | mesh_Type |
Typedef for mesh template. More... | |
typedef DarcySolverNonLinear< mesh_Type > | darcySolverNonLinear_Type |
Self typedef. More... | |
typedef DarcySolverLinear< mesh_Type > | darcySolverLinear_Type |
Darcy solver class. More... | |
typedef darcySolverLinear_Type::data_Type | data_Type |
Typedef for the data type. More... | |
typedef darcySolverLinear_Type::dataPtr_Type | dataPtr_Type |
Shared pointer for the data type. More... | |
typedef darcySolverLinear_Type::scalarFctPtr_Type | scalarFctPtr_Type |
Shared pointer to a scalar value function. More... | |
typedef darcySolverLinear_Type::matrixFctPtr_Type | matrixFctPtr_Type |
Shared pointer to a matrix value function. More... | |
typedef darcySolverLinear_Type::scalarField_Type | scalarField_Type |
Scalar field. More... | |
typedef darcySolverLinear_Type::scalarFieldPtr_Type | scalarFieldPtr_Type |
Shared pointer to a scalar field. More... | |
Public Types inherited from DarcySolverLinear< MeshType > | |
typedef MeshType | mesh_Type |
Typedef for mesh template. More... | |
typedef LinearSolver | solver_Type |
Typedef for solver template. More... | |
typedef DarcySolverLinear< mesh_Type > | darcySolver_Type |
Self typedef. More... | |
typedef DarcyData< mesh_Type > | data_Type |
Typedef for the data type. More... | |
typedef std::shared_ptr< data_Type > | dataPtr_Type |
Shared pointer for the data type. More... | |
typedef BCHandler | bcHandler_Type |
Boundary condition handler. More... | |
typedef std::shared_ptr< bcHandler_Type > | bcHandlerPtr_Type |
Shared pointer to a boundary condition handler. More... | |
typedef std::shared_ptr< Epetra_Comm > | commPtr_Type |
Shared pointer to a MPI communicator. More... | |
typedef MapEpetra | map_Type |
Map type. More... | |
typedef std::shared_ptr< Displayer > | displayerPtr_Type |
Shared pointer to a displayer. More... | |
typedef FESpace< mesh_Type, map_Type > | fESpace_Type |
Finite element space. More... | |
typedef std::shared_ptr< fESpace_Type > | fESpacePtr_Type |
Shared pointer to a finite element space. More... | |
typedef FEScalarField< mesh_Type, map_Type > | scalarField_Type |
Scalar field. More... | |
typedef std::shared_ptr< scalarField_Type > | scalarFieldPtr_Type |
Shared pointer to a scalar field. More... | |
typedef FEVectorField< mesh_Type, map_Type > | vectorField_Type |
Vector field. More... | |
typedef std::shared_ptr< vectorField_Type > | vectorFieldPtr_Type |
Shared pointer to a scalar field. More... | |
typedef FEFunction< mesh_Type, map_Type, Real > | scalarFct_Type |
Scalar value function. More... | |
typedef std::shared_ptr< scalarFct_Type > | scalarFctPtr_Type |
Shared pointer to a scalar value function. More... | |
typedef FEFunction< mesh_Type, map_Type, Vector > | vectorFct_Type |
Vector value function. More... | |
typedef std::shared_ptr< vectorFct_Type > | vectorFctPtr_Type |
Shared pointer to a vector value function. More... | |
typedef FEFunction< mesh_Type, map_Type, Matrix > | matrixFct_Type |
Matrix value funcion. More... | |
typedef std::shared_ptr< matrixFct_Type > | matrixFctPtr_Type |
Shared pointer to a matrix value function. More... | |
typedef solver_Type::matrix_Type | matrix_Type |
Sparse and distributed matrix. More... | |
typedef solver_Type::matrixPtr_Type | matrixPtr_Type |
Shared pointer to a sparse and distributed matrix. More... | |
typedef solver_Type::vector_Type | vector_Type |
Distributed vector. More... | |
typedef solver_Type::vectorPtr_Type | vectorPtr_Type |
Shared pointer to a distributed vector. More... | |
typedef solver_Type::preconditionerPtr_Type | preconditionerPtr_Type |
Shared pointer to the preconditioner. More... | |
Public Types inherited from DarcySolverTransient< MeshType > | |
typedef MeshType | mesh_Type |
Typedef for mesh template. More... | |
typedef DarcySolverTransient< mesh_Type > | darcySolverTransient_Type |
Self typedef. More... | |
typedef DarcySolverLinear< mesh_Type > | darcySolverLinear_Type |
Darcy solver class. More... | |
typedef darcySolverLinear_Type::data_Type | data_Type |
Typedef for the data type. More... | |
typedef darcySolverLinear_Type::dataPtr_Type | dataPtr_Type |
Shared pointer for the data type. More... | |
typedef darcySolverLinear_Type::scalarFctPtr_Type | scalarFctPtr_Type |
Shared pointer to a scalar value function. More... | |
typedef darcySolverLinear_Type::vectorPtr_Type | vectorPtr_Type |
Shared pointer to a distributed vector. More... | |
typedef darcySolverLinear_Type::vector_Type | vector_Type |
Distributed vector. More... | |
typedef darcySolverLinear_Type::scalarFieldPtr_Type | scalarFieldPtr_Type |
Shared pointer to a scalar field. More... | |
typedef darcySolverLinear_Type::scalarField_Type | scalarField_Type |
Scalar field. More... | |
typedef std::vector< MatrixElemental > | matrixElementalContainer_Type |
Container of matrix elemental. More... | |
typedef TimeAdvanceBDF< vector_Type > | timeAdvance_Type |
Time advance scheme. More... | |
typedef std::shared_ptr< timeAdvance_Type > | timeAdvancePtr_Type |
Shared pointer to a time advance scheme. More... | |
Public Member Functions inherited from DarcySolverNonLinear< MeshType > | |
DarcySolverNonLinear () | |
Constructor for the class. More... | |
virtual | ~DarcySolverNonLinear () |
Virtual destructor. More... | |
void | setPrimalZeroIteration (const scalarFctPtr_Type &primalZeroIteration) |
Initial guess for fixed point iteration. More... | |
void | setFixedPointTolerance (const Real &tol) |
void | setFixedPointMaxIteration (const UInt &maxit) |
UInt | fixedPointNumIteration () |
Real | fixedPointResidual () |
Returns the residual between two iterations of the fixed point scheme. More... | |
const Real & | fixedPointTolerance () const |
Returns fixed point tolerance. More... | |
Real & | fixedPointTolerance () |
Returns fixed point tolerance. More... | |
const UInt & | fixedPointMaxIteration () const |
Returns maximum number of fixed point iterations allowed. More... | |
UInt & | fixedPointMaxIteration () |
Returns maximum number of fixed point iterations allowed. More... | |
const scalarFieldPtr_Type & | primalPreviousIterationPtr () const |
Returns the pointer of the primal solution field at previous step. More... | |
scalarFieldPtr_Type & | primalPreviousIterationPtr () |
Returns the pointer of the primal solution field at previous step. More... | |
Public Member Functions inherited from DarcySolverLinear< MeshType > | |
DarcySolverLinear () | |
Constructor for the class. More... | |
virtual | ~DarcySolverLinear () |
Virtual destructor. More... | |
void | buildSystem () |
Build the global hybrid system, the right hand and apply the boundary conditions. More... | |
void | solveLinearSystem () |
Solve the global hybrid system. More... | |
void | computePrimalAndDual () |
Compute primal and dual variables from the hybrid variable as a post process. More... | |
void | setData (dataPtr_Type &data) |
Set the data. More... | |
void | setBoundaryConditions (bcHandlerPtr_Type &bcHandler) |
Set the boundary conditions. More... | |
void | setScalarSource (const scalarFctPtr_Type &scalarSourceFct) |
Set scalar source term. More... | |
void | setVectorSource (const vectorFctPtr_Type &vectorSourceFct) |
Set vector source term. More... | |
void | setReactionTerm (const scalarFctPtr_Type &reactionTermFct) |
Set the coefficient for the reaction term. More... | |
void | setHybridField (const scalarFieldPtr_Type &hybridField) |
Set the hybrid field vector. More... | |
void | setPrimalField (const scalarFieldPtr_Type &primalField) |
Set the primal field vector. More... | |
void | setDualField (const scalarFieldPtr_Type &dualField) |
Set the dual field vector. More... | |
void | setFields (const scalarFieldPtr_Type &dualField, const scalarFieldPtr_Type &primalField, const scalarFieldPtr_Type &hybridField) |
Set the fields. More... | |
void | setDisplayer (const displayerPtr_Type &displayer) |
Set the displayer and, implicitly, the communicator. More... | |
void | setCommunicator (const commPtr_Type &comm) |
Set the communicator and, implicitly, the displayer. More... | |
const scalarFieldPtr_Type & | hybridFieldPtr () const |
Returns pointer to the hybrid solution field. More... | |
scalarFieldPtr_Type & | hybridFieldPtr () |
Returns pointer to the hybrid solution field. More... | |
const scalarFieldPtr_Type & | primalFieldPtr () const |
Returns pointer to the primal solution field. More... | |
scalarFieldPtr_Type & | primalFieldPtr () |
Returns pointer to the primal solution field. More... | |
const scalarFieldPtr_Type & | dualFieldPtr () const |
Returns pointer to the dual solution field. More... | |
scalarFieldPtr_Type & | dualFieldPtr () |
Returns pointer to the dual solution field. More... | |
const vectorPtr_Type & | residualPtr () const |
vectorPtr_Type & | residualPtr () |
const bcHandlerPtr_Type & | boundaryConditionHandlerPtr () const |
Returns boundary conditions handler. More... | |
bcHandlerPtr_Type & | boundaryConditionHandlerPtr () |
Returns boundary conditions handler. More... | |
const map_Type & | getMap () const |
Returns Epetra local map. More... | |
const commPtr_Type & | getCommPtr () const |
Returns Epetra communicator. More... | |
Public Member Functions inherited from DarcySolverTransient< MeshType > | |
DarcySolverTransient () | |
Constructor for the class. More... | |
virtual | ~DarcySolverTransient () |
Virtual destructor. More... | |
void | setInitialPrimal (const scalarFctPtr_Type &primalInitialFct) |
Initialize primal solution. More... | |
void | setMass (const scalarFctPtr_Type &massFct) |
Set mass matrix. More... | |
Protected Member Functions inherited from DarcySolverNonLinear< MeshType > | |
void | fixedPoint () |
Perform the fixed point loop to solve the non-linear problem. More... | |
void | setupNonLinear () |
Set up the data for the non-linear solver. More... | |
Protected Member Functions inherited from DarcySolverLinear< MeshType > | |
DarcySolverLinear (const darcySolver_Type &) | |
Inhibited copy constructor. More... | |
darcySolver_Type & | operator= (const darcySolver_Type &) |
Inhibited assign operator. More... | |
virtual void | preLoopElementsComputation () |
Perform all the operations before doing the loop on volume elements. More... | |
void | computeConstantMatrices (MatrixElemental &elmatMix) |
Pre-computes local (element independant) matrices. More... | |
void | staticCondensation (MatrixElemental &localMatrixHybrid, VectorElemental &localVectorHybrid, MatrixElemental &elmatMix, MatrixElemental &elmatReactionTerm, VectorElemental &elvecMix) |
Performs static condensation. More... | |
void | localComputePrimalAndDual (VectorElemental &localSolution, MatrixElemental &elmatMix, MatrixElemental &elmatReactionTerm, VectorElemental &elvecMix) |
Compute locally, as a post process, the primal and dual variable given the hybrid. More... | |
void | applyBoundaryConditions () |
Apply the boundary condition. More... | |
template<typename MatrixType > | |
void | symmetrizeMatrix (Int N, MatrixType &A) |
Make matrix symmetric. More... | |
Protected Member Functions inherited from DarcySolverTransient< MeshType > | |
virtual void | postComputePrimalAndDual () |
Do some computation after the calculation of the primal and dual variable. More... | |
void | setupTime () |
Setup the time data. More... | |
Protected Attributes inherited from DarcySolverNonLinear< MeshType > | |
scalarFieldPtr_Type | M_primalFieldPreviousIteration |
Primal solution at previous iteration step. More... | |
Protected Attributes inherited from DarcySolverLinear< MeshType > | |
displayerPtr_Type | M_displayer |
Displayer for parallel cout. More... | |
dataPtr_Type | M_data |
Data for Darcy solvers. More... | |
scalarFctPtr_Type | M_scalarSourceFct |
Source function. More... | |
vectorFctPtr_Type | M_vectorSourceFct |
Vector source function. More... | |
scalarFctPtr_Type | M_reactionTermFct |
Reaction term function. More... | |
matrixFctPtr_Type | M_inversePermeabilityFct |
Inverse of the permeability tensor. More... | |
bcHandlerPtr_Type | M_boundaryConditionHandler |
Bondary conditions handler. More... | |
scalarFieldPtr_Type | M_primalField |
Primal solution. More... | |
scalarFieldPtr_Type | M_dualField |
Dual solution. More... | |
scalarFieldPtr_Type | M_hybridField |
Hybrid solution. More... | |
matrixPtr_Type | M_matrHybrid |
Hybrid matrix. More... | |
vectorPtr_Type | M_rhs |
Right hand side. More... | |
vectorPtr_Type | M_residual |
Residual. More... | |
solver_Type | M_linearSolver |
Linear solver. More... | |
preconditionerPtr_Type | M_prec |
Epetra preconditioner for the linear system. More... | |
Protected Attributes inherited from DarcySolverTransient< MeshType > | |
timeAdvancePtr_Type | M_timeAdvance |
Time advance. More... | |
vectorPtr_Type | M_rhsTimeAdvance |
Right hand side coming from the time advance scheme. More... | |
implements a non-linear transient mixed-hybrid FE Darcy solver.
This class implements a non-linear and transient Darcy solver.
The classical time dependant, non-linear, Darcy formulation is a couple of differential equations of first order with the unknowns , being the pressure or the primal unknown, and , being the Darcy velocity or the flux or the dual unknown, such that
The data in the system are:
We suppose that and .
Using the hybridization procedure, and introducing a new variable, we may split the problem from the entire domain to problems in each elements of the triangulation , then we may write the weak formulation for the dual problem. The new variable is the hybrid unknown , e.g. "the trace" of pressure of the primal unknown, it is the Lagrange multipliers forcing the continuity of the flux across each faces or edges in the triangulation. We introduce the following functional spaces, the first is the space of the primal variable, the third for the dual variable, the fourth for the hybrid variable.
Introducing the following bilinear forms, operator and functionals
we obtain the Darcy problem in the weak form: find such that
At the semi-discrete level only space discretization is performed, we introduce the polynomial space, of degree , that approximate the finite dimensional spaces introduced above , and
where is the space of polynomial of degree in the element , is the space of polynomial of Raviart-Thomas of degrees in the element and is the space of polynomial of degree definite on each of the boundary of the element and discontinuous from one edge to the other.
The finite dimensional problem is: find such that
To obatin a fully discrete problem we discretize the time derivative via BDF (backward differentiation formulae) schemes of order , with as time step. Choosing
we obtain the following system for each , with
To solve the non-linearity we use a fixed point scheme based on the relative difference between two consecutive iterations of the primal variable. We start from the, user defined, function and solve the linearized problem for : find such that
At each iteration, to solve the linearized problem we use the static condensation procedure, i.e. the unknowns in the discrete weak system are not independent and , may be written in function of alone. We introduce the following local matrices
where we avoid to write the dependence on the triangle in all the matrices and vectors.
The local matrix formulation of the finite dimensional problem is
Or alternatively
Introducing the local hybrid matrix and local hybrid right hand side
Imposing that at each edge or face the hybrid unknown is single value we obtain a linear system for the hybrid unknown
We recover the primal and dual variable as a post-process from the hybrid variable at element level, so we have
Definition at line 260 of file DarcySolverTransientNonLinear.hpp.
Typedef for mesh template.
Definition at line 272 of file DarcySolverTransientNonLinear.hpp.
Self typedef.
Definition at line 275 of file DarcySolverTransientNonLinear.hpp.
typedef DarcySolverLinear< mesh_Type > darcySolverLinear_Type |
Darcy solver class.
Definition at line 278 of file DarcySolverTransientNonLinear.hpp.
Darcy non linear solver class.
Definition at line 281 of file DarcySolverTransientNonLinear.hpp.
Darcy transient solver class.
Definition at line 284 of file DarcySolverTransientNonLinear.hpp.
Typedef for the data type.
Definition at line 287 of file DarcySolverTransientNonLinear.hpp.
Shared pointer for the data type.
Definition at line 290 of file DarcySolverTransientNonLinear.hpp.
Shared pointer to a matrix value function.
Definition at line 293 of file DarcySolverTransientNonLinear.hpp.
Distributed vector.
Definition at line 296 of file DarcySolverTransientNonLinear.hpp.
Constructor for the class.
Definition at line 413 of file DarcySolverTransientNonLinear.hpp.
|
inlinevirtual |
Virtual destructor.
Definition at line 307 of file DarcySolverTransientNonLinear.hpp.
|
protected |
Inhibited copy constructor.
|
virtual |
Set up the linear solver, the preconditioner for the linear system and the exporter to save the solution.
Reimplemented from DarcySolverNonLinear< MeshType >.
Definition at line 430 of file DarcySolverTransientNonLinear.hpp.
|
virtual |
Solve the problem calling the non linear solver.
Reimplemented from DarcySolverNonLinear< MeshType >.
Definition at line 446 of file DarcySolverTransientNonLinear.hpp.
|
inlinevirtual |
Set the inverse of diffusion tensor.
Set the inverse of diffusion tensor.
invPerm | Inverse of the permeability tensor for the problem. |
Reimplemented from DarcySolverNonLinear< MeshType >.
Definition at line 330 of file DarcySolverTransientNonLinear.hpp.
|
protected |
Inhibited assign operator.
|
inlineprotectedvirtual |
Update all problem variables.
Update all the variables of the problem before the construction of the global hybrid matrix, e.g. reset the global hybrid matrix. It is principally used for a time dependent derived class.
Reimplemented from DarcySolverNonLinear< MeshType >.
Definition at line 365 of file DarcySolverTransientNonLinear.hpp.
|
inlineprotectedvirtual |
Compute elementary matrices.
Locally update the current finite element for the dual finite element space, then compute the Hdiv mass matrix.
iElem | Id of the current geometrical element. |
elmatMix | The local matrix in mixed form. |
elmatReactionTerm | The local matrix for the reaction term. |
Reimplemented from DarcySolverTransient< MeshType >.
Definition at line 378 of file DarcySolverTransientNonLinear.hpp.
|
inlineprotectedvirtual |
Computes local vectors.
Call the Darc_y solver localVectorComputation method and compute the additional scalar vector for the time dependent term.
iElem | Id of the current geometrical element. |
elvecMix | The local vector in mixed form. |
Reimplemented from DarcySolverTransient< MeshType >.
Definition at line 392 of file DarcySolverTransientNonLinear.hpp.