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

[GeoMechanicsApplication] Initialize all entities (regardless of active/inactive status) in the geo scheme #13152

Merged
merged 9 commits into from
Feb 21, 2025

Conversation

rfaasse
Copy link
Contributor

@rfaasse rfaasse commented Feb 20, 2025

📝 Description
In our workflows which include deactivations + structural elements, we have encountered issues with initialization of inactive elements. This will be fixed in core as well, but until that is done, this temporary fix in the geomechanics time integration scheme is done. Also tests are added (integration + unit), such that we can verify this behavior, also when the fix is done in core and the change in the geomechanics time integration scheme can be reverted.

@rfaasse rfaasse added the GeoMechanics Issues related to the GeoMechanicsApplication label Feb 20, 2025
@rfaasse rfaasse self-assigned this Feb 20, 2025
@rfaasse rfaasse changed the title [GeoMechanicsApplication] Initialize all entities (regardless of active/inactive status) in geo scheme [GeoMechanicsApplication] Initialize all entities (regardless of active/inactive status) in the geo scheme Feb 20, 2025
Copy link
Contributor

@avdg81 avdg81 left a comment

Choose a reason for hiding this comment

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

Yet another step towards being able to simulate the quay wall model using the build from master. Thank you for the clear fix and the well-documented test. I have a few questions and suggestions. Hope this helps.

@@ -53,8 +53,10 @@ class GeoMechanicsSchemeTester
mModel.CreateModelPart("dummy", 2);
}

template <class T>
void TestFunctionCalledOnComponent_IsCalledOnActiveAndInactiveComponents()
template <class T, typename AddComponentToModelPartLambda>
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps we can make this type name slightly more general? For instance:

Suggested change
template <class T, typename AddComponentToModelPartLambda>
template <typename T, typename AddComponentToModelPartCallable>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

}

KRATOS_TEST_CASE_IN_SUITE(FunctionCalledOnElement_IsCalledOnActiveAndInactiveElements, KratosGeoMechanicsFastSuiteWithoutKernel)
KRATOS_TEST_CASE_IN_SUITE(FunctionCalledOnElement_IsCalledOnActiveAndInactiveConditions,
Copy link
Contributor

Choose a reason for hiding this comment

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

"Conditions" should be "Elements":

Suggested change
KRATOS_TEST_CASE_IN_SUITE(FunctionCalledOnElement_IsCalledOnActiveAndInactiveConditions,
KRATOS_TEST_CASE_IN_SUITE(FunctionCalledOnElement_IsCalledOnActiveAndInactiveElements,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Comment on lines 27 to 28
"K0_MAIN_DIRECTION" : 1,
"K0_NC" : 0.5
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe the K0 procedure parameters are redundant here, since we don't apply the K0 procedure.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right, removed 👍

"value": [10000,0.0]
}
}],
"list_other_processes" : []
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can get rid of this empty list.

"value" : [0.0,0.0,0.0],
"table" : [0,0,0]
}
},{
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any reason why in the second stage the horizontal displacements of all nodes are no longer constrained?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The reason is an oversight from my side, corrected it now, good catch!

"reduction_factor" : 0.5,
"increase_factor" : 2.0,
"desired_iterations" : 4,
"calculate_reactions" : true,
Copy link
Contributor

Choose a reason for hiding this comment

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

In stage 1, this flag was set to false, now it is true. Can you help me to understand why?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, I wanted to calculate as little as possible so put it to false in stage 1, but forgot stage 2. Made it more consistent now


file_pattern = os.path.join(project_path, "ProjectParameters_stage*.json")
stage_files = glob.glob(file_pattern)
print(stage_files)
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems to be intended for debugging. I'd suggest to remove it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed

Copy link
Contributor Author

@rfaasse rfaasse left a comment

Choose a reason for hiding this comment

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

Processed the review comments, fixed SQ issues and did some formatting on the python file

Comment on lines 27 to 28
"K0_MAIN_DIRECTION" : 1,
"K0_NC" : 0.5
Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right, removed 👍

"reduction_factor" : 0.5,
"increase_factor" : 2.0,
"desired_iterations" : 4,
"calculate_reactions" : true,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, I wanted to calculate as little as possible so put it to false in stage 1, but forgot stage 2. Made it more consistent now

"value" : [0.0,0.0,0.0],
"table" : [0,0,0]
}
},{
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The reason is an oversight from my side, corrected it now, good catch!


file_pattern = os.path.join(project_path, "ProjectParameters_stage*.json")
stage_files = glob.glob(file_pattern)
print(stage_files)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed

@@ -53,8 +53,10 @@ class GeoMechanicsSchemeTester
mModel.CreateModelPart("dummy", 2);
}

template <class T>
void TestFunctionCalledOnComponent_IsCalledOnActiveAndInactiveComponents()
template <class T, typename AddComponentToModelPartLambda>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Contributor

@markelov208 markelov208 left a comment

Choose a reason for hiding this comment

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

Hi Richard, it looks very good for me.

Copy link
Contributor

@avdg81 avdg81 left a comment

Choose a reason for hiding this comment

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

This looks good to me. Thanks for processing the review comments.

@rfaasse rfaasse merged commit a14ec2f into master Feb 21, 2025
11 checks passed
@rfaasse rfaasse deleted the geo/12868-initialize-all-elements-in-geo-scheme branch February 21, 2025 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GeoMechanics Issues related to the GeoMechanicsApplication
Projects
None yet
3 participants