605 * We start by including all the necessary deal.II header files and some
C++
606 * related ones. They have been discussed in detail in previous tutorial
607 * programs, so you need only refer to past tutorials
for details.
613 * #include <deal.II/base/function.h>
614 * #include <deal.II/base/parameter_handler.h>
615 * #include <deal.II/base/
point.h>
616 * #include <deal.II/base/quadrature_lib.h>
617 * #include <deal.II/base/symmetric_tensor.h>
618 * #include <deal.II/base/tensor.h>
619 * #include <deal.II/base/timer.h>
620 * #include <deal.II/base/work_stream.h>
621 * #include <deal.II/base/mpi.h>
622 * #include <deal.II/base/quadrature_point_data.h>
624 * #include <deal.II/differentiation/ad.h>
626 * #include <deal.II/distributed/shared_tria.h>
628 * #include <deal.II/dofs/dof_renumbering.h>
629 * #include <deal.II/dofs/dof_tools.h>
630 * #include <deal.II/dofs/dof_accessor.h>
632 * #include <deal.II/grid/filtered_iterator.h>
633 * #include <deal.II/grid/grid_generator.h>
634 * #include <deal.II/grid/grid_tools.h>
635 * #include <deal.II/grid/grid_in.h>
636 * #include <deal.II/grid/grid_out.h>
637 * #include <deal.II/grid/manifold_lib.h>
638 * #include <deal.II/grid/tria_accessor.h>
639 * #include <deal.II/grid/tria_boundary_lib.h>
640 * #include <deal.II/grid/tria_iterator.h>
642 * #include <deal.II/fe/fe_dgp_monomial.h>
643 * #include <deal.II/fe/fe_q.h>
644 * #include <deal.II/fe/fe_system.h>
645 * #include <deal.II/fe/fe_tools.h>
646 * #include <deal.II/fe/fe_values.h>
648 * #include <deal.II/lac/block_sparsity_pattern.h>
649 * #include <deal.II/lac/affine_constraints.h>
650 * #include <deal.II/lac/dynamic_sparsity_pattern.h>
651 * #include <deal.II/lac/full_matrix.h>
653 * #include <deal.II/lac/packaged_operation.h>
655 * #include <deal.II/lac/trilinos_block_sparse_matrix.h>
656 * #include <deal.II/lac/trilinos_linear_operator.h>
657 * #include <deal.II/lac/trilinos_parallel_block_vector.h>
658 * #include <deal.II/lac/trilinos_precondition.h>
659 * #include <deal.II/lac/trilinos_sparse_matrix.h>
660 * #include <deal.II/lac/trilinos_sparsity_pattern.h>
661 * #include <deal.II/lac/trilinos_solver.h>
662 * #include <deal.II/lac/trilinos_vector.h>
664 * #include <deal.II/lac/block_vector.h>
665 * #include <deal.II/lac/vector.h>
667 * #include <deal.II/numerics/data_postprocessor.h>
668 * #include <deal.II/numerics/data_out.h>
669 * #include <deal.II/numerics/data_out_faces.h>
670 * #include <deal.II/numerics/fe_field_function.h>
671 * #include <deal.II/numerics/vector_tools.h>
673 * #include <deal.II/physics/transformations.h>
674 * #include <deal.II/physics/elasticity/kinematics.h>
675 * #include <deal.II/physics/elasticity/standard_tensors.h>
677 * #include <iostream>
685 * We create a
namespace for everything that relates to
686 * the nonlinear poro-viscoelastic formulation,
687 * and
import all the deal.II function and
class names into it:
690 * namespace NonLinearPoroViscoElasticity
697 * <a name=
"Runtimeparameters"></a>
698 * <h3>Run-time parameters</h3>
702 * introduced by the user through the file
"parameters.prm"
705 *
namespace Parameters
710 * <a name=
"FiniteElementsystem"></a>
711 * <h4>Finite Element system</h4>
712 * Here we specify the polynomial order used to
approximate the solution,
713 * both
for the displacements and pressure unknowns.
714 * The quadrature order should be adjusted accordingly.
719 *
unsigned int poly_degree_displ;
720 *
unsigned int poly_degree_pore;
721 *
unsigned int quad_order;
732 * prm.enter_subsection(
"Finite element system");
734 * prm.declare_entry(
"Polynomial degree displ",
"2",
736 *
"Displacement system polynomial order");
738 * prm.declare_entry(
"Polynomial degree pore",
"1",
740 *
"Pore pressure system polynomial order");
742 * prm.declare_entry(
"Quadrature order",
"3",
744 *
"Gauss quadrature order");
746 * prm.leave_subsection();
751 * prm.enter_subsection(
"Finite element system");
753 * poly_degree_displ = prm.get_integer(
"Polynomial degree displ");
754 * poly_degree_pore = prm.get_integer(
"Polynomial degree pore");
755 * quad_order = prm.get_integer(
"Quadrature order");
757 * prm.leave_subsection();
763 * <a name=
"Geometry"></a>
765 * These parameters are related to the geometry definition and mesh generation.
766 * We select the type of problem to solve and introduce the desired load
values.
771 * std::string geom_type;
772 *
unsigned int global_refinement;
774 * std::string load_type;
776 *
unsigned int num_cycle_sets;
778 *
double drained_pressure;
789 * prm.enter_subsection(
"Geometry");
791 * prm.declare_entry(
"Geometry type",
"Ehlers_tube_step_load",
793 *
"|Ehlers_tube_increase_load"
794 *
"|Ehlers_cube_consolidation"
795 *
"|Franceschini_consolidation"
796 *
"|Budday_cube_tension_compression"
797 *
"|Budday_cube_tension_compression_fully_fixed"
798 *
"|Budday_cube_shear_fully_fixed"),
799 *
"Type of geometry used. "
800 *
"For Ehlers verification examples see Ehlers and Eipper (1999). "
801 *
"For Franceschini brain consolidation see Franceschini et al. (2006)"
802 *
"For Budday brain examples see Budday et al. (2017)");
804 * prm.declare_entry(
"Global refinement",
"1",
806 *
"Global refinement level");
808 * prm.declare_entry(
"Grid scale",
"1.0",
810 *
"Global grid scaling factor");
812 * prm.declare_entry(
"Load type",
"pressure",
814 *
"Type of loading");
816 * prm.declare_entry(
"Load value",
"-7.5e+6",
820 * prm.declare_entry(
"Number of cycle sets",
"1",
822 *
"Number of times each set of 3 cycles is repeated, only for "
823 *
"Budday_cube_tension_compression and Budday_cube_tension_compression_fully_fixed. "
824 *
"Load value is doubled in second set, load rate is kept constant."
825 *
"Final time indicates end of second cycle set.");
827 * prm.declare_entry(
"Fluid flow value",
"0.0",
829 *
"Prescribed fluid flow. Not implemented in any example yet.");
831 * prm.declare_entry(
"Drained pressure",
"0.0",
833 *
"Increase of pressure value at drained boundary w.r.t the atmospheric pressure.");
835 * prm.leave_subsection();
840 * prm.enter_subsection(
"Geometry");
842 * geom_type = prm.get(
"Geometry type");
843 * global_refinement = prm.get_integer(
"Global refinement");
844 *
scale = prm.get_double(
"Grid scale");
845 * load_type = prm.get(
"Load type");
846 * load = prm.get_double(
"Load value");
847 * num_cycle_sets = prm.get_integer(
"Number of cycle sets");
848 * fluid_flow = prm.get_double(
"Fluid flow value");
849 * drained_pressure = prm.get_double(
"Drained pressure");
851 * prm.leave_subsection();
857 * <a name=
"Materials"></a>
862 * Here we select the type of material
for the solid component
863 * and define the corresponding material parameters.
864 * Then we define he fluid data, including the type of
865 * seepage velocity definition to use.
870 * std::string mat_type;
876 *
double alpha1_infty;
877 *
double alpha2_infty;
878 *
double alpha3_infty;
882 *
double alpha1_mode_1;
883 *
double alpha2_mode_1;
884 *
double alpha3_mode_1;
885 *
double viscosity_mode_1;
886 * std::string fluid_type;
887 *
double solid_vol_frac;
888 *
double kappa_darcy;
889 *
double init_intrinsic_perm;
890 *
double viscosity_FR;
891 *
double init_darcy_coef;
894 *
int gravity_direction;
895 *
double gravity_value;
909 * prm.enter_subsection(
"Material properties");
911 * prm.declare_entry(
"material",
"Neo-Hooke",
913 *
"Type of material used in the problem");
915 * prm.declare_entry(
"lambda",
"8.375e6",
917 *
"First Lamé parameter for extension function related to compactation point in solid material [Pa].");
919 * prm.declare_entry(
"shear modulus",
"5.583e6",
921 *
"shear modulus for Neo-Hooke materials [Pa].");
923 * prm.declare_entry(
"eigen solver",
"QL Implicit Shifts",
925 *
"The type of eigen solver to be used for Ogden and visco-Ogden models.");
927 * prm.declare_entry(
"mu1",
"0.0",
929 *
"Shear material parameter 'mu1' for Ogden material [Pa].");
931 * prm.declare_entry(
"mu2",
"0.0",
933 *
"Shear material parameter 'mu2' for Ogden material [Pa].");
935 * prm.declare_entry(
"mu3",
"0.0",
937 *
"Shear material parameter 'mu1' for Ogden material [Pa].");
939 * prm.declare_entry(
"alpha1",
"1.0",
941 *
"Stiffness material parameter 'alpha1' for Ogden material [-].");
943 * prm.declare_entry(
"alpha2",
"1.0",
945 *
"Stiffness material parameter 'alpha2' for Ogden material [-].");
947 * prm.declare_entry(
"alpha3",
"1.0",
949 *
"Stiffness material parameter 'alpha3' for Ogden material [-].");
951 * prm.declare_entry(
"mu1_1",
"0.0",
953 *
"Shear material parameter 'mu1' for first viscous mode in Ogden material [Pa].");
955 * prm.declare_entry(
"mu2_1",
"0.0",
957 *
"Shear material parameter 'mu2' for first viscous mode in Ogden material [Pa].");
959 * prm.declare_entry(
"mu3_1",
"0.0",
961 *
"Shear material parameter 'mu1' for first viscous mode in Ogden material [Pa].");
963 * prm.declare_entry(
"alpha1_1",
"1.0",
965 *
"Stiffness material parameter 'alpha1' for first viscous mode in Ogden material [-].");
967 * prm.declare_entry(
"alpha2_1",
"1.0",
969 *
"Stiffness material parameter 'alpha2' for first viscous mode in Ogden material [-].");
971 * prm.declare_entry(
"alpha3_1",
"1.0",
973 *
"Stiffness material parameter 'alpha3' for first viscous mode in Ogden material [-].");
975 * prm.declare_entry(
"viscosity_1",
"1e-10",
977 *
"Deformation-independent viscosity parameter 'eta_1' for first viscous mode in Ogden material [-].");
979 * prm.declare_entry(
"seepage definition",
"Ehlers",
981 *
"Type of formulation used to define the seepage velocity in the problem. "
982 *
"Choose between Markert formulation of deformation-dependent intrinsic permeability "
983 *
"and Ehlers formulation of deformation-dependent Darcy flow coefficient.");
985 * prm.declare_entry(
"initial solid volume fraction",
"0.67",
987 *
"Initial porosity (solid volume fraction, 0 < n_0s < 1)");
989 * prm.declare_entry(
"kappa",
"0.0",
991 *
"Deformation-dependency control parameter for specific permeability (kappa >= 0)");
993 * prm.declare_entry(
"initial intrinsic permeability",
"0.0",
995 *
"Initial intrinsic permeability parameter [m^2] (isotropic permeability). To be used with Markert formulation.");
997 * prm.declare_entry(
"fluid viscosity",
"0.0",
999 *
"Effective shear viscosity parameter of the fluid [Pa·s, (N·s)/m^2]. To be used with Markert formulation.");
1001 * prm.declare_entry(
"initial Darcy coefficient",
"1.0e-4",
1003 *
"Initial Darcy flow coefficient [m/s] (isotropic permeability). To be used with Ehlers formulation.");
1005 * prm.declare_entry(
"fluid weight",
"1.0e4",
1007 *
"Effective weight of the fluid [N/m^3]. To be used with Ehlers formulation.");
1009 * prm.declare_entry(
"gravity term",
"false",
1011 *
"Gravity term considered (true) or neglected (false)");
1013 * prm.declare_entry(
"fluid density",
"1.0",
1015 *
"Real (or effective) density of the fluid");
1017 * prm.declare_entry(
"solid density",
"1.0",
1019 *
"Real (or effective) density of the solid");
1021 * prm.declare_entry(
"gravity direction",
"2",
1023 *
"Direction of gravity (unit vector 0 for x, 1 for y, 2 for z)");
1025 * prm.declare_entry(
"gravity value",
"-9.81",
1027 *
"Value of gravity (be careful to have consistent units!)");
1029 * prm.leave_subsection();
1034 * prm.enter_subsection(
"Material properties");
1041 * mat_type = prm.get(
"material");
1042 *
lambda = prm.get_double(
"lambda");
1043 * mu = prm.get_double(
"shear modulus");
1044 * mu1_infty = prm.get_double(
"mu1");
1045 * mu2_infty = prm.get_double(
"mu2");
1046 * mu3_infty = prm.get_double(
"mu3");
1047 * alpha1_infty = prm.get_double(
"alpha1");
1048 * alpha2_infty = prm.get_double(
"alpha2");
1049 * alpha3_infty = prm.get_double(
"alpha3");
1050 * mu1_mode_1 = prm.get_double(
"mu1_1");
1051 * mu2_mode_1 = prm.get_double(
"mu2_1");
1052 * mu3_mode_1 = prm.get_double(
"mu3_1");
1053 * alpha1_mode_1 = prm.get_double(
"alpha1_1");
1054 * alpha2_mode_1 = prm.get_double(
"alpha2_1");
1055 * alpha3_mode_1 = prm.get_double(
"alpha3_1");
1056 * viscosity_mode_1 = prm.get_double(
"viscosity_1");
1062 * fluid_type = prm.get(
"seepage definition");
1063 * solid_vol_frac = prm.get_double(
"initial solid volume fraction");
1064 * kappa_darcy = prm.get_double(
"kappa");
1065 * init_intrinsic_perm = prm.get_double(
"initial intrinsic permeability");
1066 * viscosity_FR = prm.get_double(
"fluid viscosity");
1067 * init_darcy_coef = prm.get_double(
"initial Darcy coefficient");
1068 * weight_FR = prm.get_double(
"fluid weight");
1074 * gravity_term = prm.get_bool(
"gravity term");
1075 * density_FR = prm.get_double(
"fluid density");
1076 * density_SR = prm.get_double(
"solid density");
1077 * gravity_direction = prm.get_integer(
"gravity direction");
1078 * gravity_value = prm.get_double(
"gravity value");
1080 *
if ( (fluid_type ==
"Markert") && ((init_intrinsic_perm == 0.0) || (viscosity_FR == 0.0)) )
1082 *
"'initial intrinsic permeability' and 'fluid viscosity' greater than 0.0."));
1084 *
if ( (fluid_type ==
"Ehlers") && ((init_darcy_coef == 0.0) || (weight_FR == 0.0)) )
1086 *
"'initial Darcy coefficient' and 'fluid weight' greater than 0.0."));
1088 *
const std::string eigen_solver_type = prm.get(
"eigen solver");
1089 *
if (eigen_solver_type ==
"QL Implicit Shifts")
1091 *
else if (eigen_solver_type ==
"Jacobi")
1098 * prm.leave_subsection();
1104 * <a name=
"Nonlinearsolver"></a>
1105 * <h4>Nonlinear solver</h4>
1109 * We now define the tolerances and the maximum number of iterations
for the
1110 * Newton-Raphson scheme used to solve the nonlinear system of governing equations.
1113 *
struct NonlinearSolver
1115 *
unsigned int max_iterations_NR;
1118 *
double tol_p_fluid;
1129 * prm.enter_subsection(
"Nonlinear solver");
1131 * prm.declare_entry(
"Max iterations Newton-Raphson",
"15",
1133 *
"Number of Newton-Raphson iterations allowed");
1135 * prm.declare_entry(
"Tolerance force",
"1.0e-8",
1137 *
"Force residual tolerance");
1139 * prm.declare_entry(
"Tolerance displacement",
"1.0e-6",
1141 *
"Displacement error tolerance");
1143 * prm.declare_entry(
"Tolerance pore pressure",
"1.0e-6",
1145 *
"Pore pressure error tolerance");
1147 * prm.leave_subsection();
1152 * prm.enter_subsection(
"Nonlinear solver");
1154 * max_iterations_NR = prm.get_integer(
"Max iterations Newton-Raphson");
1155 * tol_f = prm.get_double(
"Tolerance force");
1156 * tol_u = prm.get_double(
"Tolerance displacement");
1157 * tol_p_fluid = prm.get_double(
"Tolerance pore pressure");
1159 * prm.leave_subsection();
1165 * <a name=
"Time"></a>
1167 * Here we
set the timestep size @f$ \varDelta t @f$ and the simulation
end-time.
1183 * prm.enter_subsection(
"Time");
1185 * prm.declare_entry(
"End time",
"10.0",
1189 * prm.declare_entry(
"Time step size",
"0.002",
1191 *
"Time step size. The value must be larger than the displacement error tolerance defined.");
1193 * prm.leave_subsection();
1198 * prm.enter_subsection(
"Time");
1200 * end_time = prm.get_double(
"End time");
1201 * delta_t = prm.get_double(
"Time step size");
1203 * prm.leave_subsection();
1210 * <a name=
"Output"></a>
1212 * We can choose the frequency of the data
for the output files.
1215 *
struct OutputParam
1218 * std::string outfiles_requested;
1219 *
unsigned int timestep_output;
1220 * std::string outtype;
1231 * prm.enter_subsection(
"Output parameters");
1233 * prm.declare_entry(
"Output files",
"true",
1235 *
"Paraview output files to generate.");
1236 * prm.declare_entry(
"Time step number output",
"1",
1238 *
"Output data for time steps multiple of the given "
1239 *
"integer value.");
1240 * prm.declare_entry(
"Averaged results",
"nodes",
1242 *
"Output data associated with integration point values"
1243 *
" averaged on elements or on nodes.");
1245 * prm.leave_subsection();
1250 * prm.enter_subsection(
"Output parameters");
1252 * outfiles_requested = prm.get(
"Output files");
1253 * timestep_output = prm.get_integer(
"Time step number output");
1254 * outtype = prm.get(
"Averaged results");
1256 * prm.leave_subsection();
1262 * <a name=
"Allparameters"></a>
1263 * <h4>All parameters</h4>
1264 * We
finally consolidate all of the above structures into a single container that holds all the
run-time selections.
1267 *
struct AllParameters :
public FESystem,
1270 *
public NonlinearSolver,
1272 *
public OutputParam
1274 * AllParameters(
const std::string &input_file);
1283 * AllParameters::AllParameters(
const std::string &input_file)
1286 * declare_parameters(prm);
1288 * parse_parameters(prm);
1293 * FESystem::declare_parameters(prm);
1294 * Geometry::declare_parameters(prm);
1295 * Materials::declare_parameters(prm);
1296 * NonlinearSolver::declare_parameters(prm);
1297 * Time::declare_parameters(prm);
1298 * OutputParam::declare_parameters(prm);
1303 * FESystem::parse_parameters(prm);
1304 * Geometry::parse_parameters(prm);
1305 * Materials::parse_parameters(prm);
1306 * NonlinearSolver::parse_parameters(prm);
1307 * Time::parse_parameters(prm);
1308 * OutputParam::parse_parameters(prm);
1315 * <a name=
"Timeclass"></a>
1316 * <h3>Time
class</h3>
1317 *
A simple
class to store time data.
1318 * For simplicity we assume a
constant time step size.
1324 * Time (
const double time_end,
1325 *
const double delta_t)
1328 * time_current(0.0),
1329 * time_end(time_end),
1336 *
double get_current() const
1338 *
return time_current;
1340 *
double get_end() const
1344 *
double get_delta_t() const
1348 *
unsigned int get_timestep() const
1352 *
void increment_time ()
1354 * time_current += delta_t;
1359 *
unsigned int timestep;
1360 *
double time_current;
1362 *
const double delta_t;
1368 * <a name=
"Constitutiveequationforthesolidcomponentofthebiphasicmaterial"></a>
1369 * <h3>Constitutive equation
for the solid component of the biphasic material</h3>
1374 * <a name=
"Baseclassgenerichyperelasticmaterial"></a>
1375 * <h4>Base
class:
generic hyperelastic material</h4>
1376 * The ``extra
" Kirchhoff stress in the solid component is the sum of isochoric
1377 * and a volumetric part.
1378 * @f$\mathbf{\tau} = \mathbf{\tau}_E^{(\bullet)} + \mathbf{\tau}^{\textrm{vol}}@f$
1379 * The deviatoric part changes depending on the type of material model selected:
1380 * Neo-Hooken hyperelasticity, Ogden hyperelasticiy,
1381 * or a single-mode finite viscoelasticity based on the Ogden hyperelastic model.
1382 * In this base class we declare it as a virtual function,
1383 * and it will be defined for each model type in the corresponding derived class.
1384 * We define here the volumetric component, which depends on the
1385 * extension function @f$U(J_S)@f$ selected, and in this case is the same for all models.
1386 * We use the function proposed by
1387 * Ehlers & Eipper 1999 doi:10.1023/A:1006565509095
1388 * We also define some public functions to access and update the internal variables.
1391 * template <int dim, typename NumberType = Sacado::Fad::DFad<double> >
1392 * class Material_Hyperelastic
1395 * Material_Hyperelastic(const Parameters::AllParameters ¶meters,
1398 * n_OS (parameters.solid_vol_frac),
1399 * lambda (parameters.lambda),
1402 * det_F_converged (1.0),
1403 * eigen_solver (parameters.eigen_solver)
1405 * ~Material_Hyperelastic()
1408 * SymmetricTensor<2, dim, NumberType>
1409 * get_tau_E(const Tensor<2,dim, NumberType> &F) const
1411 * return ( get_tau_E_base(F) + get_tau_E_ext_func(F) );
1414 * SymmetricTensor<2, dim, NumberType>
1415 * get_Cauchy_E(const Tensor<2, dim, NumberType> &F) const
1417 * const NumberType det_F = determinant(F);
1418 * Assert(det_F > 0, ExcInternalError());
1419 * return get_tau_E(F)*NumberType(1/det_F);
1423 * get_converged_det_F() const
1425 * return det_F_converged;
1429 * update_end_timestep()
1431 * det_F_converged = det_F;
1435 * update_internal_equilibrium( const Tensor<2, dim, NumberType> &F )
1437 * det_F = Tensor<0,dim,double>(determinant(F));
1441 * get_viscous_dissipation( ) const = 0;
1443 * const double n_OS;
1444 * const double lambda;
1447 * double det_F_converged;
1448 * const enum SymmetricTensorEigenvectorMethod eigen_solver;
1451 * SymmetricTensor<2, dim, NumberType>
1452 * get_tau_E_ext_func(const Tensor<2,dim, NumberType> &F) const
1454 * const NumberType det_F = determinant(F);
1455 * Assert(det_F > 0, ExcInternalError());
1457 * static const SymmetricTensor< 2, dim, double>
1458 * I (Physics::Elasticity::StandardTensors<dim>::I);
1459 * return ( NumberType(lambda * (1.0-n_OS)*(1.0-n_OS)
1460 * * (det_F/(1.0-n_OS) - det_F/(det_F-n_OS))) * I );
1463 * virtual SymmetricTensor<2, dim, NumberType>
1464 * get_tau_E_base(const Tensor<2,dim, NumberType> &F) const = 0;
1470 * <a name="DerivedclassNeoHookeanhyperelasticmaterial
"></a>
1471 * <h4>Derived class: Neo-Hookean hyperelastic material</h4>
1474 * template <int dim, typename NumberType = Sacado::Fad::DFad<double> >
1475 * class NeoHooke : public Material_Hyperelastic < dim, NumberType >
1478 * NeoHooke(const Parameters::AllParameters ¶meters,
1481 * Material_Hyperelastic< dim, NumberType > (parameters,time),
1484 * virtual ~NeoHooke()
1488 * get_viscous_dissipation() const
1496 * SymmetricTensor<2, dim, NumberType>
1497 * get_tau_E_base(const Tensor<2,dim, NumberType> &F) const
1499 * static const SymmetricTensor< 2, dim, double>
1500 * I (Physics::Elasticity::StandardTensors<dim>::I);
1502 * const bool use_standard_model = true;
1504 * if (use_standard_model)
1508 * Standard Neo-Hooke
1511 * return ( mu * ( symmetrize(F * transpose(F)) - I ) );
1517 * Neo-Hooke in terms of principal stretches
1520 * const SymmetricTensor<2, dim, NumberType>
1521 * B = symmetrize(F * transpose(F));
1522 * const std::array< std::pair< NumberType, Tensor< 1, dim, NumberType > >, dim >
1523 * eigen_B = eigenvectors(B, this->eigen_solver);
1525 * SymmetricTensor<2, dim, NumberType> B_ev;
1526 * for (unsigned int d=0; d<dim; ++d)
1527 * B_ev += eigen_B[d].first*symmetrize(outer_product(eigen_B[d].second,eigen_B[d].second));
1529 * return ( mu*(B_ev-I) );
1537 * <a name="DerivedclassOgdenhyperelasticmaterial
"></a>
1538 * <h4>Derived class: Ogden hyperelastic material</h4>
1541 * template <int dim, typename NumberType = Sacado::Fad::DFad<double> >
1542 * class Ogden : public Material_Hyperelastic < dim, NumberType >
1545 * Ogden(const Parameters::AllParameters ¶meters,
1548 * Material_Hyperelastic< dim, NumberType > (parameters,time),
1549 * mu({parameters.mu1_infty,
1550 * parameters.mu2_infty,
1551 * parameters.mu3_infty}),
1552 * alpha({parameters.alpha1_infty,
1553 * parameters.alpha2_infty,
1554 * parameters.alpha3_infty})
1560 * get_viscous_dissipation() const
1566 * std::vector<double> mu;
1567 * std::vector<double> alpha;
1569 * SymmetricTensor<2, dim, NumberType>
1570 * get_tau_E_base(const Tensor<2,dim, NumberType> &F) const
1572 * const SymmetricTensor<2, dim, NumberType>
1573 * B = symmetrize(F * transpose(F));
1575 * const std::array< std::pair< NumberType, Tensor< 1, dim, NumberType > >, dim >
1576 * eigen_B = eigenvectors(B, this->eigen_solver);
1578 * SymmetricTensor<2, dim, NumberType> tau;
1579 * static const SymmetricTensor< 2, dim, double>
1580 * I (Physics::Elasticity::StandardTensors<dim>::I);
1582 * for (unsigned int i = 0; i < 3; ++i)
1584 * for (unsigned int A = 0; A < dim; ++A)
1586 * SymmetricTensor<2, dim, NumberType> tau_aux1 = symmetrize(
1587 * outer_product(eigen_B[A].second,eigen_B[A].second));
1588 * tau_aux1 *= mu[i]*std::pow(eigen_B[A].first, (alpha[i]/2.) );
1591 * SymmetricTensor<2, dim, NumberType> tau_aux2 (I);
1592 * tau_aux2 *= mu[i];
1602 * <a name="DerivedclassSinglemodeOgdenviscoelasticmaterial
"></a>
1603 * <h4>Derived class: Single-mode Ogden viscoelastic material</h4>
1604 * We use the finite viscoelastic model described in
1605 * Reese & Govindjee (1998) doi:10.1016/S0020-7683(97)00217-5
1606 * The algorithm for the implicit exponential time integration is given in
1607 * Budday et al. (2017) doi: 10.1016/j.actbio.2017.06.024
1610 * template <int dim, typename NumberType = Sacado::Fad::DFad<double> >
1611 * class visco_Ogden : public Material_Hyperelastic < dim, NumberType >
1614 * visco_Ogden(const Parameters::AllParameters ¶meters,
1617 * Material_Hyperelastic< dim, NumberType > (parameters,time),
1618 * mu_infty({parameters.mu1_infty,
1619 * parameters.mu2_infty,
1620 * parameters.mu3_infty}),
1621 * alpha_infty({parameters.alpha1_infty,
1622 * parameters.alpha2_infty,
1623 * parameters.alpha3_infty}),
1624 * mu_mode_1({parameters.mu1_mode_1,
1625 * parameters.mu2_mode_1,
1626 * parameters.mu3_mode_1}),
1627 * alpha_mode_1({parameters.alpha1_mode_1,
1628 * parameters.alpha2_mode_1,
1629 * parameters.alpha3_mode_1}),
1630 * viscosity_mode_1(parameters.viscosity_mode_1),
1631 * Cinv_v_1(Physics::Elasticity::StandardTensors<dim>::I),
1632 * Cinv_v_1_converged(Physics::Elasticity::StandardTensors<dim>::I)
1634 * virtual ~visco_Ogden()
1638 * update_internal_equilibrium( const Tensor<2, dim, NumberType> &F )
1640 * Material_Hyperelastic < dim, NumberType >::update_internal_equilibrium(F);
1642 * this->Cinv_v_1 = this->Cinv_v_1_converged;
1643 * SymmetricTensor<2, dim, NumberType> B_e_1_tr = symmetrize(F * this->Cinv_v_1 * transpose(F));
1645 * const std::array< std::pair< NumberType, Tensor< 1, dim, NumberType > >, dim >
1646 * eigen_B_e_1_tr = eigenvectors(B_e_1_tr, this->eigen_solver);
1648 * Tensor< 1, dim, NumberType > lambdas_e_1_tr;
1649 * Tensor< 1, dim, NumberType > epsilon_e_1_tr;
1650 * for (int a = 0; a < dim; ++a)
1652 * lambdas_e_1_tr[a] = std::sqrt(eigen_B_e_1_tr[a].first);
1653 * epsilon_e_1_tr[a] = std::log(lambdas_e_1_tr[a]);
1656 * const double tolerance = 1e-8;
1657 * double residual_check = tolerance*10.0;
1658 * Tensor< 1, dim, NumberType > residual;
1659 * Tensor< 2, dim, NumberType > tangent;
1660 * static const SymmetricTensor< 2, dim, double> I(Physics::Elasticity::StandardTensors<dim>::I);
1661 * NumberType J_e_1 = std::sqrt(determinant(B_e_1_tr));
1663 * std::vector<NumberType> lambdas_e_1_iso(dim);
1664 * SymmetricTensor<2, dim, NumberType> B_e_1;
1665 * int iteration = 0;
1667 * Tensor< 1, dim, NumberType > lambdas_e_1;
1668 * Tensor< 1, dim, NumberType > epsilon_e_1;
1669 * epsilon_e_1 = epsilon_e_1_tr;
1671 * while(residual_check > tolerance)
1673 * NumberType aux_J_e_1 = 1.0;
1674 * for (unsigned int a = 0; a < dim; ++a)
1676 * lambdas_e_1[a] = std::exp(epsilon_e_1[a]);
1677 * aux_J_e_1 *= lambdas_e_1[a];
1680 * J_e_1 = aux_J_e_1;
1682 * for (unsigned int a = 0; a < dim; ++a)
1683 * lambdas_e_1_iso[a] = lambdas_e_1[a]*std::pow(J_e_1,-1.0/dim);
1685 * for (unsigned int a = 0; a < dim; ++a)
1687 * residual[a] = get_beta_mode_1(lambdas_e_1_iso, a);
1688 * residual[a] *= this->time.get_delta_t()/(2.0*viscosity_mode_1);
1689 * residual[a] += epsilon_e_1[a];
1690 * residual[a] -= epsilon_e_1_tr[a];
1692 * for (unsigned int b = 0; b < dim; ++b)
1694 * tangent[a][b] = get_gamma_mode_1(lambdas_e_1_iso, a, b);
1695 * tangent[a][b] *= this->time.get_delta_t()/(2.0*viscosity_mode_1);
1696 * tangent[a][b] += I[a][b];
1700 * epsilon_e_1 -= invert(tangent)*residual;
1702 * residual_check = 0.0;
1703 * for (unsigned int a = 0; a < dim; ++a)
1705 * if ( std::abs(residual[a]) > residual_check)
1706 * residual_check = std::abs(Tensor<0,dim,double>(residual[a]));
1709 * if (iteration > 15 )
1710 * AssertThrow(false, ExcMessage("No convergence in local Newton iteration
for the
"
1711 * "viscoelastic exponential time integration algorithm.
"));
1714 * NumberType aux_J_e_1 = 1.0;
1715 * for (unsigned int a = 0; a < dim; ++a)
1717 * lambdas_e_1[a] = std::exp(epsilon_e_1[a]);
1718 * aux_J_e_1 *= lambdas_e_1[a];
1720 * J_e_1 = aux_J_e_1;
1722 * for (unsigned int a = 0; a < dim; ++a)
1723 * lambdas_e_1_iso[a] = lambdas_e_1[a]*std::pow(J_e_1,-1.0/dim);
1725 * for (unsigned int a = 0; a < dim; ++a)
1727 * SymmetricTensor<2, dim, NumberType>
1728 * B_e_1_aux = symmetrize(outer_product(eigen_B_e_1_tr[a].second,eigen_B_e_1_tr[a].second));
1729 * B_e_1_aux *= lambdas_e_1[a] * lambdas_e_1[a];
1730 * B_e_1 += B_e_1_aux;
1733 * Tensor<2, dim, NumberType>Cinv_v_1_AD = symmetrize(invert(F) * B_e_1 * invert(transpose(F)));
1735 * this->tau_neq_1 = 0;
1736 * for (unsigned int a = 0; a < dim; ++a)
1738 * SymmetricTensor<2, dim, NumberType>
1739 * tau_neq_1_aux = symmetrize(outer_product(eigen_B_e_1_tr[a].second,eigen_B_e_1_tr[a].second));
1740 * tau_neq_1_aux *= get_beta_mode_1(lambdas_e_1_iso, a);
1741 * this->tau_neq_1 += tau_neq_1_aux;
1749 * for (unsigned int a = 0; a < dim; ++a)
1750 * for (unsigned int b = 0; b < dim; ++b)
1751 * this->Cinv_v_1[a][b]= Tensor<0,dim,double>(Cinv_v_1_AD[a][b]);
1754 * void update_end_timestep()
1756 * Material_Hyperelastic < dim, NumberType >::update_end_timestep();
1757 * this->Cinv_v_1_converged = this->Cinv_v_1;
1760 * double get_viscous_dissipation() const
1762 * NumberType dissipation_term = get_tau_E_neq() * get_tau_E_neq(); //Double contract the two SymmetricTensor
1763 * dissipation_term /= (2*viscosity_mode_1);
1765 * return dissipation_term.val();
1769 * std::vector<double> mu_infty;
1770 * std::vector<double> alpha_infty;
1771 * std::vector<double> mu_mode_1;
1772 * std::vector<double> alpha_mode_1;
1773 * double viscosity_mode_1;
1774 * SymmetricTensor<2, dim, double> Cinv_v_1;
1775 * SymmetricTensor<2, dim, double> Cinv_v_1_converged;
1776 * SymmetricTensor<2, dim, NumberType> tau_neq_1;
1778 * SymmetricTensor<2, dim, NumberType>
1779 * get_tau_E_base(const Tensor<2,dim, NumberType> &F) const
1781 * return ( get_tau_E_neq() + get_tau_E_eq(F) );
1784 * SymmetricTensor<2, dim, NumberType>
1785 * get_tau_E_eq(const Tensor<2,dim, NumberType> &F) const
1787 * const SymmetricTensor<2, dim, NumberType> B = symmetrize(F * transpose(F));
1789 * std::array< std::pair< NumberType, Tensor< 1, dim, NumberType > >, dim > eigen_B;
1790 * eigen_B = eigenvectors(B, this->eigen_solver);
1792 * SymmetricTensor<2, dim, NumberType> tau;
1793 * static const SymmetricTensor< 2, dim, double>
1794 * I (Physics::Elasticity::StandardTensors<dim>::I);
1796 * for (unsigned int i = 0; i < 3; ++i)
1798 * for (unsigned int A = 0; A < dim; ++A)
1800 * SymmetricTensor<2, dim, NumberType> tau_aux1 = symmetrize(
1801 * outer_product(eigen_B[A].second,eigen_B[A].second));
1802 * tau_aux1 *= mu_infty[i]*std::pow(eigen_B[A].first, (alpha_infty[i]/2.) );
1805 * SymmetricTensor<2, dim, NumberType> tau_aux2 (I);
1806 * tau_aux2 *= mu_infty[i];
1812 * SymmetricTensor<2, dim, NumberType>
1813 * get_tau_E_neq() const
1819 * get_beta_mode_1(std::vector< NumberType > &lambda, const int &A) const
1821 * NumberType beta = 0.0;
1823 * for (unsigned int i = 0; i < 3; ++i) //3rd-order Ogden model
1826 * NumberType aux = 0.0;
1827 * for (int p = 0; p < dim; ++p)
1828 * aux += std::pow(lambda[p],alpha_mode_1[i]);
1831 * aux += std::pow(lambda[A], alpha_mode_1[i]);
1832 * aux *= mu_mode_1[i];
1840 * get_gamma_mode_1(std::vector< NumberType > &lambda,
1842 * const int &B ) const
1844 * NumberType gamma = 0.0;
1848 * for (unsigned int i = 0; i < 3; ++i)
1850 * NumberType aux = 0.0;
1851 * for (int p = 0; p < dim; ++p)
1852 * aux += std::pow(lambda[p],alpha_mode_1[i]);
1854 * aux *= 1.0/(dim*dim);
1855 * aux += 1.0/dim * std::pow(lambda[A], alpha_mode_1[i]);
1856 * aux *= mu_mode_1[i]*alpha_mode_1[i];
1863 * for (unsigned int i = 0; i < 3; ++i)
1865 * NumberType aux = 0.0;
1866 * for (int p = 0; p < dim; ++p)
1867 * aux += std::pow(lambda[p],alpha_mode_1[i]);
1869 * aux *= 1.0/(dim*dim);
1870 * aux -= 1.0/dim * std::pow(lambda[A], alpha_mode_1[i]);
1871 * aux -= 1.0/dim * std::pow(lambda[B], alpha_mode_1[i]);
1872 * aux *= mu_mode_1[i]*alpha_mode_1[i];
1886 * <a name="Constitutiveequationforthefluidcomponentofthebiphasicmaterial
"></a>
1887 * <h3>Constitutive equation for the fluid component of the biphasic material</h3>
1888 * We consider two slightly different definitions to define the seepage velocity with a Darcy-like law.
1889 * Ehlers & Eipper 1999, doi:10.1023/A:1006565509095
1890 * Markert 2007, doi:10.1007/s11242-007-9107-6
1891 * The selection of one or another is made by the user via the parameters file.
1894 * template <int dim, typename NumberType = Sacado::Fad::DFad<double> >
1895 * class Material_Darcy_Fluid
1898 * Material_Darcy_Fluid(const Parameters::AllParameters ¶meters)
1900 * fluid_type(parameters.fluid_type),
1901 * n_OS(parameters.solid_vol_frac),
1902 * initial_intrinsic_permeability(parameters.init_intrinsic_perm),
1903 * viscosity_FR(parameters.viscosity_FR),
1904 * initial_darcy_coefficient(parameters.init_darcy_coef),
1905 * weight_FR(parameters.weight_FR),
1906 * kappa_darcy(parameters.kappa_darcy),
1907 * gravity_term(parameters.gravity_term),
1908 * density_FR(parameters.density_FR),
1909 * gravity_direction(parameters.gravity_direction),
1910 * gravity_value(parameters.gravity_value)
1912 * Assert(kappa_darcy >= 0, ExcInternalError());
1914 * ~Material_Darcy_Fluid()
1917 * Tensor<1, dim, NumberType> get_seepage_velocity_current
1918 * (const Tensor<2,dim, NumberType> &F,
1919 * const Tensor<1,dim, NumberType> &grad_p_fluid) const
1921 * const NumberType det_F = determinant(F);
1922 * Assert(det_F > 0.0, ExcInternalError());
1924 * Tensor<2, dim, NumberType> permeability_term;
1926 * if (fluid_type == "Markert
")
1927 * permeability_term = get_instrinsic_permeability_current(F) / viscosity_FR;
1929 * else if (fluid_type == "Ehlers
")
1930 * permeability_term = get_darcy_flow_current(F) / weight_FR;
1933 * AssertThrow(false, ExcMessage(
1934 * "Material_Darcy_Fluid --> Only Markert
"
1935 * "and Ehlers formulations have been implemented.
"));
1937 * return ( -1.0 * permeability_term * det_F
1938 * * (grad_p_fluid - get_body_force_FR_current()) );
1941 * double get_porous_dissipation(const Tensor<2,dim, NumberType> &F,
1942 * const Tensor<1,dim, NumberType> &grad_p_fluid) const
1944 * NumberType dissipation_term;
1945 * Tensor<1, dim, NumberType> seepage_velocity;
1946 * Tensor<2, dim, NumberType> permeability_term;
1948 * const NumberType det_F = determinant(F);
1949 * Assert(det_F > 0.0, ExcInternalError());
1951 * if (fluid_type == "Markert
")
1953 * permeability_term = get_instrinsic_permeability_current(F) / viscosity_FR;
1954 * seepage_velocity = get_seepage_velocity_current(F,grad_p_fluid);
1956 * else if (fluid_type == "Ehlers
")
1958 * permeability_term = get_darcy_flow_current(F) / weight_FR;
1959 * seepage_velocity = get_seepage_velocity_current(F,grad_p_fluid);
1962 * AssertThrow(false, ExcMessage(
1963 * "Material_Darcy_Fluid --> Only Markert and Ehlers
"
1964 * "formulations have been implemented.
"));
1966 * dissipation_term = ( invert(permeability_term) * seepage_velocity ) * seepage_velocity;
1967 * dissipation_term *= 1.0/(det_F*det_F);
1968 * return Tensor<0,dim,double>(dissipation_term);
1972 * const std::string fluid_type;
1973 * const double n_OS;
1974 * const double initial_intrinsic_permeability;
1975 * const double viscosity_FR;
1976 * const double initial_darcy_coefficient;
1977 * const double weight_FR;
1978 * const double kappa_darcy;
1979 * const bool gravity_term;
1980 * const double density_FR;
1981 * const int gravity_direction;
1982 * const double gravity_value;
1984 * Tensor<2, dim, NumberType>
1985 * get_instrinsic_permeability_current(const Tensor<2,dim, NumberType> &F) const
1987 * static const SymmetricTensor< 2, dim, double>
1988 * I (Physics::Elasticity::StandardTensors<dim>::I);
1989 * const Tensor<2, dim, NumberType> initial_instrinsic_permeability_tensor
1990 * = Tensor<2, dim, double>(initial_intrinsic_permeability * I);
1992 * const NumberType det_F = determinant(F);
1993 * Assert(det_F > 0.0, ExcInternalError());
1995 * const NumberType fraction = (det_F - n_OS)/(1 - n_OS);
1996 * return ( NumberType (std::pow(fraction, kappa_darcy))
1997 * * initial_instrinsic_permeability_tensor );
2000 * Tensor<2, dim, NumberType>
2001 * get_darcy_flow_current(const Tensor<2,dim, NumberType> &F) const
2003 * static const SymmetricTensor< 2, dim, double>
2004 * I (Physics::Elasticity::StandardTensors<dim>::I);
2005 * const Tensor<2, dim, NumberType> initial_darcy_flow_tensor
2006 * = Tensor<2, dim, double>(initial_darcy_coefficient * I);
2008 * const NumberType det_F = determinant(F);
2009 * Assert(det_F > 0.0, ExcInternalError());
2011 * const NumberType fraction = (1.0 - (n_OS / det_F) )/(1.0 - n_OS);
2012 * return ( NumberType (std::pow(fraction, kappa_darcy))
2013 * * initial_darcy_flow_tensor);
2016 * Tensor<1, dim, NumberType>
2017 * get_body_force_FR_current() const
2019 * Tensor<1, dim, NumberType> body_force_FR_current;
2021 * if (gravity_term == true)
2023 * Tensor<1, dim, NumberType> gravity_vector;
2024 * gravity_vector[gravity_direction] = gravity_value;
2025 * body_force_FR_current = density_FR * gravity_vector;
2027 * return body_force_FR_current;
2034 * <a name="Quadraturepointhistory
"></a>
2035 * <h3>Quadrature point history</h3>
2036 * As seen in @ref step_18 "step-18
", the <code> PointHistory </code> class offers a method
2037 * for storing data at the quadrature points. Here each quadrature point
2038 * holds a pointer to a material description. Thus, different material models
2039 * can be used in different regions of the domain. Among other data, we
2040 * choose to store the ``extra" Kirchhoff stress @f$\boldsymbol{\tau}_E@f$ and
2041 * the dissipation
values @f$\mathcal{D}_p@f$ and @f$\mathcal{D}_v@f$.
2044 *
template <
int dim,
typename NumberType = Sacado::Fad::DFad<
double> >
2045 *
class PointHistory
2051 *
virtual ~PointHistory()
2054 *
void setup_lqp (
const Parameters::AllParameters ¶meters,
2057 *
if (parameters.mat_type ==
"Neo-Hooke")
2058 * solid_material.reset(
new NeoHooke<dim,NumberType>(parameters,time));
2059 *
else if (parameters.mat_type ==
"Ogden")
2060 * solid_material.reset(
new Ogden<dim,NumberType>(parameters,time));
2061 *
else if (parameters.mat_type ==
"visco-Ogden")
2062 * solid_material.reset(
new visco_Ogden<dim,NumberType>(parameters,time));
2066 * fluid_material.reset(
new Material_Darcy_Fluid<dim,NumberType>(parameters));
2072 *
return solid_material->get_tau_E(
F);
2078 *
return solid_material->get_Cauchy_E(
F);
2082 * get_converged_det_F() const
2084 *
return solid_material->get_converged_det_F();
2088 * update_end_timestep()
2090 * solid_material->update_end_timestep();
2096 * solid_material->update_internal_equilibrium(
F);
2100 * get_viscous_dissipation() const
2102 *
return solid_material->get_viscous_dissipation();
2109 *
return fluid_material->get_seepage_velocity_current(
F, grad_p_fluid);
2116 *
return fluid_material->get_porous_dissipation(
F, grad_p_fluid);
2121 *
const Parameters::AllParameters ¶meters)
const
2125 *
if (parameters.gravity_term ==
true)
2130 *
const NumberType overall_density_ref
2131 * = parameters.density_SR * parameters.solid_vol_frac
2132 * + parameters.density_FR
2133 * * (det_F_AD - parameters.solid_vol_frac);
2136 * gravity_vector[parameters.gravity_direction] = parameters.gravity_value;
2137 * body_force = overall_density_ref * gravity_vector;
2140 *
return body_force;
2143 * std::shared_ptr< Material_Hyperelastic<dim, NumberType> > solid_material;
2144 * std::shared_ptr< Material_Darcy_Fluid<dim, NumberType> > fluid_material;
2150 * <a name=
"Nonlinearporoviscoelasticsolid"></a>
2151 * <h3>Nonlinear poro-viscoelastic solid</h3>
2152 * The Solid
class is the central class as it represents the problem at hand:
2153 * the nonlinear poro-viscoelastic solid
2156 * template <int dim>
2160 * Solid(
const Parameters::AllParameters ¶meters);
2165 *
using ADNumberType = Sacado::Fad::DFad<double>;
2167 * std::ofstream outfile;
2168 * std::ofstream pointfile;
2170 *
struct PerTaskData_ASM;
2171 *
template<
typename NumberType =
double>
struct ScratchData_ASM;
2178 *
virtual void make_grid() = 0;
2182 * Define points
for post-processing
2185 *
virtual void define_tracked_vertices(std::vector<
Point<dim> > &tracked_vertices) = 0;
2189 * Set up the finite element system to be solved:
2196 * Extract sub-blocks from the global
matrix
2199 *
void determine_component_extractors();
2203 * Several
functions to
assemble the system and right hand side matrices
using multithreading.
2206 *
void assemble_system
2208 *
void assemble_system_one_cell
2210 * ScratchData_ASM<ADNumberType> &scratch,
2211 * PerTaskData_ASM &data)
const;
2212 *
void copy_local_to_global_system(
const PerTaskData_ASM &data);
2216 * Define boundary conditions
2219 *
virtual void make_constraints(
const int &it_nr);
2225 *
virtual double get_prescribed_fluid_flow
2229 * get_reaction_boundary_id_for_output ()
const = 0;
2230 *
virtual std::pair<types::boundary_id,types::boundary_id>
2231 * get_drained_boundary_id_for_output ()
const = 0;
2232 *
virtual std::vector<double> get_dirichlet_load
2234 *
const int &direction)
const = 0;
2238 * Create and update the quadrature points.
2245 * Solve non-linear system
using a Newton-Raphson scheme
2252 * Solve the linearized equations
using a direct solver
2259 * Retrieve the solution
2267 * Store the converged
values of the
internal variables at the
end of each timestep
2270 *
void update_end_timestep();
2274 * Post-processing and writing data to files
2277 *
void output_results_to_vtu(
const unsigned int timestep,
2278 *
const double current_time,
2280 *
void output_results_to_plot(
const unsigned int timestep,
2281 *
const double current_time,
2283 * std::vector<
Point<dim> > &tracked_vertices,
2284 * std::ofstream &pointfile)
const;
2288 * Headers and footer
for the output files
2291 *
void print_console_file_header( std::ofstream &outfile)
const;
2292 *
void print_plot_file_header(std::vector<
Point<dim> > &tracked_vertices,
2293 * std::ofstream &pointfile)
const;
2294 *
void print_console_file_footer(std::ofstream &outfile)
const;
2295 *
void print_plot_file_footer( std::ofstream &pointfile)
const;
2309 *
A collection of the parameters used to describe the problem setup
2312 *
const Parameters::AllParameters ¶meters;
2323 * Keep track of the current time and the time spent evaluating certain
functions
2332 *
A storage
object for quadrature
point information.
2339 * Integers to store polynomial degree (needed
for output)
2342 *
const unsigned int degree_displ;
2343 *
const unsigned int degree_pore;
2347 * Declare an instance of
dealii FESystem class (finite element definition)
2361 * Integer to store DoFs per element (
this value will be used often)
2364 *
const unsigned int dofs_per_cell;
2368 * Declare an instance of
dealii Extractor objects used to retrieve information from the solution vectors
2369 * We will use
"u_fe" and
"p_fluid_fe"as subscript in
operator [] expressions on
FEValues and
FEFaceValues
2370 * objects to
extract the components of the displacement vector and fluid pressure, respectively.
2378 * Description of how the block-system is arranged. There are 3 blocks:
2379 * 0 - vector DOF displacements u
2380 * 1 -
scalar DOF fluid pressure p_fluid
2383 *
static const unsigned int n_blocks = 2;
2384 *
static const unsigned int n_components = dim+1;
2385 *
static const unsigned int first_u_component = 0;
2386 *
static const unsigned int p_fluid_component = dim;
2409 * std::vector<unsigned int> block_component;
2416 * std::vector<IndexSet> all_locally_owned_dofs;
2419 * std::vector<IndexSet> locally_owned_partitioning;
2420 * std::vector<IndexSet> locally_relevant_partitioning;
2422 * std::vector<types::global_dof_index> dofs_per_block;
2423 * std::vector<types::global_dof_index> element_indices_u;
2424 * std::vector<types::global_dof_index> element_indices_p_fluid;
2428 * Declare an instance of
dealii QGauss class (The Gauss-Legendre family of quadrature rules
for numerical integration)
2429 * Gauss Points in element, with n quadrature points (in each space direction <dim> )
2435 * Gauss Points on element faces (used
for definition of BCs)
2438 *
const QGauss<dim - 1> qf_face;
2441 * Integer to store num GPs per element (
this value will be used often)
2444 *
const unsigned int n_q_points;
2447 * Integer to store num GPs per face (
this value will be used often)
2450 *
const unsigned int n_q_points_f;
2454 * Declare an instance of
dealii AffineConstraints class (linear constraints on DoFs due to hanging nodes or BCs)
2461 * Declare an instance of
dealii classes necessary
for FE system
set-up and assembly
2469 * Right hand side vector of forces
2475 * Total displacement
values + pressure (accumulated solution to FE system)
2482 * Non-block system
for the direct solver. We will
copy the block system into these to solve the linearized system of equations.
2490 * We define variables to store norms and update norms and normalisation factors.
2497 *
norm(1.0), u(1.0), p_fluid(1.0)
2506 *
void normalise(
const Errors &rhs)
2508 *
if (rhs.norm != 0.0)
2512 *
if (rhs.p_fluid != 0.0)
2513 * p_fluid /= rhs.p_fluid;
2516 *
double norm, u, p_fluid;
2521 * Declare several instances of the
"Error" structure
2524 * Errors error_residual, error_residual_0, error_residual_norm, error_update,
2525 * error_update_0, error_update_norm;
2529 * Methods to calculate error measures
2532 *
void get_error_residual(Errors &error_residual_OUT);
2533 *
void get_error_update
2535 * Errors &error_update_OUT);
2539 * Print information to screen
2542 *
void print_conv_header();
2543 *
void print_conv_footer();
2556 * <a name=
"ImplementationofthecodeSolidcodeclass"></a>
2557 * <h3>Implementation of the <code>Solid</code>
class</h3>
2559 * <a name=
"Publicinterface"></a>
2560 * <h4>Public interface</h4>
2561 * We initialise the Solid
class using data extracted from the parameter file.
2564 *
template <
int dim>
2565 * Solid<dim>::Solid(
const Parameters::AllParameters ¶meters)
2567 * mpi_communicator(MPI_COMM_WORLD),
2571 * parameters(parameters),
2573 * time(parameters.end_time, parameters.delta_t),
2574 * timerconsole( mpi_communicator,
2578 * timerfile( mpi_communicator,
2582 * degree_displ(parameters.poly_degree_displ),
2583 * degree_pore(parameters.poly_degree_pore),
2584 * fe(
FE_Q<dim>(parameters.poly_degree_displ), dim,
2585 *
FE_Q<dim>(parameters.poly_degree_pore), 1 ),
2587 * dofs_per_cell (fe.dofs_per_cell),
2588 * u_fe(first_u_component),
2589 * p_fluid_fe(p_fluid_component),
2590 * x_displacement(first_u_component),
2591 * y_displacement(first_u_component+1),
2592 * z_displacement(first_u_component+2),
2593 * pressure(p_fluid_component),
2595 * qf_cell(parameters.quad_order),
2596 * qf_face(parameters.quad_order),
2597 * n_q_points (qf_cell.size()),
2598 * n_q_points_f (qf_face.size())
2600 *
Assert(dim==3,
ExcMessage(
"This problem only works in 3 space dimensions."));
2601 * determine_component_extractors();
2606 * The
class destructor simply clears the data held by the DOFHandler
2609 *
template <
int dim>
2610 * Solid<dim>::~Solid()
2612 * dof_handler_ref.clear();
2617 * Runs the 3D solid problem
2620 *
template <
int dim>
2625 * The current solution increment is defined as a block vector to reflect the structure
2626 * of the PDE system, with multiple solution components
2638 * outfile.open(
"console-output.sol");
2639 * print_console_file_header(outfile);
2651 * Assign DOFs and create the stiffness and right-hand-side force vector
2654 * system_setup(solution_delta);
2658 * Define points
for post-processing
2661 * std::vector<Point<dim> > tracked_vertices (2);
2662 * define_tracked_vertices(tracked_vertices);
2663 * std::vector<Point<dim>> reaction_force;
2667 * pointfile.open(
"data-for-gnuplot.sol");
2668 * print_plot_file_header(tracked_vertices, pointfile);
2673 * Print results to output file
2676 *
if (parameters.outfiles_requested ==
"true")
2678 * output_results_to_vtu(time.get_timestep(),
2679 * time.get_current(),
2683 * output_results_to_plot(time.get_timestep(),
2684 * time.get_current(),
2691 * Increment time step (=load step)
2692 * NOTE: In solving the quasi-
static problem, the time becomes a loading parameter,
2693 * i.e. we increase the loading linearly with time, making the two concepts interchangeable.
2696 * time.increment_time();
2700 * Print information on screen
2703 * pcout <<
"\nSolver:";
2704 * pcout <<
"\n CST = make constraints";
2705 * pcout <<
"\n ASM_SYS = assemble system";
2706 * pcout <<
"\n SLV = linear solver \n";
2710 * Print information on file
2713 * outfile <<
"\nSolver:";
2714 * outfile <<
"\n CST = make constraints";
2715 * outfile <<
"\n ASM_SYS = assemble system";
2716 * outfile <<
"\n SLV = linear solver \n";
2718 *
while ( (time.get_end() - time.get_current()) > -1.0*parameters.tol_u )
2722 * Initialize the current solution increment to
zero
2725 * solution_delta = 0.0;
2729 * Solve the non-linear system
using a Newton-Rapshon scheme
2732 * solve_nonlinear_timestep(solution_delta);
2736 * Add the computed solution increment to total solution
2739 * solution_n += solution_delta;
2746 * update_end_timestep();
2753 *
if (( (time.get_timestep()%parameters.timestep_output) == 0 )
2754 * && (parameters.outfiles_requested ==
"true") )
2756 * output_results_to_vtu(time.get_timestep(),
2757 * time.get_current(),
2761 * output_results_to_plot(time.get_timestep(),
2762 * time.get_current(),
2769 * Increment the time step (=load step)
2772 * time.increment_time();
2777 * Print the footers and close files
2782 * print_plot_file_footer(pointfile);
2783 * pointfile.close ();
2784 * print_console_file_footer(outfile);
2788 * NOTE: ideally, we should close the outfile here [ >> outfile.close (); ]
2789 * But
if we
do, then the timer output will not be printed. That is why we leave it open.
2798 * <a name=
"Privateinterface"></a>
2799 * <h4>Private interface</h4>
2800 * We define the structures needed
for parallelization with Threading Building Blocks (TBB)
2801 * Tangent
matrix and right-hand side force vector assembly structures.
2802 * PerTaskData_ASM stores local contributions
2805 *
template <
int dim>
2806 *
struct Solid<dim>::PerTaskData_ASM
2810 * std::vector<types::global_dof_index> local_dof_indices;
2812 * PerTaskData_ASM(
const unsigned int dofs_per_cell)
2815 * cell_rhs(dofs_per_cell),
2816 * local_dof_indices(dofs_per_cell)
2828 * ScratchData_ASM stores larger objects used during the assembly
2831 *
template <
int dim>
2832 *
template <
typename NumberType>
2833 *
struct Solid<dim>::ScratchData_ASM
2839 * Integration helper
2850 * std::vector<NumberType> local_dof_values;
2851 * std::vector<Tensor<2, dim, NumberType> > solution_grads_u_total;
2852 * std::vector<NumberType> solution_values_p_fluid_total;
2853 * std::vector<Tensor<1, dim, NumberType> > solution_grads_p_fluid_total;
2854 * std::vector<Tensor<1, dim, NumberType> > solution_grads_face_p_fluid_total;
2861 * std::vector<std::vector<Tensor<1,dim>>> Nx;
2862 * std::vector<std::vector<double>> Nx_p_fluid;
2868 * std::vector<std::vector<Tensor<2,dim, NumberType>>> grad_Nx;
2869 * std::vector<std::vector<SymmetricTensor<2,dim, NumberType>>> symm_grad_Nx;
2870 * std::vector<std::vector<Tensor<1,dim, NumberType>>> grad_Nx_p_fluid;
2877 * solution_total (solution_total),
2878 * fe_values_ref(fe_cell, qf_cell, uf_cell),
2879 * fe_face_values_ref(fe_cell, qf_face, uf_face),
2880 * local_dof_values(fe_cell.dofs_per_cell),
2881 * solution_grads_u_total(qf_cell.size()),
2882 * solution_values_p_fluid_total(qf_cell.size()),
2883 * solution_grads_p_fluid_total(qf_cell.size()),
2884 * solution_grads_face_p_fluid_total(qf_face.size()),
2885 * Nx(qf_cell.size(), std::vector<
Tensor<1,dim>>(fe_cell.dofs_per_cell)),
2886 * Nx_p_fluid(qf_cell.size(), std::vector<double>(fe_cell.dofs_per_cell)),
2892 * ScratchData_ASM(
const ScratchData_ASM &rhs)
2894 * solution_total (rhs.solution_total),
2895 * fe_values_ref(rhs.fe_values_ref.get_fe(),
2896 * rhs.fe_values_ref.get_quadrature(),
2897 * rhs.fe_values_ref.get_update_flags()),
2898 * fe_face_values_ref(rhs.fe_face_values_ref.get_fe(),
2899 * rhs.fe_face_values_ref.get_quadrature(),
2900 * rhs.fe_face_values_ref.get_update_flags()),
2901 * local_dof_values(rhs.local_dof_values),
2902 * solution_grads_u_total(rhs.solution_grads_u_total),
2903 * solution_values_p_fluid_total(rhs.solution_values_p_fluid_total),
2904 * solution_grads_p_fluid_total(rhs.solution_grads_p_fluid_total),
2905 * solution_grads_face_p_fluid_total(rhs.solution_grads_face_p_fluid_total),
2907 * Nx_p_fluid(rhs.Nx_p_fluid),
2908 * grad_Nx(rhs.grad_Nx),
2909 * symm_grad_Nx(rhs.symm_grad_Nx),
2910 * grad_Nx_p_fluid(rhs.grad_Nx_p_fluid)
2915 *
const unsigned int n_q_points = Nx_p_fluid.size();
2916 *
const unsigned int n_dofs_per_cell = Nx_p_fluid[0].size();
2920 *
for (
unsigned int k = 0; k < n_dofs_per_cell; ++k)
2922 * local_dof_values[k] = 0.0;
2933 *
for (
unsigned int q_point = 0; q_point < n_q_points; ++q_point)
2939 * solution_grads_u_total[q_point] = 0.0;
2940 * solution_values_p_fluid_total[q_point] = 0.0;
2941 * solution_grads_p_fluid_total[q_point] = 0.0;
2943 *
for (
unsigned int k = 0; k < n_dofs_per_cell; ++k)
2945 * Nx[q_point][k] = 0.0;
2946 * Nx_p_fluid[q_point][k] = 0.0;
2947 * grad_Nx[q_point][k] = 0.0;
2948 * symm_grad_Nx[q_point][k] = 0.0;
2949 * grad_Nx_p_fluid[q_point][k] = 0.0;
2953 *
const unsigned int n_f_q_points = solution_grads_face_p_fluid_total.size();
2956 *
for (
unsigned int f_q_point = 0; f_q_point < n_f_q_points; ++f_q_point)
2957 * solution_grads_face_p_fluid_total[f_q_point] = 0.0;
2963 * Define the boundary conditions on the mesh
2966 *
template <
int dim>
2967 *
void Solid<dim>::make_constraints(
const int &it_nr_IN)
2969 * pcout <<
" CST " << std::flush;
2970 * outfile <<
" CST " << std::flush;
2972 *
if (it_nr_IN > 1)
return;
2974 *
const bool apply_dirichlet_bc = (it_nr_IN == 0);
2976 *
if (apply_dirichlet_bc)
2978 * constraints.clear();
2979 * make_dirichlet_constraints(constraints);
2983 *
for (
unsigned int i=0; i<dof_handler_ref.n_dofs(); ++i)
2984 *
if (constraints.is_inhomogeneously_constrained(i) ==
true)
2985 * constraints.set_inhomogeneity(i,0.0);
2987 * constraints.close();
2992 * Set-up the FE system
2995 *
template <
int dim>
3003 * Determine number of components per block
3006 * std::vector<unsigned int> block_component(n_components, u_block);
3007 * block_component[p_fluid_component] = p_fluid_block;
3011 * The DOF handler is initialised and we renumber the grid in an efficient manner.
3014 * dof_handler_ref.distribute_dofs(fe);
3020 * Count the number of DoFs in each block
3023 * dofs_per_block.clear();
3029 * Setup the sparsity pattern and tangent
matrix
3033 * std::vector<IndexSet> all_locally_relevant_dofs
3036 * locally_owned_dofs.
clear();
3037 * locally_owned_partitioning.clear();
3041 * locally_relevant_dofs.
clear();
3042 * locally_relevant_partitioning.clear();
3046 * locally_owned_partitioning.reserve(
n_blocks);
3047 * locally_relevant_partitioning.reserve(
n_blocks);
3052 * = std::accumulate(dofs_per_block.begin(),
3053 * std::next(dofs_per_block.begin(),
b), 0);
3055 * = std::accumulate(dofs_per_block.begin(),
3056 * std::next(dofs_per_block.begin(),
b+1), 0);
3057 * locally_owned_partitioning.push_back(locally_owned_dofs.
get_view(idx_begin, idx_end));
3058 * locally_relevant_partitioning.push_back(locally_relevant_dofs.
get_view(idx_begin, idx_end));
3063 * Print information on screen
3066 * pcout <<
"\nTriangulation:\n"
3067 * <<
" Number of active cells: "
3069 * <<
" (by partition:";
3071 * pcout << (p==0 ?
' ' :
'+')
3075 * pcout <<
" Number of degrees of freedom: "
3076 * << dof_handler_ref.n_dofs()
3077 * <<
" (by partition:";
3079 * pcout << (p==0 ?
' ' :
'+')
3083 * pcout <<
" Number of degrees of freedom per block: "
3084 * <<
"[n_u, n_p_fluid] = ["
3085 * << dofs_per_block[u_block]
3087 * << dofs_per_block[p_fluid_block]
3093 * Print information to file
3096 * outfile <<
"\nTriangulation:\n"
3097 * <<
" Number of active cells: "
3099 * <<
" (by partition:";
3101 * outfile << (p==0 ?
' ' :
'+')
3105 * outfile <<
" Number of degrees of freedom: "
3106 * << dof_handler_ref.n_dofs()
3107 * <<
" (by partition:";
3109 * outfile << (p==0 ?
' ' :
'+')
3113 * outfile <<
" Number of degrees of freedom per block: "
3114 * <<
"[n_u, n_p_fluid] = ["
3115 * << dofs_per_block[u_block]
3117 * << dofs_per_block[p_fluid_block]
3123 * We optimise the sparsity pattern to reflect
this structure and prevent
3124 * unnecessary data creation
for the right-
diagonal block components.
3128 *
for (
unsigned int ii = 0; ii < n_components; ++ii)
3129 *
for (
unsigned int jj = 0; jj < n_components; ++jj)
3133 * Identify
"zero" matrix components of FE-system (The two components
do not couple)
3136 *
if (((ii == p_fluid_component) && (jj < p_fluid_component))
3137 * || ((ii < p_fluid_component) && (jj == p_fluid_component)) )
3142 * The rest of components
always couple
3149 * mpi_communicator);
3157 * Reinitialize the (sparse) tangent
matrix with the given sparsity pattern.
3160 * tangent_matrix.reinit (bsp);
3164 * Initialize the right hand side and solution vectors with number of DoFs
3167 * system_rhs.reinit(locally_owned_partitioning, mpi_communicator);
3168 * solution_n.reinit(locally_owned_partitioning, mpi_communicator);
3169 * solution_delta_OUT.reinit(locally_owned_partitioning, mpi_communicator);
3177 * mpi_communicator);
3181 * tangent_matrix_nb.reinit (sp);
3182 * system_rhs_nb.
reinit(locally_owned_dofs, mpi_communicator);
3186 * Set up the quadrature
point history
3197 * Component extractors: used to
extract sub-blocks from the global
matrix
3198 * Description of which local element DOFs are attached to which block component
3201 *
template <
int dim>
3202 *
void Solid<dim>::determine_component_extractors()
3204 * element_indices_u.clear();
3205 * element_indices_p_fluid.clear();
3207 *
for (
unsigned int k = 0; k < fe.dofs_per_cell; ++k)
3209 *
const unsigned int k_group = fe.system_to_base_index(k).first.first;
3210 *
if (k_group == u_block)
3211 * element_indices_u.push_back(k);
3212 *
else if (k_group == p_fluid_block)
3213 * element_indices_p_fluid.push_back(k);
3223 * Set-up quadrature
point history (QPH) data objects
3226 *
template <
int dim>
3227 *
void Solid<dim>::setup_qph()
3229 * pcout <<
"\nSetting up quadrature point data..." << std::endl;
3230 * outfile <<
"\nSetting up quadrature point data..." << std::endl;
3234 * Create QPH data objects.
3237 * quadrature_point_history.initialize(
triangulation.begin_active(),
3242 * Setup the
initial quadrature
point data
using the info stored in parameters
3247 * dof_handler_ref.begin_active()),
3249 * dof_handler_ref.end());
3250 *
for (; cell!=endc; ++cell)
3255 *
const std::vector<std::shared_ptr<PointHistory<dim, ADNumberType> > >
3256 * lqph = quadrature_point_history.get_data(cell);
3259 *
for (
unsigned int q_point = 0; q_point < n_q_points; ++q_point)
3260 * lqph[q_point]->setup_lqp(parameters, time);
3266 * Solve the non-linear system
using a Newton-Raphson scheme
3269 *
template <
int dim>
3274 * Print the load step
3277 * pcout << std::endl
3279 * << time.get_timestep()
3281 * << time.get_current()
3284 * outfile << std::endl
3286 * << time.get_timestep()
3288 * << time.get_current()
3294 * Declare newton_update vector (solution of a Newton iteration),
3295 * which must have as many positions as global DoFs.
3299 * (locally_owned_partitioning, mpi_communicator);
3303 * Reset the error storage objects
3306 * error_residual.reset();
3307 * error_residual_0.reset();
3308 * error_residual_norm.reset();
3309 * error_update.reset();
3310 * error_update_0.reset();
3311 * error_update_norm.reset();
3313 * print_conv_header();
3317 * Declare and initialize iterator
for the Newton-Raphson algorithm steps
3320 *
unsigned int newton_iteration = 0;
3324 * Iterate until error is below tolerance or
max number iterations are reached
3327 *
while(newton_iteration < parameters.max_iterations_NR)
3329 * pcout <<
" " << std::setw(2) << newton_iteration <<
" " << std::flush;
3330 * outfile <<
" " << std::setw(2) << newton_iteration <<
" " << std::flush;
3334 * Initialize global stiffness
matrix and global force vector to
zero
3337 * tangent_matrix = 0.0;
3340 * tangent_matrix_nb = 0.0;
3341 * system_rhs_nb = 0.0;
3345 * Apply boundary conditions
3348 * make_constraints(newton_iteration);
3349 * assemble_system(solution_delta_OUT);
3353 * Compute the rhs residual (error between external and
internal forces in FE system)
3356 * get_error_residual(error_residual);
3360 * error_residual in
first iteration is stored to normalize posterior error measures
3363 *
if (newton_iteration == 0)
3364 * error_residual_0 = error_residual;
3368 * Determine the normalised residual error
3371 * error_residual_norm = error_residual;
3372 * error_residual_norm.normalise(error_residual_0);
3376 * If both errors are below the tolerances, exit the
loop.
3377 * We need to
check the residual vector directly
for convergence
3378 * in the load steps where no external forces or displacements are imposed.
3381 *
if ( ((newton_iteration > 0)
3382 * && (error_update_norm.u <= parameters.tol_u)
3383 * && (error_update_norm.p_fluid <= parameters.tol_p_fluid)
3384 * && (error_residual_norm.u <= parameters.tol_f)
3385 * && (error_residual_norm.p_fluid <= parameters.tol_f))
3386 * || ( (newton_iteration > 0)
3387 * && system_rhs.l2_norm() <= parameters.tol_f) )
3389 * pcout <<
"\n ***** CONVERGED! ***** "
3390 * << system_rhs.l2_norm() <<
" "
3391 * <<
" " << error_residual_norm.norm
3392 * <<
" " << error_residual_norm.u
3393 * <<
" " << error_residual_norm.p_fluid
3394 * <<
" " << error_update_norm.norm
3395 * <<
" " << error_update_norm.u
3396 * <<
" " << error_update_norm.p_fluid
3397 * <<
" " << std::endl;
3398 * outfile <<
"\n ***** CONVERGED! ***** "
3399 * << system_rhs.l2_norm() <<
" "
3400 * <<
" " << error_residual_norm.norm
3401 * <<
" " << error_residual_norm.u
3402 * <<
" " << error_residual_norm.p_fluid
3403 * <<
" " << error_update_norm.norm
3404 * <<
" " << error_update_norm.u
3405 * <<
" " << error_update_norm.p_fluid
3406 * <<
" " << std::endl;
3407 * print_conv_footer();
3414 * Solve the linearized system
3417 * solve_linear_system(newton_update);
3418 * constraints.distribute(newton_update);
3422 * Compute the displacement error
3425 * get_error_update(newton_update, error_update);
3429 * error_update in
first iteration is stored to normalize posterior error measures
3432 *
if (newton_iteration == 0)
3433 * error_update_0 = error_update;
3437 * Determine the normalised Newton update error
3440 * error_update_norm = error_update;
3441 * error_update_norm.normalise(error_update_0);
3445 * Determine the normalised residual error
3448 * error_residual_norm = error_residual;
3449 * error_residual_norm.normalise(error_residual_0);
3456 * pcout <<
" | " << std::fixed << std::setprecision(3)
3457 * << std::setw(7) << std::scientific
3458 * << system_rhs.l2_norm()
3459 * <<
" " << error_residual_norm.norm
3460 * <<
" " << error_residual_norm.u
3461 * <<
" " << error_residual_norm.p_fluid
3462 * <<
" " << error_update_norm.norm
3463 * <<
" " << error_update_norm.u
3464 * <<
" " << error_update_norm.p_fluid
3465 * <<
" " << std::endl;
3467 * outfile <<
" | " << std::fixed << std::setprecision(3)
3468 * << std::setw(7) << std::scientific
3469 * << system_rhs.l2_norm()
3470 * <<
" " << error_residual_norm.norm
3471 * <<
" " << error_residual_norm.u
3472 * <<
" " << error_residual_norm.p_fluid
3473 * <<
" " << error_update_norm.norm
3474 * <<
" " << error_update_norm.u
3475 * <<
" " << error_update_norm.p_fluid
3476 * <<
" " << std::endl;
3483 * solution_delta_OUT += newton_update;
3484 * newton_update = 0.0;
3485 * newton_iteration++;
3490 * If maximum allowed number of iterations
for Newton algorithm are reached, print non-convergence message and
abort program
3493 *
AssertThrow (newton_iteration < parameters.max_iterations_NR,
ExcMessage(
"No convergence in nonlinear solver!"));
3498 * Prints the header
for convergence info on console
3501 *
template <
int dim>
3502 *
void Solid<dim>::print_conv_header()
3504 *
static const unsigned int l_width = 120;
3506 *
for (
unsigned int i = 0; i < l_width; ++i)
3512 * pcout << std::endl;
3513 * outfile << std::endl;
3515 * pcout <<
"\n SOLVER STEP | SYS_RES "
3516 * <<
"RES_NORM RES_U RES_P "
3517 * <<
"NU_NORM NU_U NU_P " << std::endl;
3518 * outfile <<
"\n SOLVER STEP | SYS_RES "
3519 * <<
"RES_NORM RES_U RES_P "
3520 * <<
"NU_NORM NU_U NU_P " << std::endl;
3522 *
for (
unsigned int i = 0; i < l_width; ++i)
3527 * pcout << std::endl << std::endl;
3528 * outfile << std::endl << std::endl;
3533 * Prints the footer
for convergence info on console
3536 *
template <
int dim>
3537 *
void Solid<dim>::print_conv_footer()
3539 *
static const unsigned int l_width = 120;
3541 *
for (
unsigned int i = 0; i < l_width; ++i)
3546 * pcout << std::endl << std::endl;
3547 * outfile << std::endl << std::endl;
3549 * pcout <<
"Relative errors:" << std::endl
3550 * <<
"Displacement: "
3551 * << error_update.u / error_update_0.u << std::endl
3552 * <<
"Force (displ): "
3553 * << error_residual.u / error_residual_0.u << std::endl
3554 * <<
"Pore pressure: "
3555 * << error_update.p_fluid / error_update_0.p_fluid << std::endl
3556 * <<
"Force (pore): "
3557 * << error_residual.p_fluid / error_residual_0.p_fluid << std::endl;
3558 * outfile <<
"Relative errors:" << std::endl
3559 * <<
"Displacement: "
3560 * << error_update.u / error_update_0.u << std::endl
3561 * <<
"Force (displ): "
3562 * << error_residual.u / error_residual_0.u << std::endl
3563 * <<
"Pore pressure: "
3564 * << error_update.p_fluid / error_update_0.p_fluid << std::endl
3565 * <<
"Force (pore): "
3566 * << error_residual.p_fluid / error_residual_0.p_fluid << std::endl;
3571 * Determine the
true residual error
for the problem
3574 *
template <
int dim>
3575 *
void Solid<dim>::get_error_residual(Errors &error_residual_OUT)
3578 * constraints.set_zero(error_res);
3580 * error_residual_OUT.norm = error_res.l2_norm();
3581 * error_residual_OUT.u = error_res.block(u_block).l2_norm();
3582 * error_residual_OUT.p_fluid = error_res.block(p_fluid_block).l2_norm();
3587 * Determine the
true Newton update error
for the problem
3590 *
template <
int dim>
3591 *
void Solid<dim>::get_error_update
3593 * Errors &error_update_OUT)
3596 * constraints.set_zero(error_ud);
3598 * error_update_OUT.norm = error_ud.l2_norm();
3599 * error_update_OUT.u = error_ud.block(u_block).l2_norm();
3600 * error_update_OUT.p_fluid = error_ud.block(p_fluid_block).l2_norm();
3605 * Compute the total solution, which is
valid at any Newton step. This is required as, to
reduce
3606 * computational error, the total solution is only updated at the
end of the timestep.
3609 *
template <
int dim>
3615 * Cell interpolation -> Ghosted vector
3619 * solution_total (locally_owned_partitioning,
3620 * locally_relevant_partitioning,
3624 * solution_total = solution_n;
3625 * tmp = solution_delta_IN;
3626 * solution_total += tmp;
3627 *
return solution_total;
3632 * Compute elemental stiffness tensor and right-hand side force vector, and
assemble into global ones
3635 *
template <
int dim>
3640 * pcout <<
" ASM_SYS " << std::flush;
3641 * outfile <<
" ASM_SYS " << std::flush;
3647 * Info given to
FEValues and
FEFaceValues constructors, to indicate which data will be needed at each element.
3661 * Setup a
copy of the data structures required
for the process and pass them, along with the
3665 * PerTaskData_ASM per_task_data(dofs_per_cell);
3666 * ScratchData_ASM<ADNumberType> scratch_data(fe, qf_cell, uf_cell,
3672 * dof_handler_ref.begin_active()),
3674 * dof_handler_ref.end());
3675 *
for (; cell != endc; ++cell)
3680 * assemble_system_one_cell(cell, scratch_data, per_task_data);
3681 * copy_local_to_global_system(per_task_data);
3695 * Add the local elemental contribution to the global stiffness tensor
3696 * We
do it twice,
for the block and the non-block systems
3699 *
template <
int dim>
3700 *
void Solid<dim>::copy_local_to_global_system (
const PerTaskData_ASM &data)
3702 * constraints.distribute_local_to_global(data.cell_matrix,
3704 * data.local_dof_indices,
3708 * constraints.distribute_local_to_global(data.cell_matrix,
3710 * data.local_dof_indices,
3711 * tangent_matrix_nb,
3717 * Compute stiffness
matrix and corresponding rhs
for one element
3720 *
template <
int dim>
3721 *
void Solid<dim>::assemble_system_one_cell
3723 * ScratchData_ASM<ADNumberType> &scratch,
3724 * PerTaskData_ASM &data)
const
3730 * scratch.fe_values_ref.reinit(cell);
3731 * cell->get_dof_indices(data.local_dof_indices);
3735 * Setup automatic differentiation
3738 *
for (
unsigned int k = 0; k < dofs_per_cell; ++k)
3742 * Initialise the dofs
for the cell
using the current solution.
3745 * scratch.local_dof_values[k] = scratch.solution_total[data.local_dof_indices[k]];
3748 * Mark
this cell DoF as an independent variable
3751 * scratch.local_dof_values[k].diff(k, dofs_per_cell);
3756 * Update the quadrature
point solution
3757 * Compute the
values and
gradients of the solution in terms of the AD variables
3760 *
for (
unsigned int q = 0; q < n_q_points; ++q)
3762 *
for (
unsigned int k = 0; k < dofs_per_cell; ++k)
3764 *
const unsigned int k_group = fe.system_to_base_index(k).first.first;
3765 *
if (k_group == u_block)
3768 * scratch.fe_values_ref[u_fe].gradient(k, q);
3769 *
for (
unsigned int dd = 0; dd < dim; ++dd)
3771 *
for (
unsigned int ee = 0; ee < dim; ++ee)
3773 * scratch.solution_grads_u_total[q][dd][ee]
3774 * += scratch.local_dof_values[k] * Grad_Nx_u[dd][ee];
3778 *
else if (k_group == p_fluid_block)
3780 *
const double Nx_p = scratch.fe_values_ref[p_fluid_fe].value(k, q);
3782 * scratch.fe_values_ref[p_fluid_fe].gradient(k, q);
3784 * scratch.solution_values_p_fluid_total[q]
3785 * += scratch.local_dof_values[k] * Nx_p;
3786 *
for (
unsigned int dd = 0; dd < dim; ++dd)
3788 * scratch.solution_grads_p_fluid_total[q][dd]
3789 * += scratch.local_dof_values[k] * Grad_Nx_p[dd];
3799 * Set up pointer
"lgph" to the PointHistory
object of
this element
3802 *
const std::vector<std::shared_ptr<const PointHistory<dim, ADNumberType> > >
3803 * lqph = quadrature_point_history.get_data(cell);
3812 *
for (
unsigned int q_point = 0; q_point < n_q_points; ++q_point)
3819 *
for (
unsigned int i = 0; i < dofs_per_cell; ++i)
3821 *
const unsigned int i_group = fe.system_to_base_index(i).first.first;
3823 *
if (i_group == u_block)
3825 * scratch.Nx[q_point][i] =
3826 * scratch.fe_values_ref[u_fe].value(i, q_point);
3827 * scratch.grad_Nx[q_point][i] =
3828 * scratch.fe_values_ref[u_fe].gradient(i, q_point)*F_inv_AD;
3829 * scratch.symm_grad_Nx[q_point][i] =
3832 *
else if (i_group == p_fluid_block)
3834 * scratch.Nx_p_fluid[q_point][i] =
3835 * scratch.fe_values_ref[p_fluid_fe].value(i, q_point);
3836 * scratch.grad_Nx_p_fluid[q_point][i] =
3837 * scratch.fe_values_ref[p_fluid_fe].gradient(i, q_point)*F_inv_AD;
3846 * Assemble the stiffness
matrix and rhs vector
3849 * std::vector<ADNumberType> residual_ad (dofs_per_cell, ADNumberType(0.0));
3850 *
for (
unsigned int q_point = 0; q_point < n_q_points; ++q_point)
3854 *
const ADNumberType det_F_AD =
determinant(F_AD);
3859 *
const ADNumberType p_fluid = scratch.solution_values_p_fluid_total[q_point];
3862 * PointHistory<dim, ADNumberType> *lqph_q_point_nc =
3863 *
const_cast<PointHistory<dim, ADNumberType>*
>(lqph[q_point].get());
3864 * lqph_q_point_nc->update_internal_equilibrium(F_AD);
3869 * Get some info from constitutive model of solid
3875 * tau_E = lqph[q_point]->get_tau_E(F_AD);
3877 * tau_fluid_vol *= -1.0 * p_fluid * det_F_AD;
3881 * Get some info from constitutive model of fluid
3884 *
const ADNumberType det_F_aux = lqph[q_point]->get_converged_det_F();
3887 * = lqph[q_point]->get_overall_body_force(F_AD, parameters);
3891 * Define some aliases to make the assembly process easier to follow
3894 *
const std::vector<Tensor<1,dim>> &Nu = scratch.Nx[q_point];
3895 *
const std::vector<SymmetricTensor<2, dim, ADNumberType>>
3896 * &symm_grad_Nu = scratch.symm_grad_Nx[q_point];
3897 *
const std::vector<double> &Np = scratch.Nx_p_fluid[q_point];
3898 *
const std::vector<Tensor<1, dim, ADNumberType> > &grad_Np
3899 * = scratch.grad_Nx_p_fluid[q_point];
3901 * = scratch.solution_grads_p_fluid_total[q_point]*F_inv_AD;
3902 *
const double JxW = scratch.fe_values_ref.JxW(q_point);
3904 *
for (
unsigned int i = 0; i < dofs_per_cell; ++i)
3906 *
const unsigned int i_group = fe.system_to_base_index(i).first.first;
3908 *
if (i_group == u_block)
3910 * residual_ad[i] += symm_grad_Nu[i] * ( tau_E + tau_fluid_vol ) * JxW;
3911 * residual_ad[i] -= Nu[i] * overall_body_force * JxW;
3913 *
else if (i_group == p_fluid_block)
3916 * = lqph[q_point]->get_seepage_velocity_current(F_AD, grad_p);
3917 * residual_ad[i] += Np[i] * (det_F_AD - det_F_converged) * JxW;
3918 * residual_ad[i] -= time.get_delta_t() * grad_Np[i]
3919 * * seepage_vel_current * JxW;
3928 * Assemble the Neumann contribution (external force contribution).
3931 *
for (
unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell; ++face)
3933 *
if (cell->face(face)->at_boundary() ==
true)
3935 * scratch.fe_face_values_ref.reinit(cell, face);
3937 *
for (
unsigned int f_q_point = 0; f_q_point < n_q_points_f; ++f_q_point)
3940 * = scratch.fe_face_values_ref.normal_vector(f_q_point);
3942 * = scratch.fe_face_values_ref.quadrature_point(f_q_point);
3944 * = get_neumann_traction(cell->face(face)->boundary_id(), pt,
N);
3946 * = get_prescribed_fluid_flow(cell->face(face)->boundary_id(), pt);
3948 *
if ( (traction.
norm() < 1
e-12) && (
std::abs(flow) < 1
e-12) )
continue;
3950 *
const double JxW_f = scratch.fe_face_values_ref.JxW(f_q_point);
3952 *
for (
unsigned int i = 0; i < dofs_per_cell; ++i)
3954 *
const unsigned int i_group = fe.system_to_base_index(i).first.first;
3956 *
if ((i_group == u_block) && (traction.
norm() > 1
e-12))
3958 *
const unsigned int component_i
3959 * = fe.system_to_component_index(i).first;
3961 * = scratch.fe_face_values_ref.shape_value(i, f_q_point);
3962 * residual_ad[i] -= (Nu_f * traction[component_i]) * JxW_f;
3964 *
if ((i_group == p_fluid_block) && (
std::abs(flow) > 1
e-12))
3967 * = scratch.fe_face_values_ref.shape_value(i, f_q_point);
3968 * residual_ad[i] -= (Nu_p * flow) * JxW_f;
3977 * Linearise the residual
3980 *
for (
unsigned int i = 0; i < dofs_per_cell; ++i)
3982 *
const ADNumberType &R_i = residual_ad[i];
3984 * data.cell_rhs(i) -= R_i.val();
3985 *
for (
unsigned int j=0; j<dofs_per_cell; ++j)
3986 * data.cell_matrix(i,j) += R_i.fastAccessDx(j);
3995 *
template <
int dim>
3996 *
void Solid<dim>::update_end_timestep()
4000 * dof_handler_ref.begin_active()),
4002 * dof_handler_ref.end());
4003 *
for (; cell!=endc; ++cell)
4008 *
const std::vector<std::shared_ptr<PointHistory<dim, ADNumberType> > >
4009 * lqph = quadrature_point_history.get_data(cell);
4011 *
for (
unsigned int q_point = 0; q_point < n_q_points; ++q_point)
4012 * lqph[q_point]->update_end_timestep();
4019 * Solve the linearized equations
4022 *
template <
int dim>
4028 * pcout <<
" SLV " << std::flush;
4029 * outfile <<
" SLV " << std::flush;
4032 * newton_update_nb.
reinit(locally_owned_dofs, mpi_communicator);
4035 * 1.0e-6 * system_rhs_nb.
l2_norm());
4037 * solver.solve(tangent_matrix_nb, newton_update_nb, system_rhs_nb);
4041 * Copy the non-block solution back to block system
4044 *
for (
unsigned int i=0; i<locally_owned_dofs.
n_elements(); ++i)
4048 * newton_update_OUT(idx_i) = newton_update_nb(idx_i);
4058 * Class to be able to output results correctly when
using Paraview
4061 *
template<
int dim,
class DH=DoFHandler<dim> >
4062 *
class FilteredDataOut :
public DataOut<dim, DH>
4065 * FilteredDataOut ()
4068 *
virtual ~FilteredDataOut() {}
4074 * cell = this->dofs->begin_active();
4075 *
while ((cell != this->dofs->end()) &&
4076 * (!cell->is_locally_owned()))
4084 *
if (old_cell != this->dofs->end())
4089 * (predicate,old_cell));
4096 *
template<
int dim,
class DH=DoFHandler<dim> >
4097 *
class FilteredDataOutFaces :
public DataOutFaces<dim,DH>
4100 * FilteredDataOutFaces ()
4103 *
virtual ~FilteredDataOutFaces() {}
4109 * cell = this->dofs->begin_active();
4110 *
while ((cell!=this->dofs->end()) && (!cell->is_locally_owned()))
4118 *
if (old_cell!=this->dofs->end())
4123 * (predicate,old_cell));
4132 * Class to compute
gradient of the pressure
4135 *
template <
int dim>
4139 * GradientPostprocessor (
const unsigned int p_fluid_component)
4143 * p_fluid_component (p_fluid_component)
4146 *
virtual ~GradientPostprocessor(){}
4149 * evaluate_vector_field
4151 * std::vector<Vector<double> > &computed_quantities)
const
4154 * computed_quantities.size());
4155 *
for (
unsigned int p=0; p<input_data.solution_gradients.size(); ++p)
4158 *
for (
unsigned int d=0;
d<dim; ++
d)
4159 * computed_quantities[p][
d]
4160 * = input_data.solution_gradients[p][p_fluid_component][
d];
4165 *
const unsigned int p_fluid_component;
4171 * Print results to
vtu file
4174 *
template <
int dim>
void Solid<dim>::output_results_to_vtu
4175 * (
const unsigned int timestep,
4176 *
const double current_time,
4180 * locally_relevant_partitioning,
4183 * solution_total = solution_IN;
4186 * std::vector<types::subdomain_id> partition_int(
triangulation.n_active_cells());
4187 * GradientPostprocessor<dim> gradient_postprocessor(p_fluid_component);
4191 * Declare local variables with number of stress components
4195 *
unsigned int num_comp_symm_tensor = 6;
4199 * Declare local vectors to store
values
4200 * OUTPUT AVERAGED ON ELEMENTS -------------------------------------------
4203 * std::vector<Vector<double>>cauchy_stresses_total_elements
4204 * (num_comp_symm_tensor,
4206 * std::vector<Vector<double>>cauchy_stresses_E_elements
4207 * (num_comp_symm_tensor,
4209 * std::vector<Vector<double>>stretches_elements
4212 * std::vector<Vector<double>>seepage_velocity_elements
4224 * OUTPUT AVERAGED ON NODES ----------------------------------------------
4225 * We need to create a
new FE space with a single dof per node to avoid
4226 * duplication of the output on nodes
for our problem with dim+1 dofs.
4231 * vertex_handler_ref.distribute_dofs(fe_vertex);
4237 * (vertex_handler_ref.n_dofs());
4239 * (vertex_handler_ref.n_dofs());
4241 * std::vector<Vector<double>>cauchy_stresses_total_vertex_mpi
4242 * (num_comp_symm_tensor,
4244 * std::vector<Vector<double>>sum_cauchy_stresses_total_vertex
4245 * (num_comp_symm_tensor,
4247 * std::vector<Vector<double>>cauchy_stresses_E_vertex_mpi
4248 * (num_comp_symm_tensor,
4250 * std::vector<Vector<double>>sum_cauchy_stresses_E_vertex
4251 * (num_comp_symm_tensor,
4253 * std::vector<Vector<double>>stretches_vertex_mpi
4256 * std::vector<Vector<double>>sum_stretches_vertex
4259 *
Vector<double> porous_dissipation_vertex_mpi(vertex_handler_ref.n_dofs());
4260 *
Vector<double> sum_porous_dissipation_vertex(vertex_handler_ref.n_dofs());
4261 *
Vector<double> viscous_dissipation_vertex_mpi(vertex_handler_ref.n_dofs());
4262 *
Vector<double> sum_viscous_dissipation_vertex(vertex_handler_ref.n_dofs());
4263 *
Vector<double> solid_vol_fraction_vertex_mpi(vertex_handler_ref.n_dofs());
4264 *
Vector<double> sum_solid_vol_fraction_vertex(vertex_handler_ref.n_dofs());
4268 * We need to create a
new FE space with a dim dof per node to
4269 * be able to ouput data on nodes in vector form
4274 * vertex_vec_handler_ref.distribute_dofs(fe_vertex_vec);
4279 *
Vector<double> seepage_velocity_vertex_vec_mpi(vertex_vec_handler_ref.n_dofs());
4280 *
Vector<double> sum_seepage_velocity_vertex_vec(vertex_vec_handler_ref.n_dofs());
4281 *
Vector<double> counter_on_vertices_vec_mpi(vertex_vec_handler_ref.n_dofs());
4282 *
Vector<double> sum_counter_on_vertices_vec(vertex_vec_handler_ref.n_dofs());
4285 * -----------------------------------------------------------------------
4289 * Declare and initialize local unit vectors (to construct tensor basis)
4292 * std::vector<Tensor<1,dim>> basis_vectors (dim,
Tensor<1,dim>() );
4293 *
for (
unsigned int i=0; i<dim; ++i)
4294 * basis_vectors[i][i] = 1;
4298 * Declare an instance of the material
class object
4301 *
if (parameters.mat_type ==
"Neo-Hooke")
4302 * NeoHooke<dim,ADNumberType> material(parameters,time);
4303 *
else if (parameters.mat_type ==
"Ogden")
4304 * Ogden<dim,ADNumberType> material(parameters,time);
4305 *
else if (parameters.mat_type ==
"visco-Ogden")
4306 * visco_Ogden <dim,ADNumberType>material(parameters,time);
4312 * Define a local instance of
FEValues to compute updated
values required
4313 * to calculate stresses
4322 * Iterate through elements (cells) and Gauss Points
4327 * dof_handler_ref.begin_active()),
4329 * dof_handler_ref.end()),
4331 * vertex_handler_ref.begin_active()),
4333 * vertex_vec_handler_ref.begin_active());
4339 *
for (; cell!=endc; ++cell, ++cell_v, ++cell_v_vec)
4345 *
static_cast<int>(cell->material_id());
4347 * fe_values_ref.reinit(cell);
4349 * std::vector<Tensor<2,dim>> solution_grads_u(n_q_points);
4350 * fe_values_ref[u_fe].get_function_gradients(solution_total,
4351 * solution_grads_u);
4353 * std::vector<double> solution_values_p_fluid_total(n_q_points);
4354 * fe_values_ref[p_fluid_fe].get_function_values(solution_total,
4355 * solution_values_p_fluid_total);
4357 * std::vector<Tensor<1,dim>> solution_grads_p_fluid_AD (n_q_points);
4358 * fe_values_ref[p_fluid_fe].get_function_gradients(solution_total,
4359 * solution_grads_p_fluid_AD);
4366 *
for (
unsigned int q_point=0; q_point<n_q_points; ++q_point)
4373 *
const std::vector<std::shared_ptr<const PointHistory<dim,ADNumberType>>>
4374 * lqph = quadrature_point_history.get_data(cell);
4377 *
const double p_fluid = solution_values_p_fluid_total[q_point];
4388 * lqph[q_point]->get_Cauchy_E(F_AD);
4390 *
for (
unsigned int i=0; i<dim; ++i)
4391 *
for (
unsigned int j=0; j<dim; ++j)
4395 * sigma_fluid_vol *= -p_fluid;
4403 *
const double solid_vol_fraction = (parameters.solid_vol_frac)/det_F;
4407 * Green-Lagrange strain
4419 * solution_grads_p_fluid_AD[q_point]*F_inv;
4421 * lqph[q_point]->get_seepage_velocity_current(F_AD, grad_p_fluid_AD);
4428 *
const double porous_dissipation =
4429 * lqph[q_point]->get_porous_dissipation(F_AD, grad_p_fluid_AD);
4430 *
const double viscous_dissipation =
4431 * lqph[q_point]->get_viscous_dissipation();
4435 * OUTPUT AVERAGED ON ELEMENTS -------------------------------------------
4436 * Both average on elements and on nodes is NOT weighted with the
4438 * integration
point to the average. Ideally, it should be weighted,
4439 * but I haven
't invested time in getting it to work properly.
4442 * if (parameters.outtype == "elements")
4444 * for (unsigned int j=0; j<dim; ++j)
4446 * cauchy_stresses_total_elements[j](cell->active_cell_index())
4447 * += ((sigma*basis_vectors[j])*basis_vectors[j])/n_q_points;
4448 * cauchy_stresses_E_elements[j](cell->active_cell_index())
4449 * += ((sigma_E*basis_vectors[j])*basis_vectors[j])/n_q_points;
4450 * stretches_elements[j](cell->active_cell_index())
4451 * += std::sqrt(1.0+2.0*Tensor<0,dim,double>(E_strain[j][j]))
4453 * seepage_velocity_elements[j](cell->active_cell_index())
4454 * += Tensor<0,dim,double>(seepage_vel_AD[j])/n_q_points;
4457 * porous_dissipation_elements(cell->active_cell_index())
4458 * += porous_dissipation/n_q_points;
4459 * viscous_dissipation_elements(cell->active_cell_index())
4460 * += viscous_dissipation/n_q_points;
4461 * solid_vol_fraction_elements(cell->active_cell_index())
4462 * += solid_vol_fraction/n_q_points;
4464 * cauchy_stresses_total_elements[3](cell->active_cell_index())
4465 * += ((sigma*basis_vectors[0])*basis_vectors[1])/n_q_points; //sig_xy
4466 * cauchy_stresses_total_elements[4](cell->active_cell_index())
4467 * += ((sigma*basis_vectors[0])*basis_vectors[2])/n_q_points;//sig_xz
4468 * cauchy_stresses_total_elements[5](cell->active_cell_index())
4469 * += ((sigma*basis_vectors[1])*basis_vectors[2])/n_q_points;//sig_yz
4471 * cauchy_stresses_E_elements[3](cell->active_cell_index())
4472 * += ((sigma_E*basis_vectors[0])* basis_vectors[1])/n_q_points; //sig_xy
4473 * cauchy_stresses_E_elements[4](cell->active_cell_index())
4474 * += ((sigma_E*basis_vectors[0])* basis_vectors[2])/n_q_points;//sig_xz
4475 * cauchy_stresses_E_elements[5](cell->active_cell_index())
4476 * += ((sigma_E*basis_vectors[1])* basis_vectors[2])/n_q_points;//sig_yz
4481 * OUTPUT AVERAGED ON NODES -------------------------------------------
4484 * else if (parameters.outtype == "nodes")
4486 * for (unsigned int v=0; v<(GeometryInfo<dim>::vertices_per_cell); ++v)
4488 * types::global_dof_index local_vertex_indices =
4489 * cell_v->vertex_dof_index(v, 0);
4490 * counter_on_vertices_mpi(local_vertex_indices) += 1;
4491 * for (unsigned int k=0; k<dim; ++k)
4493 * cauchy_stresses_total_vertex_mpi[k](local_vertex_indices)
4494 * += (sigma*basis_vectors[k])*basis_vectors[k];
4495 * cauchy_stresses_E_vertex_mpi[k](local_vertex_indices)
4496 * += (sigma_E*basis_vectors[k])*basis_vectors[k];
4497 * stretches_vertex_mpi[k](local_vertex_indices)
4498 * += std::sqrt(1.0+2.0*Tensor<0,dim,double>(E_strain[k][k]));
4500 * types::global_dof_index local_vertex_vec_indices =
4501 * cell_v_vec->vertex_dof_index(v, k);
4502 * counter_on_vertices_vec_mpi(local_vertex_vec_indices) += 1;
4503 * seepage_velocity_vertex_vec_mpi(local_vertex_vec_indices)
4504 * += Tensor<0,dim,double>(seepage_vel_AD[k]);
4507 * porous_dissipation_vertex_mpi(local_vertex_indices)
4508 * += porous_dissipation;
4509 * viscous_dissipation_vertex_mpi(local_vertex_indices)
4510 * += viscous_dissipation;
4511 * solid_vol_fraction_vertex_mpi(local_vertex_indices)
4512 * += solid_vol_fraction;
4514 * cauchy_stresses_total_vertex_mpi[3](local_vertex_indices)
4515 * += (sigma*basis_vectors[0])*basis_vectors[1]; //sig_xy
4516 * cauchy_stresses_total_vertex_mpi[4](local_vertex_indices)
4517 * += (sigma*basis_vectors[0])*basis_vectors[2];//sig_xz
4518 * cauchy_stresses_total_vertex_mpi[5](local_vertex_indices)
4519 * += (sigma*basis_vectors[1])*basis_vectors[2]; //sig_yz
4521 * cauchy_stresses_E_vertex_mpi[3](local_vertex_indices)
4522 * += (sigma_E*basis_vectors[0])*basis_vectors[1]; //sig_xy
4523 * cauchy_stresses_E_vertex_mpi[4](local_vertex_indices)
4524 * += (sigma_E*basis_vectors[0])*basis_vectors[2];//sig_xz
4525 * cauchy_stresses_E_vertex_mpi[5](local_vertex_indices)
4526 * += (sigma_E*basis_vectors[1])*basis_vectors[2]; //sig_yz
4531 * ---------------------------------------------------------------
4534 * } //end gauss point loop
4539 * Different nodes might have different amount of contributions, e.g.,
4540 * corner nodes have less integration points contributing to the averaged.
4541 * This is why we need a counter and divide at the end, outside the cell loop.
4544 * if (parameters.outtype == "nodes")
4546 * for (unsigned int d=0; d<(vertex_handler_ref.n_dofs()); ++d)
4548 * sum_counter_on_vertices[d] =
4549 * Utilities::MPI::sum(counter_on_vertices_mpi[d],
4550 * mpi_communicator);
4551 * sum_porous_dissipation_vertex[d] =
4552 * Utilities::MPI::sum(porous_dissipation_vertex_mpi[d],
4553 * mpi_communicator);
4554 * sum_viscous_dissipation_vertex[d] =
4555 * Utilities::MPI::sum(viscous_dissipation_vertex_mpi[d],
4556 * mpi_communicator);
4557 * sum_solid_vol_fraction_vertex[d] =
4558 * Utilities::MPI::sum(solid_vol_fraction_vertex_mpi[d],
4559 * mpi_communicator);
4561 * for (unsigned int k=0; k<num_comp_symm_tensor; ++k)
4563 * sum_cauchy_stresses_total_vertex[k][d] =
4564 * Utilities::MPI::sum(cauchy_stresses_total_vertex_mpi[k][d],
4565 * mpi_communicator);
4566 * sum_cauchy_stresses_E_vertex[k][d] =
4567 * Utilities::MPI::sum(cauchy_stresses_E_vertex_mpi[k][d],
4568 * mpi_communicator);
4570 * for (unsigned int k=0; k<dim; ++k)
4572 * sum_stretches_vertex[k][d] =
4573 * Utilities::MPI::sum(stretches_vertex_mpi[k][d],
4574 * mpi_communicator);
4578 * for (unsigned int d=0; d<(vertex_vec_handler_ref.n_dofs()); ++d)
4580 * sum_counter_on_vertices_vec[d] =
4581 * Utilities::MPI::sum(counter_on_vertices_vec_mpi[d],
4582 * mpi_communicator);
4583 * sum_seepage_velocity_vertex_vec[d] =
4584 * Utilities::MPI::sum(seepage_velocity_vertex_vec_mpi[d],
4585 * mpi_communicator);
4588 * for (unsigned int d=0; d<(vertex_handler_ref.n_dofs()); ++d)
4590 * if (sum_counter_on_vertices[d]>0)
4592 * for (unsigned int i=0; i<num_comp_symm_tensor; ++i)
4594 * sum_cauchy_stresses_total_vertex[i][d] /= sum_counter_on_vertices[d];
4595 * sum_cauchy_stresses_E_vertex[i][d] /= sum_counter_on_vertices[d];
4597 * for (unsigned int i=0; i<dim; ++i)
4599 * sum_stretches_vertex[i][d] /= sum_counter_on_vertices[d];
4601 * sum_porous_dissipation_vertex[d] /= sum_counter_on_vertices[d];
4602 * sum_viscous_dissipation_vertex[d] /= sum_counter_on_vertices[d];
4603 * sum_solid_vol_fraction_vertex[d] /= sum_counter_on_vertices[d];
4607 * for (unsigned int d=0; d<(vertex_vec_handler_ref.n_dofs()); ++d)
4609 * if (sum_counter_on_vertices_vec[d]>0)
4611 * sum_seepage_velocity_vertex_vec[d] /= sum_counter_on_vertices_vec[d];
4619 * Add the results to the solution to create the output file for Paraview
4622 * FilteredDataOut<dim> data_out;
4623 * std::vector<DataComponentInterpretation::DataComponentInterpretation>
4625 * DataComponentInterpretation::component_is_part_of_vector);
4626 * comp_type.push_back(DataComponentInterpretation::component_is_scalar);
4628 * GridTools::get_subdomain_association(triangulation, partition_int);
4630 * std::vector<std::string> solution_name(dim, "displacement");
4631 * solution_name.push_back("pore_pressure");
4633 * data_out.attach_dof_handler(dof_handler_ref);
4634 * data_out.add_data_vector(solution_total,
4636 * DataOut<dim>::type_dof_data,
4639 * data_out.add_data_vector(solution_total,
4640 * gradient_postprocessor);
4642 * const Vector<double> partitioning(partition_int.begin(),
4643 * partition_int.end());
4645 * data_out.add_data_vector(partitioning, "partitioning");
4646 * data_out.add_data_vector(material_id, "material_id");
4650 * Integration point results -----------------------------------------------------------
4653 * if (parameters.outtype == "elements")
4655 * data_out.add_data_vector(cauchy_stresses_total_elements[0], "cauchy_xx");
4656 * data_out.add_data_vector(cauchy_stresses_total_elements[1], "cauchy_yy");
4657 * data_out.add_data_vector(cauchy_stresses_total_elements[2], "cauchy_zz");
4658 * data_out.add_data_vector(cauchy_stresses_total_elements[3], "cauchy_xy");
4659 * data_out.add_data_vector(cauchy_stresses_total_elements[4], "cauchy_xz");
4660 * data_out.add_data_vector(cauchy_stresses_total_elements[5], "cauchy_yz");
4662 * data_out.add_data_vector(cauchy_stresses_E_elements[0], "cauchy_E_xx");
4663 * data_out.add_data_vector(cauchy_stresses_E_elements[1], "cauchy_E_yy");
4664 * data_out.add_data_vector(cauchy_stresses_E_elements[2], "cauchy_E_zz");
4665 * data_out.add_data_vector(cauchy_stresses_E_elements[3], "cauchy_E_xy");
4666 * data_out.add_data_vector(cauchy_stresses_E_elements[4], "cauchy_E_xz");
4667 * data_out.add_data_vector(cauchy_stresses_E_elements[5], "cauchy_E_yz");
4669 * data_out.add_data_vector(stretches_elements[0], "stretch_xx");
4670 * data_out.add_data_vector(stretches_elements[1], "stretch_yy");
4671 * data_out.add_data_vector(stretches_elements[2], "stretch_zz");
4673 * data_out.add_data_vector(seepage_velocity_elements[0], "seepage_vel_x");
4674 * data_out.add_data_vector(seepage_velocity_elements[1], "seepage_vel_y");
4675 * data_out.add_data_vector(seepage_velocity_elements[2], "seepage_vel_z");
4677 * data_out.add_data_vector(porous_dissipation_elements, "dissipation_porous");
4678 * data_out.add_data_vector(viscous_dissipation_elements, "dissipation_viscous");
4679 * data_out.add_data_vector(solid_vol_fraction_elements, "solid_vol_fraction");
4681 * else if (parameters.outtype == "nodes")
4683 * data_out.add_data_vector(vertex_handler_ref,
4684 * sum_cauchy_stresses_total_vertex[0],
4686 * data_out.add_data_vector(vertex_handler_ref,
4687 * sum_cauchy_stresses_total_vertex[1],
4689 * data_out.add_data_vector(vertex_handler_ref,
4690 * sum_cauchy_stresses_total_vertex[2],
4692 * data_out.add_data_vector(vertex_handler_ref,
4693 * sum_cauchy_stresses_total_vertex[3],
4695 * data_out.add_data_vector(vertex_handler_ref,
4696 * sum_cauchy_stresses_total_vertex[4],
4698 * data_out.add_data_vector(vertex_handler_ref,
4699 * sum_cauchy_stresses_total_vertex[5],
4702 * data_out.add_data_vector(vertex_handler_ref,
4703 * sum_cauchy_stresses_E_vertex[0],
4705 * data_out.add_data_vector(vertex_handler_ref,
4706 * sum_cauchy_stresses_E_vertex[1],
4708 * data_out.add_data_vector(vertex_handler_ref,
4709 * sum_cauchy_stresses_E_vertex[2],
4711 * data_out.add_data_vector(vertex_handler_ref,
4712 * sum_cauchy_stresses_E_vertex[3],
4714 * data_out.add_data_vector(vertex_handler_ref,
4715 * sum_cauchy_stresses_E_vertex[4],
4717 * data_out.add_data_vector(vertex_handler_ref,
4718 * sum_cauchy_stresses_E_vertex[5],
4721 * data_out.add_data_vector(vertex_handler_ref,
4722 * sum_stretches_vertex[0],
4724 * data_out.add_data_vector(vertex_handler_ref,
4725 * sum_stretches_vertex[1],
4727 * data_out.add_data_vector(vertex_handler_ref,
4728 * sum_stretches_vertex[2],
4731 * std::vector<DataComponentInterpretation::DataComponentInterpretation>
4732 * comp_type_vec(dim,
4733 * DataComponentInterpretation::component_is_part_of_vector);
4734 * std::vector<std::string> solution_name_vec(dim,"seepage_velocity");
4736 * data_out.add_data_vector(vertex_vec_handler_ref,
4737 * sum_seepage_velocity_vertex_vec,
4738 * solution_name_vec,
4741 * data_out.add_data_vector(vertex_handler_ref,
4742 * sum_porous_dissipation_vertex,
4743 * "dissipation_porous");
4744 * data_out.add_data_vector(vertex_handler_ref,
4745 * sum_viscous_dissipation_vertex,
4746 * "dissipation_viscous");
4747 * data_out.add_data_vector(vertex_handler_ref,
4748 * sum_solid_vol_fraction_vertex,
4749 * "solid_vol_fraction");
4753 * ---------------------------------------------------------------------
4759 * data_out.build_patches(degree_displ);
4763 * static std::string get_filename_vtu(unsigned int process,
4764 * unsigned int timestep,
4765 * const unsigned int n_digits = 5)
4767 * std::ostringstream filename_vtu;
4770 * << Utilities::int_to_string(process, n_digits)
4772 * << Utilities::int_to_string(timestep, n_digits)
4774 * return filename_vtu.str();
4777 * static std::string get_filename_pvtu(unsigned int timestep,
4778 * const unsigned int n_digits = 5)
4780 * std::ostringstream filename_vtu;
4783 * << Utilities::int_to_string(timestep, n_digits)
4785 * return filename_vtu.str();
4788 * static std::string get_filename_pvd (void)
4790 * std::ostringstream filename_vtu;
4792 * << "solution.pvd";
4793 * return filename_vtu.str();
4797 * const std::string filename_vtu = Filename::get_filename_vtu(this_mpi_process,
4799 * std::ofstream output(filename_vtu.c_str());
4800 * data_out.write_vtu(output);
4804 * We have a collection of files written in parallel
4805 * This next set of steps should only be performed by master process
4808 * if (this_mpi_process == 0)
4812 * List of all files written out at this timestep by all processors
4815 * std::vector<std::string> parallel_filenames_vtu;
4816 * for (unsigned int p=0; p<n_mpi_processes; ++p)
4818 * parallel_filenames_vtu.push_back(Filename::get_filename_vtu(p, timestep));
4821 * const std::string filename_pvtu(Filename::get_filename_pvtu(timestep));
4822 * std::ofstream pvtu_master(filename_pvtu.c_str());
4823 * data_out.write_pvtu_record(pvtu_master,
4824 * parallel_filenames_vtu);
4828 * Time dependent data master file
4831 * static std::vector<std::pair<double,std::string>> time_and_name_history;
4832 * time_and_name_history.push_back(std::make_pair(current_time,
4834 * const std::string filename_pvd(Filename::get_filename_pvd());
4835 * std::ofstream pvd_output(filename_pvd.c_str());
4836 * DataOutBase::write_pvd_record(pvd_output, time_and_name_history);
4843 * Print results to plotting file
4846 * template <int dim>
4847 * void Solid<dim>::output_results_to_plot(
4848 * const unsigned int timestep,
4849 * const double current_time,
4850 * TrilinosWrappers::MPI::BlockVector solution_IN,
4851 * std::vector<Point<dim> > &tracked_vertices_IN,
4852 * std::ofstream &plotpointfile) const
4854 * TrilinosWrappers::MPI::BlockVector solution_total(locally_owned_partitioning,
4855 * locally_relevant_partitioning,
4860 * solution_total = solution_IN;
4864 * Variables needed to print the solution file for plotting
4867 * Point<dim> reaction_force;
4868 * Point<dim> reaction_force_pressure;
4869 * Point<dim> reaction_force_extra;
4870 * double total_fluid_flow = 0.0;
4871 * double total_porous_dissipation = 0.0;
4872 * double total_viscous_dissipation = 0.0;
4873 * double total_solid_vol = 0.0;
4874 * double total_vol_current = 0.0;
4875 * double total_vol_reference = 0.0;
4876 * std::vector<Point<dim+1>> solution_vertices(tracked_vertices_IN.size());
4880 * Auxiliar variables needed for mpi processing
4883 * Tensor<1,dim> sum_reaction_mpi;
4884 * Tensor<1,dim> sum_reaction_pressure_mpi;
4885 * Tensor<1,dim> sum_reaction_extra_mpi;
4886 * sum_reaction_mpi = 0.0;
4887 * sum_reaction_pressure_mpi = 0.0;
4888 * sum_reaction_extra_mpi = 0.0;
4889 * double sum_total_flow_mpi = 0.0;
4890 * double sum_porous_dissipation_mpi = 0.0;
4891 * double sum_viscous_dissipation_mpi = 0.0;
4892 * double sum_solid_vol_mpi = 0.0;
4893 * double sum_vol_current_mpi = 0.0;
4894 * double sum_vol_reference_mpi = 0.0;
4898 * Declare an instance of the material class object
4901 * if (parameters.mat_type == "Neo-Hooke")
4902 * NeoHooke<dim,ADNumberType> material(parameters,time);
4903 * else if (parameters.mat_type == "Ogden")
4904 * Ogden<dim,ADNumberType> material(parameters, time);
4905 * else if (parameters.mat_type == "visco-Ogden")
4906 * visco_Ogden <dim,ADNumberType>material(parameters,time);
4908 * Assert (false, ExcMessage("Material type not implemented"));
4912 * Define a local instance of FEValues to compute updated values required
4913 * to calculate stresses
4916 * const UpdateFlags uf_cell(update_values | update_gradients |
4917 * update_JxW_values);
4918 * FEValues<dim> fe_values_ref (fe, qf_cell, uf_cell);
4922 * Iterate through elements (cells) and Gauss Points
4925 * FilteredIterator<typename DoFHandler<dim>::active_cell_iterator>
4926 * cell(IteratorFilters::LocallyOwnedCell(),
4927 * dof_handler_ref.begin_active()),
4928 * endc(IteratorFilters::LocallyOwnedCell(),
4929 * dof_handler_ref.end());
4935 * for (; cell!=endc; ++cell)
4937 * Assert(cell->is_locally_owned(), ExcInternalError());
4938 * Assert(cell->subdomain_id() == this_mpi_process, ExcInternalError());
4940 * fe_values_ref.reinit(cell);
4942 * std::vector<Tensor<2,dim>> solution_grads_u(n_q_points);
4943 * fe_values_ref[u_fe].get_function_gradients(solution_total,
4944 * solution_grads_u);
4946 * std::vector<double> solution_values_p_fluid_total(n_q_points);
4947 * fe_values_ref[p_fluid_fe].get_function_values(solution_total,
4948 * solution_values_p_fluid_total);
4950 * std::vector<Tensor<1,dim >> solution_grads_p_fluid_AD(n_q_points);
4951 * fe_values_ref[p_fluid_fe].get_function_gradients(solution_total,
4952 * solution_grads_p_fluid_AD);
4956 * start gauss point loop
4959 * for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
4961 * const Tensor<2,dim,ADNumberType>
4962 * F_AD = Physics::Elasticity::Kinematics::F(solution_grads_u[q_point]);
4963 * ADNumberType det_F_AD = determinant(F_AD);
4964 * const double det_F = Tensor<0,dim,double>(det_F_AD);
4966 * const std::vector<std::shared_ptr<const PointHistory<dim,ADNumberType>>>
4967 * lqph = quadrature_point_history.get_data(cell);
4968 * Assert(lqph.size() == n_q_points, ExcInternalError());
4970 * double JxW = fe_values_ref.JxW(q_point);
4977 * sum_vol_current_mpi += det_F * JxW;
4978 * sum_vol_reference_mpi += JxW;
4979 * sum_solid_vol_mpi += parameters.solid_vol_frac * JxW * det_F;
4986 * const Tensor<2,dim,ADNumberType> F_inv = invert(F_AD);
4987 * const Tensor<1,dim,ADNumberType>
4988 * grad_p_fluid_AD = solution_grads_p_fluid_AD[q_point]*F_inv;
4989 * const Tensor<1,dim,ADNumberType> seepage_vel_AD
4990 * = lqph[q_point]->get_seepage_velocity_current(F_AD, grad_p_fluid_AD);
4997 * const double porous_dissipation =
4998 * lqph[q_point]->get_porous_dissipation(F_AD, grad_p_fluid_AD);
4999 * sum_porous_dissipation_mpi += porous_dissipation * det_F * JxW;
5001 * const double viscous_dissipation = lqph[q_point]->get_viscous_dissipation();
5002 * sum_viscous_dissipation_mpi += viscous_dissipation * det_F * JxW;
5006 * ---------------------------------------------------------------
5009 * } //end gauss point loop
5013 * Compute reaction force on load boundary & total fluid flow across
5015 * Define a local instance of FEFaceValues to compute values required
5016 * to calculate reaction force
5019 * const UpdateFlags uf_face( update_values | update_gradients |
5020 * update_normal_vectors | update_JxW_values );
5021 * FEFaceValues<dim> fe_face_values_ref(fe, qf_face, uf_face);
5028 * for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
5035 * if (cell->face(face)->at_boundary() == true &&
5036 * cell->face(face)->boundary_id() == get_reaction_boundary_id_for_output() )
5038 * fe_face_values_ref.reinit(cell, face);
5042 * Get displacement gradients for current face
5045 * std::vector<Tensor<2,dim> > solution_grads_u_f(n_q_points_f);
5046 * fe_face_values_ref[u_fe].get_function_gradients
5048 * solution_grads_u_f);
5052 * Get pressure for current element
5055 * std::vector< double > solution_values_p_fluid_total_f(n_q_points_f);
5056 * fe_face_values_ref[p_fluid_fe].get_function_values
5058 * solution_values_p_fluid_total_f);
5062 * start gauss points on faces loop
5065 * for (unsigned int f_q_point=0; f_q_point<n_q_points_f; ++f_q_point)
5067 * const Tensor<1,dim> &N = fe_face_values_ref.normal_vector(f_q_point);
5068 * const double JxW_f = fe_face_values_ref.JxW(f_q_point);
5072 * Compute deformation gradient from displacements gradient
5073 * (present configuration)
5076 * const Tensor<2,dim,ADNumberType> F_AD =
5077 * Physics::Elasticity::Kinematics::F(solution_grads_u_f[f_q_point]);
5079 * const std::vector<std::shared_ptr<const PointHistory<dim,ADNumberType>>>
5080 * lqph = quadrature_point_history.get_data(cell);
5081 * Assert(lqph.size() == n_q_points, ExcInternalError());
5083 * const double p_fluid = solution_values_p_fluid_total[f_q_point];
5090 * static const SymmetricTensor<2,dim,double>
5091 * I (Physics::Elasticity::StandardTensors<dim>::I);
5092 * SymmetricTensor<2,dim> sigma_E;
5093 * const SymmetricTensor<2,dim,ADNumberType> sigma_E_AD =
5094 * lqph[f_q_point]->get_Cauchy_E(F_AD);
5096 * for (unsigned int i=0; i<dim; ++i)
5097 * for (unsigned int j=0; j<dim; ++j)
5098 * sigma_E[i][j] = Tensor<0,dim,double>(sigma_E_AD[i][j]);
5100 * SymmetricTensor<2,dim> sigma_fluid_vol(I);
5101 * sigma_fluid_vol *= -1.0*p_fluid;
5102 * const SymmetricTensor<2,dim> sigma = sigma_E+sigma_fluid_vol;
5103 * sum_reaction_mpi += sigma * N * JxW_f;
5104 * sum_reaction_pressure_mpi += sigma_fluid_vol * N * JxW_f;
5105 * sum_reaction_extra_mpi += sigma_E * N * JxW_f;
5106 * }//end gauss points on faces loop
5114 * if (cell->face(face)->at_boundary() == true &&
5115 * (cell->face(face)->boundary_id() ==
5116 * get_drained_boundary_id_for_output().first ||
5117 * cell->face(face)->boundary_id() ==
5118 * get_drained_boundary_id_for_output().second ) )
5120 * fe_face_values_ref.reinit(cell, face);
5124 * Get displacement gradients for current face
5127 * std::vector<Tensor<2,dim>> solution_grads_u_f(n_q_points_f);
5128 * fe_face_values_ref[u_fe].get_function_gradients
5130 * solution_grads_u_f);
5134 * Get pressure gradients for current face
5137 * std::vector<Tensor<1,dim>> solution_grads_p_f(n_q_points_f);
5138 * fe_face_values_ref[p_fluid_fe].get_function_gradients
5140 * solution_grads_p_f);
5144 * start gauss points on faces loop
5147 * for (unsigned int f_q_point=0; f_q_point<n_q_points_f; ++f_q_point)
5149 * const Tensor<1,dim> &N =
5150 * fe_face_values_ref.normal_vector(f_q_point);
5151 * const double JxW_f = fe_face_values_ref.JxW(f_q_point);
5155 * Deformation gradient and inverse from displacements gradient
5156 * (present configuration)
5159 * const Tensor<2,dim,ADNumberType> F_AD
5160 * = Physics::Elasticity::Kinematics::F(solution_grads_u_f[f_q_point]);
5162 * const Tensor<2,dim,ADNumberType> F_inv_AD = invert(F_AD);
5163 * ADNumberType det_F_AD = determinant(F_AD);
5165 * const std::vector<std::shared_ptr<const PointHistory<dim,ADNumberType>>>
5166 * lqph = quadrature_point_history.get_data(cell);
5167 * Assert(lqph.size() == n_q_points, ExcInternalError());
5174 * Tensor<1,dim> seepage;
5175 * double det_F = Tensor<0,dim,double>(det_F_AD);
5176 * const Tensor<1,dim,ADNumberType> grad_p
5177 * = solution_grads_p_f[f_q_point]*F_inv_AD;
5178 * const Tensor<1,dim,ADNumberType> seepage_AD
5179 * = lqph[f_q_point]->get_seepage_velocity_current(F_AD, grad_p);
5181 * for (unsigned int i=0; i<dim; ++i)
5182 * seepage[i] = Tensor<0,dim,double>(seepage_AD[i]);
5184 * sum_total_flow_mpi += (seepage/det_F) * N * JxW_f;
5185 * }//end gauss points on faces loop
5192 * Sum the results from different MPI process and then add to the reaction_force vector
5193 * In theory, the solution on each surface (each cell) only exists in one MPI process
5194 * so, we add all MPI process, one will have the solution and the others will be zero
5197 * for (unsigned int d=0; d<dim; ++d)
5199 * reaction_force[d] = Utilities::MPI::sum(sum_reaction_mpi[d],
5200 * mpi_communicator);
5201 * reaction_force_pressure[d] = Utilities::MPI::sum(sum_reaction_pressure_mpi[d],
5202 * mpi_communicator);
5203 * reaction_force_extra[d] = Utilities::MPI::sum(sum_reaction_extra_mpi[d],
5204 * mpi_communicator);
5209 * Same for total fluid flow, and for porous and viscous dissipations
5212 * total_fluid_flow = Utilities::MPI::sum(sum_total_flow_mpi,
5213 * mpi_communicator);
5214 * total_porous_dissipation = Utilities::MPI::sum(sum_porous_dissipation_mpi,
5215 * mpi_communicator);
5216 * total_viscous_dissipation = Utilities::MPI::sum(sum_viscous_dissipation_mpi,
5217 * mpi_communicator);
5218 * total_solid_vol = Utilities::MPI::sum(sum_solid_vol_mpi,
5219 * mpi_communicator);
5220 * total_vol_current = Utilities::MPI::sum(sum_vol_current_mpi,
5221 * mpi_communicator);
5222 * total_vol_reference = Utilities::MPI::sum(sum_vol_reference_mpi,
5223 * mpi_communicator);
5227 * Extract solution for tracked vectors
5228 * Copying an MPI::BlockVector into MPI::Vector is not possible,
5229 * so we copy each block of MPI::BlockVector into an MPI::Vector
5230 * And then we copy the MPI::Vector into "normal" Vectors
5233 * TrilinosWrappers::MPI::Vector solution_vector_u_MPI(solution_total.block(u_block));
5234 * TrilinosWrappers::MPI::Vector solution_vector_p_MPI(solution_total.block(p_fluid_block));
5235 * Vector<double> solution_u_vector(solution_vector_u_MPI);
5236 * Vector<double> solution_p_vector(solution_vector_p_MPI);
5238 * if (this_mpi_process == 0)
5242 * Append the pressure solution vector to the displacement solution vector,
5243 * creating a single solution vector equivalent to the original BlockVector
5244 * so FEFieldFunction will work with the dof_handler_ref.
5247 * Vector<double> solution_vector(solution_p_vector.size()
5248 * +solution_u_vector.size());
5250 * for (unsigned int d=0; d<(solution_u_vector.size()); ++d)
5251 * solution_vector[d] = solution_u_vector[d];
5253 * for (unsigned int d=0; d<(solution_p_vector.size()); ++d)
5254 * solution_vector[solution_u_vector.size()+d] = solution_p_vector[d];
5256 * Functions::FEFieldFunction<dim,DoFHandler<dim>,Vector<double>>
5257 * find_solution(dof_handler_ref, solution_vector);
5259 * for (unsigned int p=0; p<tracked_vertices_IN.size(); ++p)
5261 * Vector<double> update(dim+1);
5262 * Point<dim> pt_ref;
5264 * pt_ref[0]= tracked_vertices_IN[p][0];
5265 * pt_ref[1]= tracked_vertices_IN[p][1];
5266 * pt_ref[2]= tracked_vertices_IN[p][2];
5268 * find_solution.vector_value(pt_ref, update);
5270 * for (unsigned int d=0; d<(dim+1); ++d)
5274 * For values close to zero, set to 0.0
5277 * if (abs(update[d])<1.5*parameters.tol_u)
5279 * solution_vertices[p][d] = update[d];
5284 * Write the results to the plotting file.
5285 * Add two blank lines between cycles in the cyclic loading examples so GNUPLOT can detect each cycle as a different block
5288 * if (( (parameters.geom_type == "Budday_cube_tension_compression_fully_fixed")||
5289 * (parameters.geom_type == "Budday_cube_tension_compression")||
5290 * (parameters.geom_type == "Budday_cube_shear_fully_fixed") ) &&
5291 * ( (abs(current_time - parameters.end_time/3.) <0.9*parameters.delta_t)||
5292 * (abs(current_time - 2.*parameters.end_time/3.)<0.9*parameters.delta_t) ) &&
5293 * parameters.num_cycle_sets == 1 )
5295 * plotpointfile << std::endl<< std::endl;
5297 * if (( (parameters.geom_type == "Budday_cube_tension_compression_fully_fixed")||
5298 * (parameters.geom_type == "Budday_cube_tension_compression")||
5299 * (parameters.geom_type == "Budday_cube_shear_fully_fixed") ) &&
5300 * ( (abs(current_time - parameters.end_time/9.) <0.9*parameters.delta_t)||
5301 * (abs(current_time - 2.*parameters.end_time/9.)<0.9*parameters.delta_t)||
5302 * (abs(current_time - 3.*parameters.end_time/9.)<0.9*parameters.delta_t)||
5303 * (abs(current_time - 5.*parameters.end_time/9.)<0.9*parameters.delta_t)||
5304 * (abs(current_time - 7.*parameters.end_time/9.)<0.9*parameters.delta_t) ) &&
5305 * parameters.num_cycle_sets == 2 )
5307 * plotpointfile << std::endl<< std::endl;
5310 * plotpointfile << std::setprecision(6) << std::scientific;
5311 * plotpointfile << std::setw(16) << current_time << ","
5312 * << std::setw(15) << total_vol_reference << ","
5313 * << std::setw(15) << total_vol_current << ","
5314 * << std::setw(15) << total_solid_vol << ",";
5316 * if (current_time == 0.0)
5318 * for (unsigned int p=0; p<tracked_vertices_IN.size(); ++p)
5320 * for (unsigned int d=0; d<dim; ++d)
5321 * plotpointfile << std::setw(15) << 0.0 << ",";
5323 * plotpointfile << std::setw(15) << parameters.drained_pressure << ",";
5325 * for (unsigned int d=0; d<(3*dim+2); ++d)
5326 * plotpointfile << std::setw(15) << 0.0 << ",";
5328 * plotpointfile << std::setw(15) << 0.0;
5332 * for (unsigned int p=0; p<tracked_vertices_IN.size(); ++p)
5333 * for (unsigned int d=0; d<(dim+1); ++d)
5334 * plotpointfile << std::setw(15) << solution_vertices[p][d]<< ",";
5336 * for (unsigned int d=0; d<dim; ++d)
5337 * plotpointfile << std::setw(15) << reaction_force[d] << ",";
5339 * for (unsigned int d=0; d<dim; ++d)
5340 * plotpointfile << std::setw(15) << reaction_force_pressure[d] << ",";
5342 * for (unsigned int d=0; d<dim; ++d)
5343 * plotpointfile << std::setw(15) << reaction_force_extra[d] << ",";
5345 * plotpointfile << std::setw(15) << total_fluid_flow << ","
5346 * << std::setw(15) << total_porous_dissipation<< ","
5347 * << std::setw(15) << total_viscous_dissipation;
5349 * plotpointfile << std::endl;
5355 * Header for console output file
5358 * template <int dim>
5359 * void Solid<dim>::print_console_file_header(std::ofstream &outputfile) const
5361 * outputfile << "/*-----------------------------------------------------------------------------------------";
5362 * outputfile << "\n\n Poro-viscoelastic formulation to solve nonlinear solid mechanics problems using deal.ii";
5363 * outputfile << "\n\n Problem setup by E Comellas and J-P Pelteret, University of Erlangen-Nuremberg, 2018";
5364 * outputfile << "\n\n/*-----------------------------------------------------------------------------------------";
5365 * outputfile << "\n\nCONSOLE OUTPUT: \n\n";
5370 * Header for plotting output file
5373 * template <int dim>
5374 * void Solid<dim>::print_plot_file_header(std::vector<Point<dim> > &tracked_vertices,
5375 * std::ofstream &plotpointfile) const
5377 * plotpointfile << "#\n# *** Solution history for tracked vertices -- DOF: 0 = Ux, 1 = Uy, 2 = Uz, 3 = P ***"
5380 * for (unsigned int p=0; p<tracked_vertices.size(); ++p)
5382 * plotpointfile << "# Point " << p << " coordinates: ";
5383 * for (unsigned int d=0; d<dim; ++d)
5385 * plotpointfile << tracked_vertices[p][d];
5386 * if (!( (p == tracked_vertices.size()-1) && (d == dim-1) ))
5387 * plotpointfile << ", ";
5389 * plotpointfile << std::endl;
5391 * plotpointfile << "# The reaction force is the integral over the loaded surfaces in the "
5392 * << "undeformed configuration of the Cauchy stress times the normal surface unit vector.\n"
5393 * << "# reac(p) corresponds to the volumetric part of the Cauchy stress due to the pore fluid pressure"
5394 * << " and reac(E) corresponds to the extra part of the Cauchy stress due to the solid contribution."
5396 * << "# The fluid flow is the integral over the drained surfaces in the "
5397 * << "undeformed configuration of the seepage velocity times the normal surface unit vector."
5399 * << "# Column number:"
5403 * unsigned int columns = 24;
5404 * for (unsigned int d=1; d<columns; ++d)
5405 * plotpointfile << std::setw(15)<< d <<",";
5407 * plotpointfile << std::setw(15)<< columns
5410 * << std::right << std::setw(16) << "Time,"
5411 * << std::right << std::setw(16) << "ref vol,"
5412 * << std::right << std::setw(16) << "def vol,"
5413 * << std::right << std::setw(16) << "solid vol,";
5414 * for (unsigned int p=0; p<tracked_vertices.size(); ++p)
5415 * for (unsigned int d=0; d<(dim+1); ++d)
5416 * plotpointfile << std::right<< std::setw(11)
5417 * <<"P" << p << "[" << d << "],";
5419 * for (unsigned int d=0; d<dim; ++d)
5420 * plotpointfile << std::right<< std::setw(13)
5421 * << "reaction [" << d << "],";
5423 * for (unsigned int d=0; d<dim; ++d)
5424 * plotpointfile << std::right<< std::setw(13)
5425 * << "reac(p) [" << d << "],";
5427 * for (unsigned int d=0; d<dim; ++d)
5428 * plotpointfile << std::right<< std::setw(13)
5429 * << "reac(E) [" << d << "],";
5431 * plotpointfile << std::right<< std::setw(16)<< "fluid flow,"
5432 * << std::right<< std::setw(16)<< "porous dissip,"
5433 * << std::right<< std::setw(15)<< "viscous dissip"
5439 * Footer for console output file
5442 * template <int dim>
5443 * void Solid<dim>::print_console_file_footer(std::ofstream &outputfile) const
5447 * Copy "parameters" file at end of output file.
5450 * std::ifstream infile("parameters.prm");
5451 * std::string content = "";
5454 * for(i=0 ; infile.eof()!=true ; i++)
5456 * char aux = infile.get();
5458 * if(aux=='\n
') content += '#
';
5462 * content.erase(content.end()-1);
5465 * outputfile << "\n\n\n\n PARAMETERS FILE USED IN THIS COMPUTATION: \n#"
5472 * Footer for plotting output file
5475 * template <int dim>
5476 * void Solid<dim>::print_plot_file_footer(std::ofstream &plotpointfile) const
5480 * Copy "parameters" file at end of output file.
5483 * std::ifstream infile("parameters.prm");
5484 * std::string content = "";
5487 * for(i=0 ; infile.eof()!=true ; i++)
5489 * char aux = infile.get();
5491 * if(aux=='\n
') content += '#
';
5495 * content.erase(content.end()-1);
5498 * plotpointfile << "#"<< std::endl
5499 * << "#"<< std::endl
5500 * << "# PARAMETERS FILE USED IN THIS COMPUTATION:" << std::endl
5501 * << "#"<< std::endl
5509 * <a name="VerificationexamplesfromEhlersandEipper1999"></a>
5510 * <h3>Verification examples from Ehlers and Eipper 1999</h3>
5511 * We group the definition of the geometry, boundary and loading conditions specific to
5512 * the verification examples from Ehlers and Eipper 1999 into specific classes.
5517 * <a name="BaseclassTubegeometryandboundaryconditions"></a>
5518 * <h4>Base class: Tube geometry and boundary conditions</h4>
5521 * template <int dim>
5522 * class VerificationEhlers1999TubeBase
5523 * : public Solid<dim>
5526 * VerificationEhlers1999TubeBase (const Parameters::AllParameters ¶meters)
5527 * : Solid<dim> (parameters)
5530 * virtual ~VerificationEhlers1999TubeBase () {}
5533 * virtual void make_grid()
5535 * GridGenerator::cylinder( this->triangulation,
5539 * const double rot_angle = 3.0*numbers::PI/2.0;
5540 * GridTools::rotate( rot_angle, 1, this->triangulation);
5542 * this->triangulation.reset_manifold(0);
5543 * static const CylindricalManifold<dim> manifold_description_3d(2);
5544 * this->triangulation.set_manifold (0, manifold_description_3d);
5545 * GridTools::scale(this->parameters.scale, this->triangulation);
5546 * this->triangulation.refine_global(std::max (1U, this->parameters.global_refinement));
5547 * this->triangulation.reset_manifold(0);
5550 * virtual void define_tracked_vertices(std::vector<Point<dim> > &tracked_vertices)
5552 * tracked_vertices[0][0] = 0.0*this->parameters.scale;
5553 * tracked_vertices[0][1] = 0.0*this->parameters.scale;
5554 * tracked_vertices[0][2] = 0.5*this->parameters.scale;
5556 * tracked_vertices[1][0] = 0.0*this->parameters.scale;
5557 * tracked_vertices[1][1] = 0.0*this->parameters.scale;
5558 * tracked_vertices[1][2] = -0.5*this->parameters.scale;
5561 * virtual void make_dirichlet_constraints(AffineConstraints<double> &constraints)
5563 * if (this->time.get_timestep() < 2)
5565 * VectorTools::interpolate_boundary_values(this->dof_handler_ref,
5567 * ConstantFunction<dim>(this->parameters.drained_pressure,this->n_components),
5569 * (this->fe.component_mask(this->pressure)));
5573 * VectorTools::interpolate_boundary_values(this->dof_handler_ref,
5575 * ZeroFunction<dim>(this->n_components),
5577 * (this->fe.component_mask(this->pressure)));
5580 * VectorTools::interpolate_boundary_values( this->dof_handler_ref,
5582 * ZeroFunction<dim>(this->n_components),
5584 * (this->fe.component_mask(this->x_displacement)|
5585 * this->fe.component_mask(this->y_displacement) ) );
5587 * VectorTools::interpolate_boundary_values( this->dof_handler_ref,
5589 * ZeroFunction<dim>(this->n_components),
5591 * (this->fe.component_mask(this->x_displacement) |
5592 * this->fe.component_mask(this->y_displacement) |
5593 * this->fe.component_mask(this->z_displacement) ));
5597 * get_prescribed_fluid_flow (const types::boundary_id &boundary_id,
5598 * const Point<dim> &pt) const
5601 * (void)boundary_id;
5605 * virtual types::boundary_id
5606 * get_reaction_boundary_id_for_output() const
5611 * virtual std::pair<types::boundary_id,types::boundary_id>
5612 * get_drained_boundary_id_for_output() const
5614 * return std::make_pair(2,2);
5617 * virtual std::vector<double>
5618 * get_dirichlet_load(const types::boundary_id &boundary_id,
5619 * const int &direction) const
5621 * std::vector<double> displ_incr(dim, 0.0);
5622 * (void)boundary_id;
5624 * AssertThrow(false, ExcMessage("Displacement loading not implemented for Ehlers verification examples."));
5626 * return displ_incr;
5633 * <a name="DerivedclassSteploadexample"></a>
5634 * <h4>Derived class: Step load example</h4>
5637 * template <int dim>
5638 * class VerificationEhlers1999StepLoad
5639 * : public VerificationEhlers1999TubeBase<dim>
5642 * VerificationEhlers1999StepLoad (const Parameters::AllParameters ¶meters)
5643 * : VerificationEhlers1999TubeBase<dim> (parameters)
5646 * virtual ~VerificationEhlers1999StepLoad () {}
5649 * virtual Tensor<1,dim>
5650 * get_neumann_traction (const types::boundary_id &boundary_id,
5651 * const Point<dim> &pt,
5652 * const Tensor<1,dim> &N) const
5654 * if (this->parameters.load_type == "pressure")
5656 * if (boundary_id == 2)
5658 * return this->parameters.load * N;
5664 * return Tensor<1,dim>();
5671 * <a name="DerivedclassLoadincreasingexample"></a>
5672 * <h4>Derived class: Load increasing example</h4>
5675 * template <int dim>
5676 * class VerificationEhlers1999IncreaseLoad
5677 * : public VerificationEhlers1999TubeBase<dim>
5680 * VerificationEhlers1999IncreaseLoad (const Parameters::AllParameters ¶meters)
5681 * : VerificationEhlers1999TubeBase<dim> (parameters)
5684 * virtual ~VerificationEhlers1999IncreaseLoad () {}
5687 * virtual Tensor<1,dim>
5688 * get_neumann_traction (const types::boundary_id &boundary_id,
5689 * const Point<dim> &pt,
5690 * const Tensor<1,dim> &N) const
5692 * if (this->parameters.load_type == "pressure")
5694 * if (boundary_id == 2)
5696 * const double initial_load = this->parameters.load;
5697 * const double final_load = 20.0*initial_load;
5698 * const double initial_time = this->time.get_delta_t();
5699 * const double final_time = this->time.get_end();
5700 * const double current_time = this->time.get_current();
5701 * const double load = initial_load + (final_load-initial_load)*(current_time-initial_time)/(final_time-initial_time);
5708 * return Tensor<1,dim>();
5715 * <a name="ClassConsolidationcube"></a>
5716 * <h4>Class: Consolidation cube</h4>
5719 * template <int dim>
5720 * class VerificationEhlers1999CubeConsolidation
5721 * : public Solid<dim>
5724 * VerificationEhlers1999CubeConsolidation (const Parameters::AllParameters ¶meters)
5725 * : Solid<dim> (parameters)
5728 * virtual ~VerificationEhlers1999CubeConsolidation () {}
5734 * GridGenerator::hyper_rectangle(this->triangulation,
5735 * Point<dim>(0.0, 0.0, 0.0),
5736 * Point<dim>(1.0, 1.0, 1.0),
5739 * GridTools::scale(this->parameters.scale, this->triangulation);
5740 * this->triangulation.refine_global(std::max (1U, this->parameters.global_refinement));
5742 * typename Triangulation<dim>::active_cell_iterator cell =
5743 * this->triangulation.begin_active(), endc = this->triangulation.end();
5744 * for (; cell != endc; ++cell)
5746 * for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell; ++face)
5747 * if (cell->face(face)->at_boundary() == true &&
5748 * cell->face(face)->center()[2] == 1.0 * this->parameters.scale)
5750 * if (cell->face(face)->center()[0] < 0.5 * this->parameters.scale &&
5751 * cell->face(face)->center()[1] < 0.5 * this->parameters.scale)
5752 * cell->face(face)->set_boundary_id(100);
5754 * cell->face(face)->set_boundary_id(101);
5760 * define_tracked_vertices(std::vector<Point<dim> > &tracked_vertices)
5762 * tracked_vertices[0][0] = 0.0*this->parameters.scale;
5763 * tracked_vertices[0][1] = 0.0*this->parameters.scale;
5764 * tracked_vertices[0][2] = 1.0*this->parameters.scale;
5766 * tracked_vertices[1][0] = 0.0*this->parameters.scale;
5767 * tracked_vertices[1][1] = 0.0*this->parameters.scale;
5768 * tracked_vertices[1][2] = 0.0*this->parameters.scale;
5772 * make_dirichlet_constraints(AffineConstraints<double> &constraints)
5774 * if (this->time.get_timestep() < 2)
5776 * VectorTools::interpolate_boundary_values(this->dof_handler_ref,
5778 * ConstantFunction<dim>(this->parameters.drained_pressure,this->n_components),
5780 * (this->fe.component_mask(this->pressure)));
5784 * VectorTools::interpolate_boundary_values(this->dof_handler_ref,
5786 * ZeroFunction<dim>(this->n_components),
5788 * (this->fe.component_mask(this->pressure)));
5791 * VectorTools::interpolate_boundary_values( this->dof_handler_ref,
5793 * ZeroFunction<dim>(this->n_components),
5795 * this->fe.component_mask(this->x_displacement));
5797 * VectorTools::interpolate_boundary_values( this->dof_handler_ref,
5799 * ZeroFunction<dim>(this->n_components),
5801 * this->fe.component_mask(this->x_displacement));
5803 * VectorTools::interpolate_boundary_values( this->dof_handler_ref,
5805 * ZeroFunction<dim>(this->n_components),
5807 * this->fe.component_mask(this->y_displacement));
5809 * VectorTools::interpolate_boundary_values( this->dof_handler_ref,
5811 * ZeroFunction<dim>(this->n_components),
5813 * this->fe.component_mask(this->y_displacement));
5815 * VectorTools::interpolate_boundary_values( this->dof_handler_ref,
5817 * ZeroFunction<dim>(this->n_components),
5819 * ( this->fe.component_mask(this->x_displacement) |
5820 * this->fe.component_mask(this->y_displacement) |
5821 * this->fe.component_mask(this->z_displacement) ));
5824 * virtual Tensor<1,dim>
5825 * get_neumann_traction (const types::boundary_id &boundary_id,
5826 * const Point<dim> &pt,
5827 * const Tensor<1,dim> &N) const
5829 * if (this->parameters.load_type == "pressure")
5831 * if (boundary_id == 100)
5833 * return this->parameters.load * N;
5839 * return Tensor<1,dim>();
5843 * get_prescribed_fluid_flow (const types::boundary_id &boundary_id,
5844 * const Point<dim> &pt) const
5847 * (void)boundary_id;
5851 * virtual types::boundary_id
5852 * get_reaction_boundary_id_for_output() const
5857 * virtual std::pair<types::boundary_id,types::boundary_id>
5858 * get_drained_boundary_id_for_output() const
5860 * return std::make_pair(101,101);
5863 * virtual std::vector<double>
5864 * get_dirichlet_load(const types::boundary_id &boundary_id,
5865 * const int &direction) const
5867 * std::vector<double> displ_incr(dim, 0.0);
5868 * (void)boundary_id;
5870 * AssertThrow(false, ExcMessage("Displacement loading not implemented for Ehlers verification examples."));
5872 * return displ_incr;
5879 * <a name="Franceschiniexperiments"></a>
5880 * <h4>Franceschini experiments</h4>
5883 * template <int dim>
5884 * class Franceschini2006Consolidation
5885 * : public Solid<dim>
5888 * Franceschini2006Consolidation (const Parameters::AllParameters ¶meters)
5889 * : Solid<dim> (parameters)
5892 * virtual ~Franceschini2006Consolidation () {}
5895 * virtual void make_grid()
5897 * const Point<dim-1> mesh_center(0.0, 0.0);
5898 * const double radius = 0.5;
5901 * const double height = 0.27; //8.1 mm for 30 mm radius
5904 * const double height = 0.23; //6.9 mm for 30 mm radius
5905 * Triangulation<dim-1> triangulation_in;
5906 * GridGenerator::hyper_ball( triangulation_in,
5910 * GridGenerator::extrude_triangulation(triangulation_in,
5913 * this->triangulation);
5915 * const CylindricalManifold<dim> cylinder_3d(2);
5916 * const types::manifold_id cylinder_id = 0;
5919 * this->triangulation.set_manifold(cylinder_id, cylinder_3d);
5921 * for (auto cell : this->triangulation.active_cell_iterators())
5923 * for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell; ++face)
5925 * if (cell->face(face)->at_boundary() == true)
5927 * if (cell->face(face)->center()[2] == 0.0)
5928 * cell->face(face)->set_boundary_id(1);
5930 * else if (cell->face(face)->center()[2] == height)
5931 * cell->face(face)->set_boundary_id(2);
5935 * cell->face(face)->set_boundary_id(0);
5936 * cell->face(face)->set_all_manifold_ids(cylinder_id);
5942 * GridTools::scale(this->parameters.scale, this->triangulation);
5943 * this->triangulation.refine_global(std::max (1U, this->parameters.global_refinement));
5946 * virtual void define_tracked_vertices(std::vector<Point<dim> > &tracked_vertices)
5948 * tracked_vertices[0][0] = 0.0*this->parameters.scale;
5949 * tracked_vertices[0][1] = 0.0*this->parameters.scale;
5952 * tracked_vertices[0][2] = 0.27*this->parameters.scale;
5955 * tracked_vertices[0][2] = 0.23*this->parameters.scale;
5957 * tracked_vertices[1][0] = 0.0*this->parameters.scale;
5958 * tracked_vertices[1][1] = 0.0*this->parameters.scale;
5959 * tracked_vertices[1][2] = 0.0*this->parameters.scale;
5962 * virtual void make_dirichlet_constraints(AffineConstraints<double> &constraints)
5964 * if (this->time.get_timestep() < 2)
5966 * VectorTools::interpolate_boundary_values(this->dof_handler_ref,
5968 * ConstantFunction<dim>(this->parameters.drained_pressure,this->n_components),
5970 * (this->fe.component_mask(this->pressure)));
5972 * VectorTools::interpolate_boundary_values(this->dof_handler_ref,
5974 * ConstantFunction<dim>(this->parameters.drained_pressure,this->n_components),
5976 * (this->fe.component_mask(this->pressure)));
5980 * VectorTools::interpolate_boundary_values(this->dof_handler_ref,
5982 * ZeroFunction<dim>(this->n_components),
5984 * (this->fe.component_mask(this->pressure)));
5986 * VectorTools::interpolate_boundary_values(this->dof_handler_ref,
5988 * ZeroFunction<dim>(this->n_components),
5990 * (this->fe.component_mask(this->pressure)));
5993 * VectorTools::interpolate_boundary_values( this->dof_handler_ref,
5995 * ZeroFunction<dim>(this->n_components),
5997 * (this->fe.component_mask(this->x_displacement)|
5998 * this->fe.component_mask(this->y_displacement) ) );
6000 * VectorTools::interpolate_boundary_values( this->dof_handler_ref,
6002 * ZeroFunction<dim>(this->n_components),
6004 * (this->fe.component_mask(this->x_displacement) |
6005 * this->fe.component_mask(this->y_displacement) |
6006 * this->fe.component_mask(this->z_displacement) ));
6008 * VectorTools::interpolate_boundary_values( this->dof_handler_ref,
6010 * ZeroFunction<dim>(this->n_components),
6012 * (this->fe.component_mask(this->x_displacement) |
6013 * this->fe.component_mask(this->y_displacement) ));
6017 * get_prescribed_fluid_flow (const types::boundary_id &boundary_id,
6018 * const Point<dim> &pt) const
6021 * (void)boundary_id;
6025 * virtual types::boundary_id
6026 * get_reaction_boundary_id_for_output() const
6031 * virtual std::pair<types::boundary_id,types::boundary_id>
6032 * get_drained_boundary_id_for_output() const
6034 * return std::make_pair(1,2);
6037 * virtual std::vector<double>
6038 * get_dirichlet_load(const types::boundary_id &boundary_id,
6039 * const int &direction) const
6041 * std::vector<double> displ_incr(dim, 0.0);
6042 * (void)boundary_id;
6044 * AssertThrow(false, ExcMessage("Displacement loading not implemented for Franceschini examples."));
6046 * return displ_incr;
6049 * virtual Tensor<1,dim>
6050 * get_neumann_traction (const types::boundary_id &boundary_id,
6051 * const Point<dim> &pt,
6052 * const Tensor<1,dim> &N) const
6054 * if (this->parameters.load_type == "pressure")
6056 * if (boundary_id == 2)
6058 * return (this->parameters.load * N);
6060 * const double final_load = this->parameters.load;
6061 * const double final_load_time = 10 * this->time.get_delta_t();
6062 * const double current_time = this->time.get_current();
6065 * const double c = final_load_time / 2.0;
6066 * const double r = 200.0 * 0.03 / c;
6068 * const double load = final_load * std::exp(r * current_time)
6069 * / ( std::exp(c * current_time) + std::exp(r * current_time));
6077 * return Tensor<1,dim>();
6084 * <a name="ExamplestoreproduceexperimentsbyBuddayetal2017"></a>
6085 * <h3>Examples to reproduce experiments by Budday et al. 2017</h3>
6086 * We group the definition of the geometry, boundary and loading conditions specific to
6087 * the examples to reproduce experiments by Budday et al. 2017 into specific classes.
6092 * <a name="BaseclassCubegeometryandloadingpattern"></a>
6093 * <h4>Base class: Cube geometry and loading pattern</h4>
6096 * template <int dim>
6097 * class BrainBudday2017BaseCube
6098 * : public Solid<dim>
6101 * BrainBudday2017BaseCube (const Parameters::AllParameters ¶meters)
6102 * : Solid<dim> (parameters)
6105 * virtual ~BrainBudday2017BaseCube () {}
6111 * GridGenerator::hyper_cube(this->triangulation,
6116 * typename Triangulation<dim>::active_cell_iterator cell =
6117 * this->triangulation.begin_active(), endc = this->triangulation.end();
6118 * for (; cell != endc; ++cell)
6120 * for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell; ++face)
6121 * if (cell->face(face)->at_boundary() == true &&
6122 * ( cell->face(face)->boundary_id() == 0 ||
6123 * cell->face(face)->boundary_id() == 1 ||
6124 * cell->face(face)->boundary_id() == 2 ||
6125 * cell->face(face)->boundary_id() == 3 ) )
6127 * cell->face(face)->set_boundary_id(100);
6131 * GridTools::scale(this->parameters.scale, this->triangulation);
6132 * this->triangulation.refine_global(std::max (1U, this->parameters.global_refinement));
6136 * get_prescribed_fluid_flow (const types::boundary_id &boundary_id,
6137 * const Point<dim> &pt) const
6140 * (void)boundary_id;
6144 * virtual std::pair<types::boundary_id,types::boundary_id>
6145 * get_drained_boundary_id_for_output() const
6147 * return std::make_pair(100,100);
6154 * <a name="DerivedclassUniaxialboundaryconditions"></a>
6155 * <h4>Derived class: Uniaxial boundary conditions</h4>
6158 * template <int dim>
6159 * class BrainBudday2017CubeTensionCompression
6160 * : public BrainBudday2017BaseCube<dim>
6163 * BrainBudday2017CubeTensionCompression (const Parameters::AllParameters ¶meters)
6164 * : BrainBudday2017BaseCube<dim> (parameters)
6167 * virtual ~BrainBudday2017CubeTensionCompression () {}
6171 * define_tracked_vertices(std::vector<Point<dim> > &tracked_vertices)
6173 * tracked_vertices[0][0] = 0.5*this->parameters.scale;
6174 * tracked_vertices[0][1] = 0.5*this->parameters.scale;
6175 * tracked_vertices[0][2] = 1.0*this->parameters.scale;
6177 * tracked_vertices[1][0] = 0.5*this->parameters.scale;
6178 * tracked_vertices[1][1] = 0.5*this->parameters.scale;
6179 * tracked_vertices[1][2] = 0.5*this->parameters.scale;
6183 * make_dirichlet_constraints(AffineConstraints<double> &constraints)
6185 * if (this->time.get_timestep() < 2)
6187 * VectorTools::interpolate_boundary_values(this->dof_handler_ref,
6189 * ConstantFunction<dim>(this->parameters.drained_pressure,this->n_components),
6191 * (this->fe.component_mask(this->pressure)));
6195 * VectorTools::interpolate_boundary_values( this->dof_handler_ref,
6197 * ZeroFunction<dim>(this->n_components),
6199 * (this->fe.component_mask(this->pressure)));
6201 * VectorTools::interpolate_boundary_values( this->dof_handler_ref,
6203 * ZeroFunction<dim>(this->n_components),
6205 * this->fe.component_mask(this->z_displacement) );
6207 * Point<dim> fix_node(0.5*this->parameters.scale, 0.5*this->parameters.scale, 0.0);
6208 * typename DoFHandler<dim>::active_cell_iterator
6209 * cell = this->dof_handler_ref.begin_active(), endc = this->dof_handler_ref.end();
6210 * for (; cell != endc; ++cell)
6211 * for (unsigned int node = 0; node < GeometryInfo<dim>::vertices_per_cell; ++node)
6213 * if ( (abs(cell->vertex(node)[2]-fix_node[2]) < (1e-6 * this->parameters.scale))
6214 * && (abs(cell->vertex(node)[0]-fix_node[0]) < (1e-6 * this->parameters.scale)))
6215 * constraints.add_line(cell->vertex_dof_index(node, 0));
6217 * if ( (abs(cell->vertex(node)[2]-fix_node[2]) < (1e-6 * this->parameters.scale))
6218 * && (abs(cell->vertex(node)[1]-fix_node[1]) < (1e-6 * this->parameters.scale)))
6219 * constraints.add_line(cell->vertex_dof_index(node, 1));
6222 * if (this->parameters.load_type == "displacement")
6224 * const std::vector<double> value = get_dirichlet_load(5,2);
6225 * FEValuesExtractors::Scalar direction;
6226 * direction = this->z_displacement;
6228 * VectorTools::interpolate_boundary_values( this->dof_handler_ref,
6230 * ConstantFunction<dim>(value[2],this->n_components),
6232 * this->fe.component_mask(direction));
6236 * virtual Tensor<1,dim>
6237 * get_neumann_traction (const types::boundary_id &boundary_id,
6238 * const Point<dim> &pt,
6239 * const Tensor<1,dim> &N) const
6241 * if (this->parameters.load_type == "pressure")
6243 * if (boundary_id == 5)
6245 * const double final_load = this->parameters.load;
6246 * const double current_time = this->time.get_current();
6247 * const double final_time = this->time.get_end();
6248 * const double num_cycles = 3.0;
6250 * return final_load/2.0 * (1.0 - std::sin(numbers::PI * (2.0*num_cycles*current_time/final_time + 0.5))) * N;
6256 * return Tensor<1,dim>();
6259 * virtual types::boundary_id
6260 * get_reaction_boundary_id_for_output() const
6265 * virtual std::vector<double>
6266 * get_dirichlet_load(const types::boundary_id &boundary_id,
6267 * const int &direction) const
6269 * std::vector<double> displ_incr(dim,0.0);
6271 * if ( (boundary_id == 5) && (direction == 2) )
6273 * const double final_displ = this->parameters.load;
6274 * const double current_time = this->time.get_current();
6275 * const double final_time = this->time.get_end();
6276 * const double delta_time = this->time.get_delta_t();
6277 * const double num_cycles = 3.0;
6278 * double current_displ = 0.0;
6279 * double previous_displ = 0.0;
6281 * if (this->parameters.num_cycle_sets == 1)
6283 * current_displ = final_displ/2.0 * (1.0
6284 * - std::sin(numbers::PI * (2.0*num_cycles*current_time/final_time + 0.5)));
6285 * previous_displ = final_displ/2.0 * (1.0
6286 * - std::sin(numbers::PI * (2.0*num_cycles*(current_time-delta_time)/final_time + 0.5)));
6290 * if ( current_time <= (final_time*1.0/3.0) )
6292 * current_displ = final_displ/2.0 * (1.0 - std::sin(numbers::PI *
6293 * (2.0*num_cycles*current_time/(final_time*1.0/3.0) + 0.5)));
6294 * previous_displ = final_displ/2.0 * (1.0 - std::sin(numbers::PI *
6295 * (2.0*num_cycles*(current_time-delta_time)/(final_time*1.0/3.0) + 0.5)));
6299 * current_displ = final_displ * (1.0 - std::sin(numbers::PI *
6300 * (2.0*num_cycles*current_time / (final_time*2.0/3.0)
6301 * - (num_cycles - 0.5) )));
6302 * previous_displ = final_displ * (1.0 - std::sin(numbers::PI *
6303 * (2.0*num_cycles*(current_time-delta_time) / (final_time*2.0/3.0)
6304 * - (num_cycles - 0.5))));
6307 * displ_incr[2] = current_displ - previous_displ;
6309 * return displ_incr;
6316 * <a name="DerivedclassNolateraldisplacementinloadingsurfaces"></a>
6317 * <h4>Derived class: No lateral displacement in loading surfaces</h4>
6320 * template <int dim>
6321 * class BrainBudday2017CubeTensionCompressionFullyFixed
6322 * : public BrainBudday2017BaseCube<dim>
6325 * BrainBudday2017CubeTensionCompressionFullyFixed (const Parameters::AllParameters ¶meters)
6326 * : BrainBudday2017BaseCube<dim> (parameters)
6329 * virtual ~BrainBudday2017CubeTensionCompressionFullyFixed () {}
6333 * define_tracked_vertices(std::vector<Point<dim> > &tracked_vertices)
6335 * tracked_vertices[0][0] = 0.5*this->parameters.scale;
6336 * tracked_vertices[0][1] = 0.5*this->parameters.scale;
6337 * tracked_vertices[0][2] = 1.0*this->parameters.scale;
6339 * tracked_vertices[1][0] = 0.5*this->parameters.scale;
6340 * tracked_vertices[1][1] = 0.5*this->parameters.scale;
6341 * tracked_vertices[1][2] = 0.5*this->parameters.scale;
6345 * make_dirichlet_constraints(AffineConstraints<double> &constraints)
6347 * if (this->time.get_timestep() < 2)
6349 * VectorTools::interpolate_boundary_values(this->dof_handler_ref,
6351 * ConstantFunction<dim>(this->parameters.drained_pressure,this->n_components),
6353 * (this->fe.component_mask(this->pressure)));
6357 * VectorTools::interpolate_boundary_values( this->dof_handler_ref,
6359 * ZeroFunction<dim>(this->n_components),
6361 * (this->fe.component_mask(this->pressure)));
6364 * VectorTools::interpolate_boundary_values( this->dof_handler_ref,
6366 * ZeroFunction<dim>(this->n_components),
6368 * (this->fe.component_mask(this->x_displacement) |
6369 * this->fe.component_mask(this->y_displacement) |
6370 * this->fe.component_mask(this->z_displacement) ));
6373 * if (this->parameters.load_type == "displacement")
6375 * const std::vector<double> value = get_dirichlet_load(5,2);
6376 * FEValuesExtractors::Scalar direction;
6377 * direction = this->z_displacement;
6379 * VectorTools::interpolate_boundary_values( this->dof_handler_ref,
6381 * ConstantFunction<dim>(value[2],this->n_components),
6383 * this->fe.component_mask(direction) );
6385 * VectorTools::interpolate_boundary_values( this->dof_handler_ref,
6387 * ZeroFunction<dim>(this->n_components),
6389 * (this->fe.component_mask(this->x_displacement) |
6390 * this->fe.component_mask(this->y_displacement) ));
6394 * virtual Tensor<1,dim>
6395 * get_neumann_traction (const types::boundary_id &boundary_id,
6396 * const Point<dim> &pt,
6397 * const Tensor<1,dim> &N) const
6399 * if (this->parameters.load_type == "pressure")
6401 * if (boundary_id == 5)
6403 * const double final_load = this->parameters.load;
6404 * const double current_time = this->time.get_current();
6405 * const double final_time = this->time.get_end();
6406 * const double num_cycles = 3.0;
6408 * return final_load/2.0 * (1.0 - std::sin(numbers::PI * (2.0*num_cycles*current_time/final_time + 0.5))) * N;
6414 * return Tensor<1,dim>();
6417 * virtual types::boundary_id
6418 * get_reaction_boundary_id_for_output() const
6423 * virtual std::vector<double>
6424 * get_dirichlet_load(const types::boundary_id &boundary_id,
6425 * const int &direction) const
6427 * std::vector<double> displ_incr(dim,0.0);
6429 * if ( (boundary_id == 5) && (direction == 2) )
6431 * const double final_displ = this->parameters.load;
6432 * const double current_time = this->time.get_current();
6433 * const double final_time = this->time.get_end();
6434 * const double delta_time = this->time.get_delta_t();
6435 * const double num_cycles = 3.0;
6436 * double current_displ = 0.0;
6437 * double previous_displ = 0.0;
6439 * if (this->parameters.num_cycle_sets == 1)
6441 * current_displ = final_displ/2.0 * (1.0 - std::sin(numbers::PI * (2.0*num_cycles*current_time/final_time + 0.5)));
6442 * previous_displ = final_displ/2.0 * (1.0 - std::sin(numbers::PI * (2.0*num_cycles*(current_time-delta_time)/final_time + 0.5)));
6446 * if ( current_time <= (final_time*1.0/3.0) )
6448 * current_displ = final_displ/2.0 * (1.0 - std::sin(numbers::PI *
6449 * (2.0*num_cycles*current_time/(final_time*1.0/3.0) + 0.5)));
6450 * previous_displ = final_displ/2.0 * (1.0 - std::sin(numbers::PI *
6451 * (2.0*num_cycles*(current_time-delta_time)/(final_time*1.0/3.0) + 0.5)));
6455 * current_displ = final_displ * (1.0 - std::sin(numbers::PI *
6456 * (2.0*num_cycles*current_time / (final_time*2.0/3.0)
6457 * - (num_cycles - 0.5) )));
6458 * previous_displ = final_displ * (1.0 - std::sin(numbers::PI *
6459 * (2.0*num_cycles*(current_time-delta_time) / (final_time*2.0/3.0)
6460 * - (num_cycles - 0.5))));
6463 * displ_incr[2] = current_displ - previous_displ;
6465 * return displ_incr;
6472 * <a name="DerivedclassNolateralorverticaldisplacementinloadingsurface"></a>
6473 * <h4>Derived class: No lateral or vertical displacement in loading surface</h4>
6476 * template <int dim>
6477 * class BrainBudday2017CubeShearFullyFixed
6478 * : public BrainBudday2017BaseCube<dim>
6481 * BrainBudday2017CubeShearFullyFixed (const Parameters::AllParameters ¶meters)
6482 * : BrainBudday2017BaseCube<dim> (parameters)
6485 * virtual ~BrainBudday2017CubeShearFullyFixed () {}
6489 * define_tracked_vertices(std::vector<Point<dim> > &tracked_vertices)
6491 * tracked_vertices[0][0] = 0.75*this->parameters.scale;
6492 * tracked_vertices[0][1] = 0.5*this->parameters.scale;
6493 * tracked_vertices[0][2] = 0.0*this->parameters.scale;
6495 * tracked_vertices[1][0] = 0.25*this->parameters.scale;
6496 * tracked_vertices[1][1] = 0.5*this->parameters.scale;
6497 * tracked_vertices[1][2] = 0.0*this->parameters.scale;
6501 * make_dirichlet_constraints(AffineConstraints<double> &constraints)
6503 * if (this->time.get_timestep() < 2)
6505 * VectorTools::interpolate_boundary_values(this->dof_handler_ref,
6507 * ConstantFunction<dim>(this->parameters.drained_pressure,this->n_components),
6509 * (this->fe.component_mask(this->pressure)));
6513 * VectorTools::interpolate_boundary_values( this->dof_handler_ref,
6515 * ZeroFunction<dim>(this->n_components),
6517 * (this->fe.component_mask(this->pressure)));
6520 * VectorTools::interpolate_boundary_values( this->dof_handler_ref,
6522 * ZeroFunction<dim>(this->n_components),
6524 * (this->fe.component_mask(this->x_displacement) |
6525 * this->fe.component_mask(this->y_displacement) |
6526 * this->fe.component_mask(this->z_displacement) ));
6529 * if (this->parameters.load_type == "displacement")
6531 * const std::vector<double> value = get_dirichlet_load(4,0);
6532 * FEValuesExtractors::Scalar direction;
6533 * direction = this->x_displacement;
6535 * VectorTools::interpolate_boundary_values( this->dof_handler_ref,
6537 * ConstantFunction<dim>(value[0],this->n_components),
6539 * this->fe.component_mask(direction));
6541 * VectorTools::interpolate_boundary_values( this->dof_handler_ref,
6543 * ZeroFunction<dim>(this->n_components),
6545 * (this->fe.component_mask(this->y_displacement) |
6546 * this->fe.component_mask(this->z_displacement) ));
6550 * virtual Tensor<1,dim>
6551 * get_neumann_traction (const types::boundary_id &boundary_id,
6552 * const Point<dim> &pt,
6553 * const Tensor<1,dim> &N) const
6555 * if (this->parameters.load_type == "pressure")
6557 * if (boundary_id == 4)
6559 * const double final_load = this->parameters.load;
6560 * const double current_time = this->time.get_current();
6561 * const double final_time = this->time.get_end();
6562 * const double num_cycles = 3.0;
6563 * const Point< 3, double> axis (0.0,1.0,0.0);
6564 * const double angle = numbers::PI;
6565 * static const Tensor< 2, dim, double> R(Physics::Transformations::Rotations::rotation_matrix_3d(axis,angle));
6567 * return (final_load * (std::sin(2.0*(numbers::PI)*num_cycles*current_time/final_time)) * (R * N));
6573 * return Tensor<1,dim>();
6576 * virtual types::boundary_id
6577 * get_reaction_boundary_id_for_output() const
6582 * virtual std::vector<double>
6583 * get_dirichlet_load(const types::boundary_id &boundary_id,
6584 * const int &direction) const
6586 * std::vector<double> displ_incr (dim, 0.0);
6588 * if ( (boundary_id == 4) && (direction == 0) )
6590 * const double final_displ = this->parameters.load;
6591 * const double current_time = this->time.get_current();
6592 * const double final_time = this->time.get_end();
6593 * const double delta_time = this->time.get_delta_t();
6594 * const double num_cycles = 3.0;
6595 * double current_displ = 0.0;
6596 * double previous_displ = 0.0;
6598 * if (this->parameters.num_cycle_sets == 1)
6600 * current_displ = final_displ * (std::sin(2.0*(numbers::PI)*num_cycles*current_time/final_time));
6601 * previous_displ = final_displ * (std::sin(2.0*(numbers::PI)*num_cycles*(current_time-delta_time)/final_time));
6605 * AssertThrow(false, ExcMessage("Problem type not defined. Budday shear experiments implemented only for one set of cycles."));
6607 * displ_incr[0] = current_displ - previous_displ;
6609 * return displ_incr;
6618 * <a name="Mainfunction"></a>
6619 * <h3>Main function</h3>
6620 * Lastly we provide the main driver function which is similar to the other tutorials.
6623 * int main (int argc, char *argv[])
6625 * using namespace dealii;
6626 * using namespace NonLinearPoroViscoElasticity;
6628 * const unsigned int n_tbb_processes = 1;
6629 * Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, n_tbb_processes);
6633 * Parameters::AllParameters parameters ("parameters.prm");
6634 * if (parameters.geom_type == "Ehlers_tube_step_load")
6636 * VerificationEhlers1999StepLoad<3> solid_3d(parameters);
6639 * else if (parameters.geom_type == "Ehlers_tube_increase_load")
6641 * VerificationEhlers1999IncreaseLoad<3> solid_3d(parameters);
6644 * else if (parameters.geom_type == "Ehlers_cube_consolidation")
6646 * VerificationEhlers1999CubeConsolidation<3> solid_3d(parameters);
6649 * else if (parameters.geom_type == "Franceschini_consolidation")
6651 * Franceschini2006Consolidation<3> solid_3d(parameters);
6654 * else if (parameters.geom_type == "Budday_cube_tension_compression")
6656 * BrainBudday2017CubeTensionCompression<3> solid_3d(parameters);
6659 * else if (parameters.geom_type == "Budday_cube_tension_compression_fully_fixed")
6661 * BrainBudday2017CubeTensionCompressionFullyFixed<3> solid_3d(parameters);
6664 * else if (parameters.geom_type == "Budday_cube_shear_fully_fixed")
6666 * BrainBudday2017CubeShearFullyFixed<3> solid_3d(parameters);
6671 * AssertThrow(false, ExcMessage("Problem type not defined. Current setting: " + parameters.geom_type));
6675 * catch (std::exception &exc)
6677 * if (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0)
6679 * std::cerr << std::endl << std::endl
6680 * << "----------------------------------------------------"
6682 * std::cerr << "Exception on processing: " << std::endl << exc.what()
6683 * << std::endl << "Aborting!" << std::endl
6684 * << "----------------------------------------------------"
6692 * if (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0)
6694 * std::cerr << std::endl << std::endl
6695 * << "----------------------------------------------------"
6697 * std::cerr << "Unknown exception!" << std::endl << "Aborting!"
6699 * << "----------------------------------------------------"
typename DataOut_DoFData< dim, patch_dim, spacedim, patch_spacedim >::cell_iterator cell_iterator
typename DataOut_DoFData< dim, dim, spacedim, spacedim >::cell_iterator cell_iterator
size_type n_elements() const
IndexSet get_view(const size_type begin, const size_type end) const
size_type nth_index_in_set(const size_type local_index) const
virtual void parse_input(std::istream &input, const std::string &filename="input file", const std::string &last_line="", const bool skip_undefined=false)
numbers::NumberTraits< Number >::real_type norm() const
void leave_subsection(const std::string §ion_name="")
void enter_subsection(const std::string §ion_name)
@ update_values
Shape function values.
@ update_normal_vectors
Normal vectors.
@ update_JxW_values
Transformed quadrature weights.
@ update_gradients
Shape function gradients.
@ update_quadrature_points
Transformed quadrature points.
__global__ void set(Number *val, const Number s, const size_type N)
#define Assert(cond, exc)
#define AssertDimension(dim1, dim2)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
static ::ExceptionBase & ExcMessage(std::string arg1)
#define AssertThrow(cond, exc)
typename ActiveSelector::active_cell_iterator active_cell_iterator
LinearOperator< Range, Domain, Payload > linear_operator(const Matrix &matrix)
void loop(ITERATOR begin, typename identity< ITERATOR >::type end, DOFINFO &dinfo, INFOBOX &info, const std::function< void(DOFINFO &, typename INFOBOX::CellInfo &)> &cell_worker, const std::function< void(DOFINFO &, typename INFOBOX::CellInfo &)> &boundary_worker, const std::function< void(DOFINFO &, DOFINFO &, typename INFOBOX::CellInfo &, typename INFOBOX::CellInfo &)> &face_worker, ASSEMBLER &assembler, const LoopControl &lctrl=LoopControl())
real_type l2_norm() const
void reinit(const Vector &v, const bool omit_zeroing_entries=false, const bool allow_different_maps=false)
void compress(::VectorOperation::values operation)
void make_sparsity_pattern(const DoFHandler< dim, spacedim > &dof_handler, SparsityPatternType &sparsity_pattern, const AffineConstraints< number > &constraints=AffineConstraints< number >(), const bool keep_constrained_dofs=true, const types::subdomain_id subdomain_id=numbers::invalid_subdomain_id)
void approximate(SynchronousIterators< std::tuple< typename DoFHandler< dim, spacedim >::active_cell_iterator, Vector< float >::iterator > > const &cell, const Mapping< dim, spacedim > &mapping, const DoFHandler< dim, spacedim > &dof_handler, const InputVector &solution, const unsigned int component)
void component_wise(DoFHandler< dim, spacedim > &dof_handler, const std::vector< unsigned int > &target_component=std::vector< unsigned int >())
void Cuthill_McKee(DoFHandler< dim, spacedim > &dof_handler, const bool reversed_numbering=false, const bool use_constraints=false, const std::vector< types::global_dof_index > &starting_indices=std::vector< types::global_dof_index >())
@ valid
Iterator points to a valid object.
static const types::blas_int zero
@ matrix
Contents is actually a matrix.
@ diagonal
Matrix is diagonal.
static const types::blas_int one
void cell_matrix(FullMatrix< double > &M, const FEValuesBase< dim > &fe, const FEValuesBase< dim > &fetest, const ArrayView< const std::vector< double > > &velocity, const double factor=1.)
double norm(const FEValuesBase< dim > &fe, const ArrayView< const std::vector< Tensor< 1, dim > > > &Du)
std::enable_if< IsBlockVector< VectorType >::value, unsignedint >::type n_blocks(const VectorType &vector)
Point< spacedim > point(const gp_Pnt &p, const double tolerance=1e-10)
SymmetricTensor< 2, dim, Number > C(const Tensor< 2, dim, Number > &F)
SymmetricTensor< 2, dim, Number > e(const Tensor< 2, dim, Number > &F)
SymmetricTensor< 2, dim, Number > b(const Tensor< 2, dim, Number > &F)
SymmetricTensor< 2, dim, Number > d(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
Tensor< 2, dim, Number > F(const Tensor< 2, dim, Number > &Grad_u)
constexpr ReturnType< rank, T >::value_type & extract(T &t, const ArrayType &indices)
VectorType::value_type * end(VectorType &V)
unsigned int this_mpi_process(const MPI_Comm &mpi_communicator)
T reduce(const T &local_value, const MPI_Comm &comm, const std::function< T(const T &, const T &)> &combiner, const unsigned int root_process=0)
unsigned int n_mpi_processes(const MPI_Comm &mpi_communicator)
void run(const Iterator &begin, const typename identity< Iterator >::type &end, Worker worker, Copier copier, const ScratchData &sample_scratch_data, const CopyData &sample_copy_data, const unsigned int queue_length, const unsigned int chunk_size)
void abort(const ExceptionBase &exc) noexcept
bool check(const ConstraintKinds kind_in, const unsigned int dim)
void copy(const T *begin, const T *end, U *dest)
int(&) functions(const void *v1, const void *v2)
void assemble(const MeshWorker::DoFInfoBox< dim, DOFINFO > &dinfo, A *assembler)
::VectorizedArray< Number, width > abs(const ::VectorizedArray< Number, width > &)
const ::parallel::distributed::Triangulation< dim, spacedim > * triangulation
constexpr SymmetricTensor< 2, dim, Number > symmetrize(const Tensor< 2, dim, Number > &t)
constexpr Number determinant(const SymmetricTensor< 2, dim, Number > &)
constexpr SymmetricTensor< 2, dim, Number > invert(const SymmetricTensor< 2, dim, Number > &)
SymmetricTensorEigenvectorMethod