GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: dumux/test/solidmechanics/elastic/spatialparams.hh
Date: 2025-04-12 19:19:20
Exec Total Coverage
Lines: 7 7 100.0%
Functions: 1 1 100.0%
Branches: 2 4 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 GeomechanicsTests
10 * \brief Definition of the spatial parameters for the linear elasticity problem.
11 */
12
13 #ifndef DUMUX_ELASTIC_SPATIAL_PARAMS_HH
14 #define DUMUX_ELASTIC_SPATIAL_PARAMS_HH
15
16 #include <dumux/solidmechanics/elastic/lameparams.hh>
17 #include <dumux/solidmechanics/elastic/fvspatialparams.hh>
18
19 namespace Dumux {
20
21 /*!
22 * \ingroup GeomechanicsTests
23 * \brief Definition of the spatial parameters for the linear elasticity problem.
24 */
25 template<class Scalar, class GridGeometry>
26
1/2
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
1 class ElasticSpatialParams : public FVElasticSpatialParams< GridGeometry,
27 Scalar,
28 ElasticSpatialParams<Scalar, GridGeometry> >
29 {
30 using ThisType = ElasticSpatialParams<Scalar, GridGeometry>;
31 using ParentType = FVElasticSpatialParams<GridGeometry, Scalar, ThisType>;
32
33 using SubControlVolume = typename GridGeometry::SubControlVolume;
34 using GridView = typename GridGeometry::GridView;
35 using Element = typename GridView::template Codim<0>::Entity;
36 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
37
38 public:
39 //! Export the type of the lame parameters
40 using LameParams = Dumux::LameParams<Scalar>;
41
42 1 ElasticSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry)
43
1/2
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
1 : ParentType(gridGeometry)
44 {
45 1 lameParams_.setLambda(3e9);
46 1 lameParams_.setMu(3e9);
47 1 }
48
49 //! Defines the Lame parameters.
50 const LameParams& lameParamsAtPos(const GlobalPosition& globalPos) const
51 7848 { return lameParams_; }
52
53 private:
54 LameParams lameParams_;
55 };
56 } // end namespace Dumux
57 #endif
58