Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
feat: averaging of stress components using quadrature #3279
base: develop
Are you sure you want to change the base?
feat: averaging of stress components using quadrature #3279
Changes from 4 commits
0efc086
a0c39c2
5425ce4
593c275
d377570
1c3ea13
2dcfde5
2136523
60afaaf
6a5f2a7
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Check warning on line 94 in src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsFields.hpp
Codecov / codecov/patch
src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsFields.hpp#L94
Check warning on line 162 in src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp
Codecov / codecov/patch
src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp#L162
Check warning on line 948 in src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp
Codecov / codecov/patch
src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp#L948
Check warning on line 951 in src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp
Codecov / codecov/patch
src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp#L951
Check warning on line 968 in src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp
Codecov / codecov/patch
src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp#L966-L968
Check warning on line 972 in src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp
Codecov / codecov/patch
src/coreComponents/physicsSolvers/solidMechanics/SolidMechanicsLagrangianFEM.cpp#L971-L972
Check warning on line 251 in src/coreComponents/physicsSolvers/solidMechanics/kernels/StrainHelper.hpp
Codecov / codecov/patch
src/coreComponents/physicsSolvers/solidMechanics/kernels/StrainHelper.hpp#L251
Check warning on line 265 in src/coreComponents/physicsSolvers/solidMechanics/kernels/StrainHelper.hpp
Codecov / codecov/patch
src/coreComponents/physicsSolvers/solidMechanics/kernels/StrainHelper.hpp#L263-L265
Check warning on line 279 in src/coreComponents/physicsSolvers/solidMechanics/kernels/StrainHelper.hpp
Codecov / codecov/patch
src/coreComponents/physicsSolvers/solidMechanics/kernels/StrainHelper.hpp#L279
Check warning on line 282 in src/coreComponents/physicsSolvers/solidMechanics/kernels/StrainHelper.hpp
Codecov / codecov/patch
src/coreComponents/physicsSolvers/solidMechanics/kernels/StrainHelper.hpp#L282
Check warning on line 284 in src/coreComponents/physicsSolvers/solidMechanics/kernels/StrainHelper.hpp
Codecov / codecov/patch
src/coreComponents/physicsSolvers/solidMechanics/kernels/StrainHelper.hpp#L284
Check warning on line 286 in src/coreComponents/physicsSolvers/solidMechanics/kernels/StrainHelper.hpp
Codecov / codecov/patch
src/coreComponents/physicsSolvers/solidMechanics/kernels/StrainHelper.hpp#L286
Check warning on line 297 in src/coreComponents/physicsSolvers/solidMechanics/kernels/StrainHelper.hpp
Codecov / codecov/patch
src/coreComponents/physicsSolvers/solidMechanics/kernels/StrainHelper.hpp#L297
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.
This file contains two functions
quadraturePointKernel
once for the strain and one for the stress. In my opinion only one function should exist to perform the averaging of a second order symmetric stress tensor -- and probably of any scalar (rank 0), vector (rank 1), ... . The classAverageOverQuadraturePointsBase
should be responsible for this task, and the quantity to be averaged should either provided directly or with a lambda function that evaluates such property.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.
we could generalize it and come up with a single kernel. We could try to make it accept a list of views instead of a specific one. It would also mean that we do all averaging in a single kernel launch which it is indeed better. We could use something similar to the
elementViewAccessors
and create anarray1d
of all scalars, one for all vectors and one for all tensors to be averaged and have theaveragingKernel
only ask for the keys of the fields that need to be averaged.The strain probably remains a bit of a special case though and i don't know that we do any averaging for other quantities.
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.
In the long term, such computations should be managed by a numerical quadrature library (i.e. --> Shiva)
Check warning on line 304 in src/coreComponents/physicsSolvers/solidMechanics/kernels/StrainHelper.hpp
Codecov / codecov/patch
src/coreComponents/physicsSolvers/solidMechanics/kernels/StrainHelper.hpp#L304
Check warning on line 306 in src/coreComponents/physicsSolvers/solidMechanics/kernels/StrainHelper.hpp
Codecov / codecov/patch
src/coreComponents/physicsSolvers/solidMechanics/kernels/StrainHelper.hpp#L306
Check warning on line 308 in src/coreComponents/physicsSolvers/solidMechanics/kernels/StrainHelper.hpp
Codecov / codecov/patch
src/coreComponents/physicsSolvers/solidMechanics/kernels/StrainHelper.hpp#L308
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.
Here we divide by the cell element volume (
m_elementVolume[k]
) to compute the increment to the average value. InAverageOverQuadraturePointsBase
the cell element contribution is directly included in the weight definition. Both correct, but it would be nice to be consistentThere 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.
IMO we should divide only once at the end.
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.
Generally speaking, I would argue that
m_elementVolume[k]
should not even be required and computed directly in the quadrature process. For this specific case:Check warning on line 322 in src/coreComponents/physicsSolvers/solidMechanics/kernels/StrainHelper.hpp
Codecov / codecov/patch
src/coreComponents/physicsSolvers/solidMechanics/kernels/StrainHelper.hpp#L322
Check warning on line 326 in src/coreComponents/physicsSolvers/solidMechanics/kernels/StrainHelper.hpp
Codecov / codecov/patch
src/coreComponents/physicsSolvers/solidMechanics/kernels/StrainHelper.hpp#L325-L326
Check warning on line 328 in src/coreComponents/physicsSolvers/solidMechanics/kernels/StrainHelper.hpp
Codecov / codecov/patch
src/coreComponents/physicsSolvers/solidMechanics/kernels/StrainHelper.hpp#L328
Check warning on line 331 in src/coreComponents/physicsSolvers/solidMechanics/kernels/StrainHelper.hpp
Codecov / codecov/patch
src/coreComponents/physicsSolvers/solidMechanics/kernels/StrainHelper.hpp#L330-L331
Check warning on line 333 in src/coreComponents/physicsSolvers/solidMechanics/kernels/StrainHelper.hpp
Codecov / codecov/patch
src/coreComponents/physicsSolvers/solidMechanics/kernels/StrainHelper.hpp#L333
Check warning on line 375 in src/coreComponents/physicsSolvers/solidMechanics/kernels/StrainHelper.hpp
Codecov / codecov/patch
src/coreComponents/physicsSolvers/solidMechanics/kernels/StrainHelper.hpp#L375
Check warning on line 384 in src/coreComponents/physicsSolvers/solidMechanics/kernels/StrainHelper.hpp
Codecov / codecov/patch
src/coreComponents/physicsSolvers/solidMechanics/kernels/StrainHelper.hpp#L384
Check warning on line 388 in src/coreComponents/physicsSolvers/solidMechanics/kernels/StrainHelper.hpp
Codecov / codecov/patch
src/coreComponents/physicsSolvers/solidMechanics/kernels/StrainHelper.hpp#L388