https://gitlab.opengeosys.org/ogs/ogs.git
Raw File
Tip revision: 65975038d563c20fa30c60d5c016268f1a0636bc authored by Dmitry Yu. Naumov on 13 December 2022, 19:22:55 UTC
Merge branch 'FixPhaseFieldBcOnPartitionBoundaries' into 'master'
Tip revision: 6597503
GlobalMatrixVectorTypes.h
/**
 * \file
 * \copyright
 * Copyright (c) 2012-2022, 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 "SparsityPattern.h"

//
// Global vector/matrix types and linear solver.
//
#if defined(USE_LIS)

#include "MathLib/LinAlg/Eigen/EigenMatrix.h"
#include "MathLib/LinAlg/Eigen/EigenVector.h"
#include "MathLib/LinAlg/EigenLis/EigenLisLinearSolver.h"

using GlobalVector = MathLib::EigenVector;
using GlobalMatrix = MathLib::EigenMatrix;

using GlobalLinearSolver = MathLib::EigenLisLinearSolver;

#elif defined(USE_PETSC)
#include "MathLib/LinAlg/PETSc/PETScLinearSolver.h"
#include "MathLib/LinAlg/PETSc/PETScMatrix.h"
#include "MathLib/LinAlg/PETSc/PETScVector.h"

using GlobalVector = MathLib::PETScVector;
using GlobalMatrix = MathLib::PETScMatrix;

using GlobalLinearSolver = MathLib::PETScLinearSolver;

#else
#include "MathLib/LinAlg/Eigen/EigenLinearSolver.h"
#include "MathLib/LinAlg/Eigen/EigenMatrix.h"
#include "MathLib/LinAlg/Eigen/EigenVector.h"

using GlobalVector = MathLib::EigenVector;
using GlobalMatrix = MathLib::EigenMatrix;

using GlobalLinearSolver = MathLib::EigenLinearSolver;

#endif

/// A type used for indexing of global vectors and matrices. It is equal to the
/// GlobalMatrix::IndexType and the GlobalVector::IndexType.
static_assert(std::is_integral_v<GlobalMatrix::IndexType>,
              "The index type for global matrices is not an integral type.");
static_assert(std::is_integral_v<GlobalVector::IndexType>,
              "The index type for global vectors is not an integral type.");
static_assert(std::is_same_v<GlobalMatrix::IndexType, GlobalVector::IndexType>,
              "The global matrix and vector index types do not match.");
// Both types are integral types and equal, define a single GlobalIndexType.
using GlobalIndexType = GlobalMatrix::IndexType;

using GlobalSparsityPattern = MathLib::SparsityPattern<GlobalIndexType>;
back to top