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

[RomApp] Adding candidate elements (and/or conditions) to HROM #11577

Merged
merged 21 commits into from
Sep 22, 2023

Conversation

Rbravo555
Copy link
Member

@Rbravo555 Rbravo555 commented Sep 19, 2023

📝 Description
This PR will allow to make the element selector algorithm choose from a specific candidate set of elements or conditions. In case choosing the provided candidates the algorithm cannot converge, then the candidate set is expanded to include the rest of the elements and conditions in the computing model part.

It is also possible that by using the provided candidate elements, no solution can be achived that results in all weights positive. In such a case, the algorithm will run again from scratch (ignoring the provided candidates).

🆕 Changelog

  • Added two function to the RomAuxiliaryUtilities to retrieve the ids from elements and conditions in a modelpart
  • Added candidate set to Empirical Cubature Method
  • Modified the HromTraining utility to account for a list of model parts to include as candidates for the ECM
  • Modified the RomManager to account for a list of model parts to include as candidates for the ECM
  • Expanded ECM test

"include_nodal_neighbouring_elements_model_parts_list":[],
"include_minimum_condition": false,
"include_condition_parents": true
"include_condition_parents": false
Copy link
Contributor

Choose a reason for hiding this comment

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

In the worst case, it won't use the info of the parent element. Still, it is generally more likely to fail because we need an associated parent element (e.g. Convection-Diffusion, Fluid-Dynamics, CompressiblePotenital).

Copy link
Contributor

Choose a reason for hiding this comment

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

image

@SADPR
Copy link
Contributor

SADPR commented Sep 21, 2023

Tested (evidence):
ECM without passing the list of candidates (right wall):
No_Candidates

ECM passing the list of candidates (right wall):
Candidates

Copy link
Contributor

@SADPR SADPR left a comment

Choose a reason for hiding this comment

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

LGTM.

@Rbravo555 Rbravo555 merged commit 76c698f into master Sep 22, 2023
11 checks passed
@Rbravo555 Rbravo555 deleted the RomApp_ECM_candidateElements branch September 22, 2023 08:30
Comment on lines +407 to +427
std::vector<IndexType> RomAuxiliaryUtilities::GetElementIdsInModelPart(
const ModelPart& rModelPart)
{
std::vector<IndexType> element_ids;

for (const auto& r_elem : rModelPart.Elements()) {
element_ids.push_back(r_elem.Id());
}
return element_ids;
}

std::vector<IndexType> RomAuxiliaryUtilities::GetConditionIdsInModelPart(
const ModelPart& rModelPart)
{
std::vector<IndexType> condition_ids;

for (const auto& r_cond : rModelPart.Conditions()) {
condition_ids.push_back(r_cond.Id());
}
return condition_ids;
}
Copy link
Member

Choose a reason for hiding this comment

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

Just pointing that these two can be easily done in parallel with an index partition.

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.

6 participants