33 #ifndef __BIOT_TOOLS_H__
34 #define __BIOT_TOOLS_H__
42 #include <boost/math/special_functions/bessel.hpp>
51 #include "../ConvectionDiffusion/fe/convection_diffusion_fe.h"
52 #include "../ConvectionDiffusion/fe/convection_diffusion_stab_fe.h"
53 #include "../ConvectionDiffusion/fv1/convection_diffusion_fv1.h"
54 #include "../SmallStrainMechanics/small_strain_mech.h"
55 #include "../SmallStrainMechanics/material_laws/hooke.h"
59 #include <nlohmann/json.hpp>
63 namespace Poroelasticity {
81 BiotDiscConfig(
const char* uCmp,
int uorder,
const char *pCmp,
int porder,
double dStab)
84 BiotDiscConfig(
const char* uCmp,
int uorder,
const char *pCmp,
int porder,
bool bSteadyStateMechanics)
178 template <
typename TDomain>
227 const char *ucmps,
int uorder,
228 const char *pcmp,
int porder,
229 bool bSteadyStateMechanics=
true)
263 if (porder==1) {
flowEqDisc->set_quad_order(4); }
271 }
else if (uorder == 2) {
289 template <
typename TDomain>
296 bool bSteadyStateMechanics=
true)
297 :
m_config(ucmps, uorder, pcmp, porder, bSteadyStateMechanics){}
305 biot->CreateElemDiscs(param,
m_config);
340 template <
typename TDomain,
typename TAlgebra>
354 BiotProblem(
const char* uCmp,
const char *pCmp,
const char *gridname)
375 std::stringstream ss;
391 std::vector<BiotSubsetParameters>::const_iterator it=
m_params.begin();
422 std::vector<BiotSubsetParameters>::iterator it;
428 dd->add(biot->pressure_disc().template cast_dynamic<TElemDisc>());
429 dd->add(biot->displacement_disc().template cast_dynamic<TElemDisc>());
438 UG_ASSERT(bSteadyStateMechanics ==
true,
"ERROR: Only implemented for Mass matrix!");
440 if (
config().m_dStab <= 0.0)
return;
443 std::vector<BiotSubsetParameters>::iterator it;
445 double gamma = it->get_lambda() + 2.0*it->get_mu();
447 dd->add(pDiscStab.template cast_dynamic<TElemDisc>());
456 UG_ASSERT(bSteadyStateMechanics ==
true,
"ERROR: Only implemented for Mass matrix!");
459 std::vector<BiotSubsetParameters>::iterator it;
462 pDiscUzawa->set_mass_scale(it->get_beta());
463 dd->add(pDiscUzawa.template cast_static<TElemDisc>());
493 template <
typename TDomain,
typename TAlgebra>
496 template <
typename TDomain,
typename TAlgebra>
parameterString p
Definition: Biogas.lua:1
Discretization for the Convection-Diffusion Equation.
Definition: convection_diffusion_fe.h:58
FV Discretization for the Convection-Diffusion Equation.
Definition: convection_diffusion_fv1.h:61
Discretization for the Convection-Diffusion Equation.
Definition: convection_diffusion_stab_fe.h:56
This class generates element discretizations.
Definition: biot_tools.h:290
const BiotDiscConfig m_config
Definition: biot_tools.h:311
BiotElemDiscFactory(const char *ucmps, int uorder, const char *pcmp, int porder, bool bSteadyStateMechanics=true)
Definition: biot_tools.h:295
BiotElemDiscFactory(const BiotDiscConfig &config)
Definition: biot_tools.h:299
static const int dim
Definition: biot_tools.h:292
BiotElemDisc< TDomain > TBiotDisc
Definition: biot_tools.h:293
SmartPtr< TBiotDisc > create_elem_discs(const BiotSubsetParameters ¶m) const
Definition: biot_tools.h:302
const BiotDiscConfig & config()
Definition: biot_tools.h:310
Definition: biot_tools.h:180
SmartPtr< TElemDisc > displacement_disc()
Definition: biot_tools.h:199
SmartPtr< TSmallStrainMechanics > displacementEqDisc
Definition: biot_tools.h:211
static const int dim
Definition: biot_tools.h:182
void CreateElemDiscs(const BiotSubsetParameters ¶m, const BiotDiscConfig &config)
Definition: biot_tools.h:218
SmartPtr< TScaleAddLinkerNumber > divLinker
Definition: biot_tools.h:214
SmartPtr< TElemDisc > pressure_disc()
Definition: biot_tools.h:195
SmartPtr< TScaleAddLinkerNumber > compressionLinker
Definition: biot_tools.h:215
ConstSmartPtr< TScaleAddLinkerNumber > divergence()
Definition: biot_tools.h:205
ConvectionDiffusionPlugin::ConvectionDiffusionFE< TDomain > TConvectionDiffusion
Definition: biot_tools.h:185
void CreateElemDiscs(const BiotSubsetParameters ¶m, const char *ucmps, int uorder, const char *pcmp, int porder, bool bSteadyStateMechanics=true)
Definition: biot_tools.h:226
ScaleAddLinker< number, dim, number > TScaleAddLinkerNumber
Definition: biot_tools.h:186
ConstSmartPtr< TScaleAddLinkerNumber > compression_linker()
Definition: biot_tools.h:202
SmallStrainMechanics::SmallStrainMechanicsElemDisc< TDomain > TSmallStrainMechanics
Definition: biot_tools.h:184
BiotElemDisc()
Definition: biot_tools.h:188
IElemDisc< TDomain > TElemDisc
Definition: biot_tools.h:183
BiotElemDisc(SmartPtr< TConvectionDiffusion > pDisc, SmartPtr< TSmallStrainMechanics > uDisc)
Definition: biot_tools.h:191
SmartPtr< TConvectionDiffusion > flowEqDisc
Definition: biot_tools.h:210
A Biot problem consists of several element discs plus boundary conditions.
Definition: biot_tools.h:342
DomainDiscretization< TDomain, TAlgebra > TDomainDisc
Definition: biot_tools.h:346
BiotDiscConfig m_config
Definition: biot_tools.h:486
virtual double start_time()
Definition: biot_tools.h:401
virtual bool post_processing(SmartPtr< TGridFunction > u, size_t step, double time)
Post-processing (per time step)
Definition: biot_tools.h:477
const char * get_gridname() const
Definition: biot_tools.h:365
virtual void add_stab_discs(SmartPtr< TDomainDisc > dd, bool bSteadyStateMechanics=true)
Add stabilizationto domain disc.
Definition: biot_tools.h:436
GridFunction< TDomain, TAlgebra > TGridFunction
Definition: biot_tools.h:347
virtual double get_char_time()
Get characteristic time.
Definition: biot_tools.h:389
void add_subset_parameters(const BiotSubsetParameters &p)
Add subset parameters.
Definition: biot_tools.h:368
const BiotDiscConfig & config() const
Definition: biot_tools.h:481
BiotProblem(const BiotDiscConfig &config, const char *gridname)
CTOR (full)
Definition: biot_tools.h:358
virtual void add_boundary_conditions(SmartPtr< TDomainDisc > dd, bool bSteadyStateMechanics=true)
This add all boundary conditions.
Definition: biot_tools.h:469
ConvectionDiffusionPlugin::ConvectionDiffusionStabFE< TDomain > TConvectionDiffusionStab
Definition: biot_tools.h:349
void add_subset_parameters(const char *&json_string)
Allows adding descriptions.
Definition: biot_tools.h:373
virtual void interpolate_start_values(SmartPtr< TGridFunction > u, double t0)
Initial values.
Definition: biot_tools.h:473
std::vector< BiotSubsetParameters > m_params
Definition: biot_tools.h:487
int get_porder() const
Definition: biot_tools.h:482
int get_uorder() const
Definition: biot_tools.h:483
static const int dim
Definition: biot_tools.h:344
const std::string m_gridname
Definition: biot_tools.h:488
BiotProblem(const char *uCmp, const char *pCmp, const char *gridname)
CTOR (default orders)
Definition: biot_tools.h:354
virtual void add_uzawa_discs(SmartPtr< TDomainDisc > dd, bool bSteadyStateMechanics=true)
Add stabilization to domain disc.
Definition: biot_tools.h:453
ConvectionDiffusionPlugin::ConvectionDiffusionFV1< TDomain > TConvectionDiffusionFV1
Definition: biot_tools.h:350
IElemDisc< TDomain > TElemDisc
Definition: biot_tools.h:345
virtual ~BiotProblem()
DTOR.
Definition: biot_tools.h:362
virtual void add_elem_discs(SmartPtr< TDomainDisc > dd, bool bSteadyStateMechanics=true)
Adding all elem discs to domain disc.
Definition: biot_tools.h:409
virtual double end_time()
Definition: biot_tools.h:404
Class for Biot parameters (per subset)
Definition: biot_tools.h:111
void set_mu(number mu)
Definition: biot_tools.h:144
void set_kappa(number kappa)
Definition: biot_tools.h:136
number m_phi
Definition: biot_tools.h:160
number m_alpha
Definition: biot_tools.h:157
void set_beta(number beta)
Definition: biot_tools.h:148
number get_lambda() const
Elasticity lambda.
Definition: biot_tools.h:139
friend void from_json(const nlohmann::json &j, BiotSubsetParameters &p)
Definition: biot_tools.cpp:69
void set_phi(number phi)
Definition: biot_tools.h:132
BiotSubsetParameters(const char *s, number alpha, number kappa, number phi, number lambda, number mu, number beta)
Create from table.
Definition: biot_tools.h:118
void set_alpha(number alpha)
Definition: biot_tools.h:128
number m_beta_uzawa
Definition: biot_tools.h:164
number m_lambda
Definition: biot_tools.h:161
void set_subsets(std::string subset)
Definition: biot_tools.h:124
void set_lambda(number lambda)
Definition: biot_tools.h:140
BiotSubsetParameters()
Default constructor.
Definition: biot_tools.h:115
number get_alpha() const
Biot coefficient.
Definition: biot_tools.h:127
number get_beta() const
OPTIONAL: Fixed-stress beta.
Definition: biot_tools.h:147
std::string get_subsets() const
Subset.
Definition: biot_tools.h:123
number m_kappa
Definition: biot_tools.h:158
number m_mu
Definition: biot_tools.h:162
std::string m_subsets
Definition: biot_tools.h:155
number get_mu() const
Elasticity mu.
Definition: biot_tools.h:143
number get_kappa() const
Diffusion.
Definition: biot_tools.h:135
number get_phi() const
Storativity.
Definition: biot_tools.h:131
Definition: small_strain_mech.h:102
const NullSmartPtr SPNULL
#define UG_ASSERT(expr, msg)
double BesselJ1(double x)
Definition: biot_tools.cpp:42
double DefaultCharTime(const BiotSubsetParameters &p, double length)
Compute characteristic time.
Definition: biot_tools.cpp:81
void to_json(nlohmann::json &j, const BiotSubsetParameters &p)
Definition: biot_tools.cpp:57
double BesselJ0(double x)
Bessel functions.
Definition: biot_tools.cpp:39
void from_json(const nlohmann::json &j, BiotSubsetParameters &p)
Definition: biot_tools.cpp:69
SmartPtr< T, FreePolicy > make_sp(T *inst)
Definition: biot_tools.h:73
int m_uOrder
Definition: biot_tools.h:96
BiotDiscConfig(const char *uCmp, const char *pCmp)
Definition: biot_tools.h:74
BiotDiscConfig(const char *uCmp, int uorder, const char *pCmp, int porder, bool bSteadyStateMechanics)
Definition: biot_tools.h:84
bool m_bSteadyStateMechanics
Definition: biot_tools.h:99
double m_dStab
Definition: biot_tools.h:97
int get_uorder() const
Definition: biot_tools.h:93
BiotDiscConfig(const char *uCmp, int uorder, const char *pCmp, int porder)
Definition: biot_tools.h:78
int m_pOrder
Definition: biot_tools.h:96
std::string m_pCmp
Definition: biot_tools.h:95
void set_stabilization(double dStab)
Stabilization parameter (from [0,1]).
Definition: biot_tools.h:89
int get_porder() const
Definition: biot_tools.h:92
std::string m_uCmp
Definition: biot_tools.h:95
BiotDiscConfig(const char *uCmp, int uorder, const char *pCmp, int porder, double dStab)
Definition: biot_tools.h:81