Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MappingApplication] Minor clean up of the 2D-3D projection mapping #12489

Merged
merged 1 commit into from
Jul 1, 2024
Merged
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 @@ -152,20 +152,20 @@ class Projection3D2DMapper
KRATOS_CLASS_POINTER_DEFINITION(Projection3D2DMapper);

/// BaseType definitions
typedef InterpolativeMapperBase<TSparseSpace, TDenseSpace, TMapperBackend> BaseType;
typedef Kratos::unique_ptr<BaseType> BaseMapperUniquePointerType;
typedef typename BaseType::TMappingMatrixType TMappingMatrixType;
typedef typename BaseType::MapperUniquePointerType MapperUniquePointerType;
using BaseType = InterpolativeMapperBase<TSparseSpace, TDenseSpace, TMapperBackend>;
using BaseMapperUniquePointerType = Kratos::unique_ptr<BaseType>;
using TMappingMatrixType = typename BaseType::TMappingMatrixType;
using MapperUniquePointerType = typename BaseType::MapperUniquePointerType;

/// Interface definitions
typedef typename TMapperBackend::InterfaceCommunicatorType InterfaceCommunicatorType;
typedef typename InterfaceCommunicator::MapperInterfaceInfoUniquePointerType MapperInterfaceInfoUniquePointerType;
using InterfaceCommunicatorType = typename TMapperBackend::InterfaceCommunicatorType;
using MapperInterfaceInfoUniquePointerType = typename InterfaceCommunicatorType::MapperInterfaceInfoUniquePointerType;

/// Other mappers definition
typedef NearestNeighborMapper<TSparseSpace, TDenseSpace, TMapperBackend> NearestNeighborMapperType;
typedef NearestElementMapper<TSparseSpace, TDenseSpace, TMapperBackend> NearestElementMapperType;
typedef BarycentricMapper<TSparseSpace, TDenseSpace, TMapperBackend> BarycentricMapperType;
using NearestNeighborMapperType = NearestNeighborMapper<TSparseSpace, TDenseSpace, TMapperBackend>;
using NearestElementMapperType = NearestElementMapper<TSparseSpace, TDenseSpace, TMapperBackend>;
using BarycentricMapperType = BarycentricMapper<TSparseSpace, TDenseSpace, TMapperBackend>;

///@}
///@name Enum's
///@{
Expand All @@ -179,7 +179,7 @@ class Projection3D2DMapper
CONDITIONS,
ELEMENTS
};

///@}
///@name Life Cycle
///@{
Expand Down Expand Up @@ -214,6 +214,11 @@ class Projection3D2DMapper

// Checking if the 2D modelpart is the origin model part
CheckOriginIs2D();
if (mOriginIs2D) {
KRATOS_INFO("Projection3D2DMapper") << "The 2D model part is the origin model part" << std::endl;
} else {
KRATOS_INFO("Projection3D2DMapper") << "The 3D model part is the origin model part" << std::endl;
}

// Type of metamapper considered
mMetaMapperType = mCopiedParameters["base_mapper"].GetString();
Expand All @@ -223,7 +228,7 @@ class Projection3D2DMapper
// Type of mesh entity considered
GetEntityMeshType();

// Getting the normal and reference plane
// Getting the normal and reference plane
GetNormalAndReferencePlane();

// Move mesh
Expand Down Expand Up @@ -264,7 +269,7 @@ class Projection3D2DMapper

/**
* @brief Updates the mapping-system after the geometry/mesh has changed
* After changes in the topology (e.g. remeshing or sliding interfaces)
* @details After changes in the topology (e.g. remeshing or sliding interfaces)
* the relations for the mapping have to be recomputed. This means that
* the search has to be conducted again and the mapping-system has to be
* rebuilt, hence this is expensive
Expand All @@ -277,7 +282,7 @@ class Projection3D2DMapper
) override
{
KRATOS_TRY;

// Pre mapper creation operations when model part of origin is 2D
if (mOriginIs2D) {
// Move mesh
Expand Down Expand Up @@ -331,7 +336,7 @@ class Projection3D2DMapper

/**
* @brief This method returns the 2D model part
* @return The 2D model part
* @return The 2D model part
*/
ModelPart& Get2DModelPart()
{
Expand All @@ -340,7 +345,7 @@ class Projection3D2DMapper

/**
* @brief This method returns the 3D model part
* @return The 3D model part
* @return The 3D model part
*/
ModelPart& Get3DModelPart()
{
Expand Down Expand Up @@ -579,7 +584,7 @@ class Projection3D2DMapper
*/
void UnMoveModelParts()
{
KRATOS_TRY;
KRATOS_TRY;

// The 3D model part
auto& r_3d_model_part = this->Get3DModelPart();
Expand Down
Loading