-
Notifications
You must be signed in to change notification settings - Fork 250
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
[SBM-IGA] Adding snake_sbm_utilities and test #13095
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: Nicolò Antonelli <[email protected]>
-- Not ready -- |
@rubenzorrilla |
// Main authors: Nicolo' Antonelli | ||
// Main authors: Andrea Gorgi |
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.
// Main authors: Nicolo' Antonelli | |
// Main authors: Andrea Gorgi | |
// Main authors: Nicolo' Antonelli | |
// Andrea Gorgi |
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.
Amend the formatting issues as it is a bit annoying to go through it right now. Please take the observations I did so far into account while doing so. I'll do a follow up review once you fixed these.
On top of this, the API seems a bit complicated to me. Most probably this is what it is as we are creating a static
utility. To confirm that doing it static
is the way to go, can you please describe where is this intended to be called (I guess that in some sort of modeler).
SnakeSbmUtilities::CreateTheSnakeCoordinates(iga_model_part, skin_model_part_inner_initial, skin_model_part_outer_initial, skin_model_part, 0, | ||
unique_knot_vector_u, unique_knot_vector_v, mParameters) ; | ||
|
||
const double tolerance = 1.0e-6; |
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'd put this a bit more strict.
SnakeSbmUtilities::CreateTheSnakeCoordinates(iga_model_part, skin_model_part_inner_initial, skin_model_part_outer_initial, skin_model_part, 0, | ||
unique_knot_vector_u, unique_knot_vector_v, mParameters) ; | ||
|
||
const double tolerance = 1.0e-6; |
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'd put this a bit more strict.
SnakeSbmUtilities::CreateTheSnakeCoordinates(iga_model_part, skin_model_part_inner_initial, skin_model_part_outer_initial, skin_model_part, 0, | ||
unique_knot_vector_u, unique_knot_vector_v, mParameters) ; | ||
|
||
const double tolerance = 1.0e-6; |
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'd put this a bit more strict.
void SnakeSbmUtilities::CreateTheSnakeCoordinates(ModelPart& rIgaModelPart, | ||
ModelPart& rSkinModelPartInnerInitial, | ||
ModelPart& rSkinModelPartOuterInitial, | ||
ModelPart& rSkinModelPart, | ||
int rEchoLevel, | ||
Vector& knotVectorU, | ||
Vector& knotVectorV, | ||
const Parameters mParameters) { |
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.
void SnakeSbmUtilities::CreateTheSnakeCoordinates(ModelPart& rIgaModelPart, | |
ModelPart& rSkinModelPartInnerInitial, | |
ModelPart& rSkinModelPartOuterInitial, | |
ModelPart& rSkinModelPart, | |
int rEchoLevel, | |
Vector& knotVectorU, | |
Vector& knotVectorV, | |
const Parameters mParameters) { | |
void SnakeSbmUtilities::CreateTheSnakeCoordinates( | |
ModelPart& rIgaModelPart, | |
ModelPart& rSkinModelPartInnerInitial, | |
ModelPart& rSkinModelPartOuterInitial, | |
ModelPart& rSkinModelPart, | |
int rEchoLevel, | |
Vector& knotVectorU, | |
Vector& knotVectorV, | |
const Parameters mParameters) | |
{ |
Please follow our standard. Do so for the rest of methods.
ModelPart& rSkinModelPartInnerInitial, | ||
ModelPart& rSkinModelPartOuterInitial, | ||
ModelPart& rSkinModelPart, | ||
int rEchoLevel, |
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.
Why passing the echo level by argument if you are providing a parameters?
Vector startingPositionUV); | ||
|
||
private: | ||
///@name IGA functionalities |
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.
///@name IGA functionalities | |
///@name IGA functionalities |
Stick to the fields we normally have to keep a consistent Doxygen compilation across Kratos.
using DistanceVector = std::vector<double>; | ||
using DistanceIterator = std::vector<double>::iterator; | ||
using DynamicBins = BinsDynamic<3, PointType, PointVector, PointTypePointer, PointIterator, DistanceIterator>; | ||
using PointerType = DynamicBins::PointerType; |
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.
using PointerType = DynamicBins::PointerType; | |
using DynamicBinsPointerType = DynamicBins::PointerType; |
PointerType is meaningless when browsing the code.
double x_true_boundary0 = initial_condition.GetGeometry()[0].X(); | ||
double y_true_boundary0 = initial_condition.GetGeometry()[0].Y(); |
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.
double x_true_boundary0 = initial_condition.GetGeometry()[0].X(); | |
double y_true_boundary0 = initial_condition.GetGeometry()[0].Y(); | |
const double x_true_boundary0 = initial_condition.GetGeometry()[0].X(); | |
const double y_true_boundary0 = initial_condition.GetGeometry()[0].Y(); |
if (isInner && | ||
(knot_span_uv[0][0] < 0 || knot_span_uv[0][0] >= n_knot_spans_uv[0] || | ||
knot_span_uv[1][0] < 0 || knot_span_uv[1][0] >= n_knot_spans_uv[1] || | ||
knot_span_uv[0][1] < 0 || knot_span_uv[0][1] >= n_knot_spans_uv[0] || | ||
knot_span_uv[1][1] < 0 || knot_span_uv[1][1] >= n_knot_spans_uv[1]) ) |
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.
Please do this check in a separate function namely IsInside
if (isInner) | ||
if (mParameters["sbm_parameters"].Has("lambda_inner")) | ||
lambda = mParameters["sbm_parameters"]["lambda_inner"].GetDouble(); | ||
else | ||
lambda = 0.5; | ||
else | ||
if (mParameters["sbm_parameters"].Has("lambda_outer")) | ||
lambda = mParameters["sbm_parameters"]["lambda_outer"].GetDouble(); | ||
else | ||
lambda = 0.5; |
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'd move this to a separate GetLambdaFunction
.
📝 Description
We have added a utility that enables the calculation of the surrogate model part. This utility will be used in the nurbs_sbm_modeler in one of the upcoming PRs.
It computes the surrogate nodes based on the skin boundaries, which can be either inner (one or more) or outer (only one), depending on the specifications in the ProjectParameters.