-
Notifications
You must be signed in to change notification settings - Fork 273
[MappingApplication] Proper Implementation of a Radial Basis Function Mapper for FEM-FEM and IBRA-FEM #13981
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
base: master
Are you sure you want to change the base?
Changes from all commits
aea9c5a
07ce71d
5be0815
f687181
b270b2e
e344117
d7b201b
22377f1
9b848b3
da7cc7a
ea6aec0
a01d093
994dfac
c7098fa
61e7fc5
3e45bc0
2fad679
62ab6c4
f7a2a4d
b10cb87
8d36f20
a250955
340b316
bfe526a
3a10cb1
0d075ff
53233bb
113865f
ffb4ad4
ef2b099
841b5ad
42fe081
8b12985
db5ef77
9f4327a
a9828e2
426df72
c149291
89db329
5fec50f
1af1275
f4d1771
b0eeb1d
1290106
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -25,6 +25,8 @@ | |||
|
|
||||
| namespace Kratos | ||||
| { | ||||
| class RBFSupportAccumulator; | ||||
|
|
||||
| ///@addtogroup MappingApplication | ||||
| ///@{ | ||||
|
|
||||
|
|
@@ -118,6 +120,15 @@ class MapperInterfaceInfo | |||
| virtual MapperInterfaceInfo::Pointer Create(const CoordinatesArrayType& rCoordinates, | ||||
| const IndexType SourceLocalSystemIndex, | ||||
| const IndexType SourceRank) const = 0; | ||||
|
|
||||
| /** | ||||
| * @brief Returning the results of the neighbour search for the RBF mapper | ||||
| * @author Juan I. Camarotti | ||||
| */ | ||||
| virtual const RBFSupportAccumulator& GetRBFSupportAccumulator() const | ||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please dont add a special interface I solved basically the same issue with
Its not the greatest solution either, but I think in this case its cleaner |
||||
| { | ||||
| KRATOS_ERROR << "Base class function called!" << std::endl; | ||||
| } | ||||
|
|
||||
| // needed for serialization | ||||
| virtual MapperInterfaceInfo::Pointer Create() const = 0; | ||||
|
|
||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -206,12 +206,59 @@ void MappingMatrixUtilitiesType::BuildMappingMatrix( | |
|
|
||
| BuildMatrix(rpMappingMatrix, rMapperLocalSystems); | ||
|
|
||
| // refactor to be used from the mapper directly | ||
| // if (EchoLevel > 2) { | ||
| // const std::string base_file_name = "O_" + rModelPartOrigin.Name() + "__D_" + rModelPartDestination.Name() +".mm"; | ||
| // MappingSparseSpaceType::WriteMatrixMarketMatrix(("MappingMatrix_"+base_file_name).c_str(), *rpMappingMatrix, false); | ||
| // CheckRowSum<MappingSparseSpaceType, DenseSpaceType>(*rpMappingMatrix, base_file_name); | ||
| // } | ||
| MappingMatrixUtilitiesType::InitializeSystemVector(rpInterfaceVectorOrigin, num_nodes_origin); | ||
| MappingMatrixUtilitiesType::InitializeSystemVector(rpInterfaceVectorDestination, num_nodes_destination); | ||
|
|
||
| KRATOS_CATCH("") | ||
| } | ||
|
|
||
| template<> | ||
| void MappingMatrixUtilitiesType::BuildMappingMatrixRBFMapper( | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if its RBF-specific, then please move it to the rbf-mapper
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I’d prefer to keep this implementation here. Moving it elsewhere would force |
||
| Kratos::unique_ptr<typename MappingSparseSpaceType::MatrixType>& rpMappingMatrix, | ||
| Kratos::unique_ptr<typename MappingSparseSpaceType::VectorType>& rpInterfaceVectorOrigin, | ||
| Kratos::unique_ptr<typename MappingSparseSpaceType::VectorType>& rpInterfaceVectorDestination, | ||
| const ModelPart& rModelPartOrigin, | ||
| const ModelPart& rModelPartDestination, | ||
| std::vector<Kratos::unique_ptr<MapperLocalSystem>>& rMapperLocalSystems, | ||
| const IndexType NumberOfPolynomialTerms, | ||
| const bool BuildOriginInterpolationMatrix, | ||
| const bool OriginIsIga, | ||
| const int EchoLevel) | ||
| { | ||
| KRATOS_TRY | ||
|
|
||
| static_assert(!MappingSparseSpaceType::IsDistributed(), "Using a distributed Space!"); | ||
|
|
||
| const SizeType num_nodes_origin = rModelPartOrigin.NumberOfNodes(); | ||
| const SizeType num_conditions_origin = rModelPartOrigin.NumberOfConditions(); | ||
| const SizeType num_nodes_destination = rModelPartDestination.NumberOfNodes(); | ||
| const SizeType num_conditions_destination = rModelPartDestination.NumberOfConditions(); | ||
|
|
||
| IndexType origin_size; | ||
| IndexType destination_size; | ||
|
|
||
| if (!OriginIsIga){ | ||
| origin_size = num_nodes_origin; | ||
| destination_size = num_nodes_destination; | ||
| } else if (OriginIsIga && BuildOriginInterpolationMatrix) { | ||
| origin_size = num_conditions_origin; | ||
| destination_size = num_conditions_destination; | ||
| } else if (OriginIsIga && !BuildOriginInterpolationMatrix) { | ||
| origin_size = num_conditions_origin; | ||
| destination_size = num_nodes_destination; | ||
| } | ||
|
|
||
| // Initialize the Matrix | ||
| // This has to be done always since the Graph has changed if the Interface is updated! | ||
| if (BuildOriginInterpolationMatrix){ | ||
| ConstructMatrixStructure(rpMappingMatrix, rMapperLocalSystems, | ||
| origin_size + NumberOfPolynomialTerms, destination_size + NumberOfPolynomialTerms); | ||
| } else { | ||
| ConstructMatrixStructure(rpMappingMatrix, rMapperLocalSystems, | ||
| origin_size + NumberOfPolynomialTerms, destination_size); | ||
| } | ||
|
|
||
| BuildMatrix(rpMappingMatrix, rMapperLocalSystems); | ||
|
|
||
| MappingMatrixUtilitiesType::InitializeSystemVector(rpInterfaceVectorOrigin, num_nodes_origin); | ||
| MappingMatrixUtilitiesType::InitializeSystemVector(rpInterfaceVectorDestination, num_nodes_destination); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.