Revision 9f0c92b74558b07017c12914ce99abd6e9e8cee9 authored by joergbuchwald on 21 April 2021, 11:40:56 UTC, committed by joergbuchwald on 21 April 2021, 11:40:56 UTC
add MPL property for handling effective thermal conductivity on the medium level

See merge request ogs/ogs!3546
2 parent s 2e95ebe + f4767ab
Raw File
SetMatrixSparsity.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

namespace MathLib
{

/// Default implementation of SetMatrixSparsity class called by
/// setMatrixSparsity.
/// This is a workaround for partial function specialization.
template <typename MATRIX, typename SPARSITY_PATTERN>
struct SetMatrixSparsity
{
    void operator()(MATRIX& /*unused*/,
                    SPARSITY_PATTERN const& /*unused*/) const
    {
    }
};

/// Sets the sparsity pattern of the underlying matrix.
/// To allow partial specialization a SetMatrixSparsity template is
/// instantiated, to which the matrix and the sparsity_pattern are passed.
template <typename MATRIX, typename SPARSITY_PATTERN>
void setMatrixSparsity(MATRIX& matrix, SPARSITY_PATTERN const& sparsity_pattern)
{
    SetMatrixSparsity<MATRIX, SPARSITY_PATTERN> set_sparsity;
    set_sparsity(matrix, sparsity_pattern);
}

}  // namespace MathLib

#ifdef USE_LIS
#include "Lis/LisMatrix.h"
#endif  // USE_LIS

#include "Eigen/EigenMatrix.h"
back to top