https://gitlab.opengeosys.org/ogs/ogs.git
Raw File
Tip revision: 61613f23caa482fe53a4106e11aa3c24c0d968bf authored by joergbuchwald on 03 June 2021, 10:22:28 UTC
Merge branch 'saturation_dependent_thermal_conductivity' into 'master'
Tip revision: 61613f2
BMatrixPolicy.h
/**
 * \file
 * \copyright
 * Copyright (c) 2012-2021, OpenGeoSys Community (http://www.opengeosys.org)
 *            Distributed under a Modified BSD License.
 *              See accompanying file LICENSE.txt or
 *              http://www.opengeosys.org/project/license
 *
 */

#pragma once

#include "MathLib/KelvinVector.h"
#include "NumLib/Fem/ShapeMatrixPolicy.h"

namespace ProcessLib
{
/// An implementation of B-Matrix policy using same matrix and vector types
/// (fixed size or dynamic) as in the ShapeMatrixPolicyType.
template <typename ShapeFunction, unsigned DisplacementDim>
class BMatrixPolicyType
{
private:
    /// Reusing the ShapeMatrixPolicy vector type.
    template <int N>
    using VectorType =
        typename ShapeMatrixPolicyType<ShapeFunction,
                                       DisplacementDim>::template VectorType<N>;

    /// Reusing the ShapeMatrixPolicy matrix type.
    template <int N, int M>
    using MatrixType = typename ShapeMatrixPolicyType<
        ShapeFunction, DisplacementDim>::template MatrixType<N, M>;

    // Dimensions of specific b-matrix for n-points and displacement dimension.
    static int const _number_of_dof = ShapeFunction::NPOINTS * DisplacementDim;
    static int const _kelvin_vector_size =
        MathLib::KelvinVector::kelvin_vector_dimensions(DisplacementDim);

public:
    using StiffnessMatrixType = MatrixType<_number_of_dof, _number_of_dof>;

    /// Rhs residual
    using NodalForceVectorType = VectorType<_number_of_dof>;

    /// This type can be different (fixed vs. dynamic size) from the
    /// MathLib::KelvinVector::KelvinVectorType.
    using KelvinVectorType = VectorType<_kelvin_vector_size>;

    /// This type can be different (fixed vs. dynamic size) from the
    /// MathLib::KelvinVector::KelvinMatrixType.
    using KelvinMatrixType =
        MatrixType<_kelvin_vector_size, _kelvin_vector_size>;

    using BMatrixType = MatrixType<_kelvin_vector_size, _number_of_dof>;
};
}  // namespace ProcessLib
back to top