-
Notifications
You must be signed in to change notification settings - Fork 273
Extend InterfaceVectorContainer to Support Mapping between Elements, Conditions, and Geometries #14001
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?
Extend InterfaceVectorContainer to Support Mapping between Elements, Conditions, and Geometries #14001
Conversation
…also elements, conditions and geometries
sunethwarna
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @juancamarotti . Minor comments only. But I have some curiosity questions:
- Why did you go with the
switchstatements rather than making the baseInterfaceVectorContainerand having derrived versions doing different things with different containers? - Did you test this in MPI?
| if (!rModelPart.GetCommunicator().GetDataCommunicator().IsDefinedOnThisRank()) | ||
| return; | ||
|
|
||
| const auto& r_local_mesh = rModelPart.GetCommunicator().LocalMesh(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is nice that you are working on a LocalMesh, but I am curious, when do you do the synchronization to update the values on the GhostNodes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it happens after mapping, but please double check
| { | ||
| constexpr bool in_parallel = false; // accessing the trilinos vectors is not threadsafe in the default configuration! | ||
| MapperUtilities::UpdateSystemVectorFromModelPart((*mpInterfaceVector)[0], mrModelPart, rVariable, rMappingOptions, in_parallel); | ||
| constexpr bool in_parallel = false; // accessing the Trilinos vectors is not threadsafe in the default configuration! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought this is fixed now... hmm...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it is, can you please add a link to the docs?
philbucher
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, minor comment
|
|
||
| IndexPartition<std::size_t>(n_entities, num_threads).for_each([&](const std::size_t i){ | ||
| const EntityType& r_entity = *(it_begin + i); | ||
| const double value = r_entity.GetValue(rVariable); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if running in parallel, use `SetValue
| if (!rModelPart.GetCommunicator().GetDataCommunicator().IsDefinedOnThisRank()) | ||
| return; | ||
|
|
||
| const auto& r_local_mesh = rModelPart.GetCommunicator().LocalMesh(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it happens after mapping, but please double check
| { | ||
| constexpr bool in_parallel = false; // accessing the trilinos vectors is not threadsafe in the default configuration! | ||
| MapperUtilities::UpdateSystemVectorFromModelPart((*mpInterfaceVector)[0], mrModelPart, rVariable, rMappingOptions, in_parallel); | ||
| constexpr bool in_parallel = false; // accessing the Trilinos vectors is not threadsafe in the default configuration! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it is, can you please add a link to the docs?
This PR extends the
InterfaceVectorContainerand the corresponding mapping utilities so that an interface vector can now be built not only fromNodes, but also from:ElementsConditionsGeometriesThe container now holds an
InterfaceEntityTypeenum, and the mapping operations automatically select the correct update routines based on the underlying entity type.This enables future development of interface-based mappings that operate on arbitrary ModelPart entities (elements, conditions or geometries) in a unified way.
FYI @matekelemen @philbucher
This PR is related to the following Discussion #13927