Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,46 @@ template<>
void VectorContainerType::UpdateSystemVectorFromModelPart(const Variable<double>& rVariable,
const Kratos::Flags& rMappingOptions)
{
MapperUtilities::UpdateSystemVectorFromModelPart(*mpInterfaceVector, mrModelPart, rVariable, rMappingOptions);
switch (mInterfaceEntityType) {
case InterfaceEntityType::NODES:
MapperUtilities::UpdateSystemVectorFromModelPartNodes(*mpInterfaceVector, mrModelPart, rVariable, rMappingOptions);
break;

case InterfaceEntityType::ELEMENTS:
MapperUtilities::UpdateSystemVectorFromModelPartElements(*mpInterfaceVector, mrModelPart, rVariable, rMappingOptions);
break;

case InterfaceEntityType::CONDITIONS:
MapperUtilities::UpdateSystemVectorFromModelPartConditions(*mpInterfaceVector, mrModelPart, rVariable, rMappingOptions);
break;

case InterfaceEntityType::GEOMETRIES:
MapperUtilities::UpdateSystemVectorFromModelPartGeometries(*mpInterfaceVector, mrModelPart, rVariable, rMappingOptions);
break;
}
}

template<>
void VectorContainerType::UpdateModelPartFromSystemVector(const Variable<double>& rVariable,
const Kratos::Flags& rMappingOptions)
{
MapperUtilities::UpdateModelPartFromSystemVector(*mpInterfaceVector, mrModelPart, rVariable, rMappingOptions);
switch (mInterfaceEntityType) {
case InterfaceEntityType::NODES:
MapperUtilities::UpdateModelPartNodesFromSystemVector(*mpInterfaceVector, mrModelPart, rVariable, rMappingOptions);
break;

case InterfaceEntityType::ELEMENTS:
MapperUtilities::UpdateModelPartElementsFromSystemVector(*mpInterfaceVector, mrModelPart, rVariable, rMappingOptions);
break;

case InterfaceEntityType::CONDITIONS:
MapperUtilities::UpdateModelPartConditionsFromSystemVector(*mpInterfaceVector, mrModelPart, rVariable, rMappingOptions);
break;

case InterfaceEntityType::GEOMETRIES:
MapperUtilities::UpdateModelPartGeometriesFromSystemVector(*mpInterfaceVector, mrModelPart, rVariable, rMappingOptions);
break;
}
}

///////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,28 @@ class KRATOS_API(MAPPING_APPLICATION) InterfaceVectorContainer

typedef Kratos::unique_ptr<TSystemVectorType> TSystemVectorUniquePointerType;

enum class InterfaceEntityType {
NODES,
ELEMENTS,
CONDITIONS,
GEOMETRIES
};

///@}
///@name Life Cycle
///@{


/// Default constructor.
explicit InterfaceVectorContainer(ModelPart& rModelPart) : mrModelPart(rModelPart) {}
explicit InterfaceVectorContainer(ModelPart& rModelPart)
: InterfaceVectorContainer(rModelPart, InterfaceEntityType::NODES)
{}

/// Constructor with entity type
InterfaceVectorContainer(ModelPart& rModelPart, InterfaceEntityType EntityType)
: mrModelPart(rModelPart)
, mInterfaceEntityType(EntityType)
{}

/// Destructor.
virtual ~InterfaceVectorContainer() = default;
Expand Down Expand Up @@ -99,8 +115,8 @@ class KRATOS_API(MAPPING_APPLICATION) InterfaceVectorContainer
private:
///@name Member Variables
///@{

ModelPart& mrModelPart;
InterfaceEntityType mInterfaceEntityType = InterfaceEntityType::NODES;
TSystemVectorUniquePointerType mpInterfaceVector = nullptr;

///@}
Expand Down
Loading
Loading