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

[SMApp] Minor hotfixes in the Base solid element #13015

Merged
merged 3 commits into from
Jan 17, 2025
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,7 @@ void BaseSolidElement::CalculateOnIntegrationPoints(

if ( rOutput.size() != number_of_integration_points )
rOutput.resize( number_of_integration_points, false );
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
rOutput.resize( number_of_integration_points, false );
rOutput.resize( number_of_integration_points);

Or 0.0 or simply remove it if we do assign later

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, the assing not only puts values but also resizes. I remove the resize

rOutput.assign(number_of_integration_points, 0.0);
Copy link
Member

Choose a reason for hiding this comment

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

?, when you do resize does not assign the value you give?

Copy link
Member

Choose a reason for hiding this comment

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

Otherwise maybe remove the false

Copy link
Member Author

Choose a reason for hiding this comment

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

apparently not. Currently you get random numbers in the posts

Copy link
Member

Choose a reason for hiding this comment

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

Okay I just checked, the resize only assigns value to the new elements

Copy link
Member Author

Choose a reason for hiding this comment

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

Just for you to have an example. If I have 2 materials (elastic and damage) and I want to print DAMAGE, the elastic zone plots random values :S

Copy link
Member

Choose a reason for hiding this comment

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

I would remove the false is misleading

Copy link
Member

Choose a reason for hiding this comment

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

Just noting that false is to say that previous values are not kept when resizing but doesn't call the initializer of the stored type.


if (mConstitutiveLawVector[0]->Has( rVariable)) {
GetValueOnConstitutiveLaw(rVariable, rOutput);
Expand Down Expand Up @@ -827,7 +828,7 @@ void BaseSolidElement::CalculateOnIntegrationPoints(
detJ = r_geometry.DeterminantOfJacobian(detJ);
} else {
for (IndexType point_number = 0; point_number < number_of_integration_points; ++point_number) {
detJ[point_number] = r_geometry.DeterminantOfJacobian(integration_points[point_number]);
detJ[point_number] = r_geometry.DeterminantOfJacobian(integration_points[point_number]);
}
}

Expand Down Expand Up @@ -937,6 +938,7 @@ void BaseSolidElement::CalculateOnIntegrationPoints(
const SizeType number_of_integration_points = integration_points.size();
if ( rOutput.size() != number_of_integration_points )
rOutput.resize( number_of_integration_points );
rOutput.assign(number_of_integration_points, array_1d<double, 3>(3, 0.0));

const auto& r_geom = GetGeometry();
const SizeType number_of_nodes = r_geom.size();
Expand Down Expand Up @@ -986,6 +988,7 @@ void BaseSolidElement::CalculateOnIntegrationPoints(
const SizeType number_of_integration_points = integration_points.size();
if (rOutput.size() != number_of_integration_points)
rOutput.resize(number_of_integration_points);
rOutput.assign(number_of_integration_points, array_1d<double, 6>(6, 0.0));

if (mConstitutiveLawVector[0]->Has( rVariable)) {
GetValueOnConstitutiveLaw(rVariable, rOutput);
Expand All @@ -1012,6 +1015,7 @@ void BaseSolidElement::CalculateOnIntegrationPoints(
const SizeType number_of_integration_points = integration_points.size();
if ( rOutput.size() != number_of_integration_points )
rOutput.resize( number_of_integration_points );
rOutput.assign(number_of_integration_points, ZeroVector(strain_size));

if (mConstitutiveLawVector[0]->Has( rVariable)) {
GetValueOnConstitutiveLaw(rVariable, rOutput);
Expand Down
Loading