Skip to content

Conversation

@juancamarotti
Copy link
Contributor

@juancamarotti juancamarotti commented Nov 19, 2025

This PR extends the MappingApplication to support Radial Basis Function (RBF) mapping, enabling flexible, mesh-independent transfer of scalar and vector fields between non-matching geometries.

Overview

  • Introduces an RBFMapper for scalar and vector field transfer across arbitrary point sets
  • Supports multiple RBF kernels (Gaussian, multiquadric, inverse multiquadric, thin-plate spline) with optional polynomial augmentation.
  • Implements bi-directional mapping using consistent interpolation matrices. (Note: Consistent mapping is supported from IBRA → FEM domains or between FEM domains.)
  • Fully integrated with the CoSimulationApplication for FSI and other multi-physics couplings.
  • Supports conservative mapping, ensuring energy and load consistency.

Implementation Notes

  • The mapper allows selecting N closest support points to build each local interpolation system.
"search_settings" : {
      "use_all_rbf_support_points": false, 
      "required_rbf_support_points": 10,
      "max_num_search_iterations"     : 10
 }
  • Precomputing the mapping matrix is available through precompute_mapping_matrix and recommended for repeated coupling steps and mandatory for IGA setups.
  • The algorithm includes a local-search termination criterion to avoid redundant InterfaceInfo creation (at the end we only have just one InterfaceInfo per LocalSystem). Each InterfaceInfo has a RBFSupportAccumulator which is the data structure in charge of accumulating the support points for each local system

Tests

  • Validated with analytical scalar and vector mapping benchmarks.
  • Verified on FSI benchmarks, including FSI Mok and FSI Turek, demonstrating accuracy and robustness.

Multivariate interpolation for fluid-structure-interaction problems using RBF.pdf

FYI @matekelemen @sunethwarna

…into mapping/rbf_mapper_proper_implementation
@juancamarotti
Copy link
Contributor Author

FYI @philbucher

Copy link
Member

@philbucher philbucher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great work, I think conceptually its very good

I had mostly implementation detail questions and remarks

"echo_level" : 0
"echo_level" : 0,
"required_rbf_support_points" : 0,
"use_all_rbf_support_points": true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not define "max_support_points`?

Also, this should be settings of the RBF local system and interface info, its not even used here

rModelPartCommunicator.SynchronizeNonHistoricalVariable(INTERFACE_EQUATION_ID);
}

void AssignInterfaceEquationIdsOnConditions(Communicator& rModelPartCommunicator)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally you would generalize the function that works on nodes, maybe by passing a range, or iterator start and end

/**
* @brief Assigning INTERFACE_EQUATION_IDs to the conditions, with and without MPI
* This function assigns the INTERFACE_EQUATION_IDs to the conditions, which
* act as EquationIds for the MappingMatrix in the case of IGA. This work with and without MPI,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* act as EquationIds for the MappingMatrix in the case of IGA. This work with and without MPI,
* act as EquationIds for the MappingMatrix. This work with and without MPI,

* act as EquationIds for the MappingMatrix in the case of IGA. This work with and without MPI,
* in MPI a ScanSum is performed with the local number of nodes
* @param rModelPartCommunicator The Modelpart-Communicator to be used
* @author Juan I. Camarotti
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @author Juan I. Camarotti

we dont do fct based authorship => thats what we have git for

there are also authorship rules in the wiki somewhere

* @brief Assigning INTERFACE_EQUATION_IDs to the conditions, with and without MPI
* This function assigns the INTERFACE_EQUATION_IDs to the conditions, which
* act as EquationIds for the MappingMatrix in the case of IGA. This work with and without MPI,
* in MPI a ScanSum is performed with the local number of nodes
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrong comment

Comment on lines +303 to +304
mRBFTypeString(RBFType),
mRBFTypeEnum(ParseRBFType(RBFType)),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whats the difference? Why isnt the enum enough?

{
// backward compatibility
if (mMapperSettings.Has("search_radius")) {
KRATOS_WARNING("Mapper") << "DEPRECATION-WARNING: \"search_radius\" should be specified under \"search_settings\"!" << std::endl;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please dont introduce deprecated stuff in new code

}

if (mMapperSettings.Has("search_iterations")) {
KRATOS_WARNING("Mapper") << "DEPRECATION-WARNING: \"search_iterations\" should be specified as \"max_num_search_iterations\" under \"search_settings\"!" << std::endl;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

Comment on lines +366 to +370
void AddInterfaceInfo(MapperInterfaceInfoPointerType pInterfaceInfo) override
{
mInterfaceInfos.clear();
mInterfaceInfos.push_back(pInterfaceInfo);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please explain why you override?

* @brief Returning the results of the neighbour search for the RBF mapper
* @author Juan I. Camarotti
*/
virtual const RBFSupportAccumulator& GetRBFSupportAccumulator() const
Copy link
Member

Choose a reason for hiding this comment

The 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 static_cast, see here:

const BarycentricInterfaceInfo& r_info = static_cast<const BarycentricInterfaceInfo&>(*mInterfaceInfos[i]);

Its not the greatest solution either, but I think in this case its cleaner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants