GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: dumux/dumux/solidmechanics/hyperelastic/spatialparams.hh
Date: 2025-04-12 19:19:20
Exec Total Coverage
Lines: 20 20 100.0%
Functions: 3 3 100.0%
Branches: 7 14 50.0%

Line Branch Exec Source
1 // -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 // vi: set et ts=4 sw=4 sts=4:
3 //
4 // SPDX-FileCopyrightText: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5 // SPDX-License-Identifier: GPL-3.0-or-later
6 //
7 /*!
8 * \file
9 * \ingroup Hyperelastic
10 * \brief Default implementation of the spatial params
11 */
12 #ifndef DUMUX_SOLIDMECHANICS_DEFAULT_HYPERELASTIC_SPATIAL_PARAMS_HH
13 #define DUMUX_SOLIDMECHANICS_DEFAULT_HYPERELASTIC_SPATIAL_PARAMS_HH
14
15 #include <dumux/common/fvspatialparams.hh>
16
17 namespace Dumux {
18
19 template<class GridGeometry, class Scalar>
20
1/2
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
3 class DefaultHyperelasticSpatialParams
21 : public FVSpatialParams<GridGeometry, Scalar, DefaultHyperelasticSpatialParams<GridGeometry, Scalar>>
22 {
23 using ParentType = FVSpatialParams<GridGeometry, Scalar, DefaultHyperelasticSpatialParams<GridGeometry, Scalar>>;
24 public:
25 2 DefaultHyperelasticSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry)
26 : ParentType(gridGeometry)
27 4 , E_(getParam<Scalar>("SpatialParams.YoungsModulus"))
28
3/6
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 2 times.
✗ Branch 6 not taken.
✓ Branch 8 taken 2 times.
✗ Branch 9 not taken.
4 , nu_(getParam<Scalar>("SpatialParams.PoissonRatio"))
29 {
30 2 mu_ = E_/(2*(1 + nu_));
31 2 K_ = E_/(3*(1 - 2*nu_));
32 2 lambda_ = nu_*E_/((1 + nu_)*(1-2*nu_));
33 2 }
34
35 26214372 Scalar shearModulus() const
36 26214372 { return mu_; }
37
38 14745600 Scalar bulkModulus() const
39 14745600 { return K_; }
40
41 Scalar youngsModulus() const
42 { return E_; }
43
44 Scalar poissonRatio() const
45 { return nu_; }
46
47 11468772 Scalar firstLameParameter() const
48 11468772 { return lambda_; }
49
50 private:
51 Scalar E_, nu_, mu_, K_, lambda_;
52 };
53
54 template<class GridGeometry, class Scalar>
55
1/2
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
1 class DefaultDynamicHyperelasticSpatialParams
56 : public DefaultHyperelasticSpatialParams<GridGeometry, Scalar>
57 {
58 using ParentType = DefaultHyperelasticSpatialParams<GridGeometry, Scalar>;
59 public:
60 1 DefaultDynamicHyperelasticSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry)
61 : ParentType(gridGeometry)
62
2/4
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
2 , rho_(getParam<Scalar>("SpatialParams.SolidDensity"))
63 1 {}
64
65 22937544 Scalar solidDensity() const
66 22937544 { return rho_; }
67
68 private:
69 Scalar rho_;
70 };
71
72 } // end namespace Dumux
73
74 #endif
75