Skip to content

Commit

Permalink
Merge pull request #11846 from KratosMultiphysics/core+trilinos/stati…
Browse files Browse the repository at this point in the history
…c-method-IsDistributedSpace-spaces
  • Loading branch information
loumalouomega authored Nov 24, 2023
2 parents 890d1a2 + 8adbc7d commit 1a4ca38
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 15 deletions.
10 changes: 10 additions & 0 deletions applications/TrilinosApplication/trilinos_space.h
Original file line number Diff line number Diff line change
Expand Up @@ -1286,6 +1286,16 @@ class TrilinosSpace
KRATOS_CATCH("");
}

/**
* @brief Check if the TrilinosSpace is distributed.
* @details This static member function checks whether the TrilinosSpace is distributed or not.
* @return True if the space is distributed, false otherwise.
*/
static constexpr bool IsDistributedSpace()
{
return true;
}

///@}
///@name Access
///@{
Expand Down
57 changes: 42 additions & 15 deletions kratos/spaces/ublas_space.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
// _|\_\_| \__,_|\__|\___/ ____/
// Multi-Physics
//
// License: BSD License
// Kratos default license: kratos/license.txt
// License: BSD License
// Kratos default license: kratos/license.txt
//
// Main authors: Riccardo Rossi
// Collaborator: Vicente Mataix Ferrandiz
//
//

#pragma once

Expand Down Expand Up @@ -106,9 +105,16 @@ enum class SCALING_DIAGONAL {NO_SCALING = 0, CONSIDER_NORM_DIAGONAL = 1, CONSIDE
///@name Kratos Classes
///@{

/// Short class definition.

/** Detail class definition.
/**
* @class UblasSpace
* @ingroup KratosCore
* @brief A class template for handling data types, matrices, and vectors in a Ublas space.
* @details This class template is designed to work with different data types, matrix types, and vector types
* within a Ublas space. It provides typedefs and utilities for managing these types effectively.
* @tparam TDataType The data type used in the Ublas space.
* @tparam TMatrixType The matrix type used in the Ublas space.
* @tparam TVectorType The vector type used in the Ublas space.
* @author Riccardo Rossi
*/
template<class TDataType, class TMatrixType, class TVectorType>
class UblasSpace
Expand All @@ -120,21 +126,32 @@ class UblasSpace
/// Pointer definition of UblasSpace
KRATOS_CLASS_POINTER_DEFINITION(UblasSpace);

typedef TDataType DataType;
/// The data type considered
using DataType = TDataType;

/// The matrix type considered
using MatrixType = TMatrixType;

/// The vector type considered
using VectorType = TVectorType;

typedef TMatrixType MatrixType;
/// The index type considered
using IndexType = std::size_t;

typedef TVectorType VectorType;
/// The size type considered
using SizeType = std::size_t;

typedef std::size_t IndexType;
/// The pointer to the matrix type
using MatrixPointerType = typename Kratos::shared_ptr<TMatrixType>;

typedef std::size_t SizeType;
/// The pointer to the vector type
using VectorPointerType = typename Kratos::shared_ptr<TVectorType>;

typedef typename Kratos::shared_ptr< TMatrixType > MatrixPointerType;
typedef typename Kratos::shared_ptr< TVectorType > VectorPointerType;
/// The DoF updater type
using DofUpdaterType = DofUpdater<UblasSpace<TDataType, TMatrixType, TVectorType>>;

typedef DofUpdater< UblasSpace<TDataType,TMatrixType,TVectorType> > DofUpdaterType;
typedef typename DofUpdaterType::UniquePointer DofUpdaterPointerType;
/// The pointer to the DoF updater type
using DofUpdaterPointerType = typename DofUpdaterType::UniquePointer;

///@}
///@name Life Cycle
Expand Down Expand Up @@ -912,6 +929,16 @@ class UblasSpace
return tmp.Create();
}

/**
* @brief Check if the UblasSpace is distributed.
* @details This static member function checks whether the UblasSpace is distributed or not.
* @return True if the space is distributed, false otherwise.
*/
static constexpr bool IsDistributedSpace()
{
return false;
}

///@}
///@name Friends
///@{
Expand Down

0 comments on commit 1a4ca38

Please sign in to comment.