https://gitlab.opengeosys.org/ogs/ogs.git
Raw File
Tip revision: 5de6fbffb14d95156582047ab16745c772f4aa7d authored by Dominik Kern on 22 November 2021, 15:21:24 UTC
Merge branch 'add_staggered_scheme_to_userguide' into 'master'
Tip revision: 5de6fbf
GlobalMatrixProviders.cpp
/**
 * \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
 *
 */

#include "GlobalMatrixProviders.h"

#include <memory>

#include "SimpleMatrixVectorProvider.h"

// Initializes the static members of the structs in the header file
// associated with this file.
#define INITIALIZE_GLOBAL_MATRIX_VECTOR_PROVIDER(VARNAME)               \
    static std::unique_ptr<NumLib::SimpleMatrixVectorProvider> VARNAME{ \
        new NumLib::SimpleMatrixVectorProvider};                        \
                                                                        \
    namespace NumLib                                                    \
    {                                                                   \
    VectorProvider& GlobalVectorProvider::provider = *(VARNAME);        \
                                                                        \
    MatrixProvider& GlobalMatrixProvider::provider = *(VARNAME);        \
    }

INITIALIZE_GLOBAL_MATRIX_VECTOR_PROVIDER(globalSetupGlobalMatrixVectorProvider)

namespace NumLib
{
void cleanupGlobalMatrixProviders()
{
    globalSetupGlobalMatrixVectorProvider.reset();
}
}  // namespace NumLib
back to top