Skip to content

Commit

Permalink
fix clang unity build issue
Browse files Browse the repository at this point in the history
  • Loading branch information
sunethwarna committed Mar 6, 2024
1 parent 966f833 commit 9f1cf77
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,6 @@

namespace Kratos {

template<>
const ModelPart::NodesContainerType& FilterUtils::GetContainer(const ModelPart& rModelPart)
{
return rModelPart.Nodes();
}

template<>
const ModelPart::ConditionsContainerType& FilterUtils::GetContainer(const ModelPart& rModelPart)
{
return rModelPart.Conditions();
}

template<>
const ModelPart::ElementsContainerType& FilterUtils::GetContainer(const ModelPart& rModelPart)
{
return rModelPart.Elements();
}

std::vector<std::vector<const ModelPart*>> FilterUtils::GetComponentWiseDampedModelParts(
Model& rModel,
Parameters Settings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
// System includes
#include <vector>
#include <unordered_map>
#include <type_traits>

// Project includes
#include "containers/model.h"
Expand Down Expand Up @@ -67,7 +68,19 @@ class KRATOS_API(OPTIMIZATION_APPLICATION) FilterUtils {
const IndexType NumberOfComponents);

template<class TContainerType>
static const TContainerType& GetContainer(const ModelPart& rModelPart);
static const TContainerType& GetContainer(const ModelPart& rModelPart)
{
if constexpr(std::is_same_v<TContainerType, ModelPart::NodesContainerType>) {
return rModelPart.Nodes();
} else if constexpr(std::is_same_v<TContainerType, ModelPart::ConditionsContainerType>) {
return rModelPart.Conditions();
} else if constexpr(std::is_same_v<TContainerType, ModelPart::ElementsContainerType>) {
return rModelPart.Elements();
} else {
static_assert(!std::is_same_v<TContainerType, TContainerType>, "Unsupported TContainerType");
return TContainerType{};
}
}

template<class TContainerType>
static ContainerExpression<TContainerType> ComputeDampingCoefficientsBasedOnNearestEntity(
Expand Down

0 comments on commit 9f1cf77

Please sign in to comment.