GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/dumux/geomechanics/hyperelastic/spatialparams.hh
Date: 2024-05-04 19:09:25
Exec Total Coverage
Lines: 8 12 66.7%
Functions: 1 3 33.3%
Branches: 5 18 27.8%

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-FileCopyrightInfo: 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_GEOMECHANICS_DEFAULT_HYPERELASTIC_SPATIAL_PARAMS_HH
13 #define DUMUX_GEOMECHANICS_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/6
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
1 class DefaultHyperelasticSpatialParams
21 : public FVSpatialParams<GridGeometry, Scalar, DefaultHyperelasticSpatialParams<GridGeometry, Scalar>>
22 {
23 using ParentType = FVSpatialParams<GridGeometry, Scalar, DefaultHyperelasticSpatialParams<GridGeometry, Scalar>>;
24 public:
25 1 DefaultHyperelasticSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry)
26 : ParentType(gridGeometry)
27 1 , E_(getParam<Scalar>("SpatialParams.YoungsModulus"))
28
4/12
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
2 , nu_(getParam<Scalar>("SpatialParams.PoissonRatio"))
29 {
30 1 mu_ = E_/(2*(1 + nu_));
31 1 K_ = E_/(3*(1 - 2*nu_));
32 1 lambda_ = nu_*E_/((1 + nu_)*(1-2*nu_));
33 1 }
34
35 Scalar shearModulus() const
36 { return mu_; }
37
38 Scalar bulkModulus() const
39 { return K_; }
40
41 Scalar youngsModulus() const
42 { return E_; }
43
44 Scalar poissonRatio() const
45 { return nu_; }
46
47 Scalar firstLameParameter() const
48 { return lambda_; }
49
50 private:
51 Scalar E_, nu_, mu_, K_, lambda_;
52 };
53
54 } // end namespace Dumux
55
56 #endif
57