-
Notifications
You must be signed in to change notification settings - Fork 239
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
Added an element test as a LIE cohesive zone benchmark #2157
Conversation
e0c3025
to
65db158
Compare
65db158
to
b572c2d
Compare
Based upon the request, postTimestepConcreteProcess is replaced with computeSecondaryVariableConcrete in LIE/SmallDeformation. |
Few more small things:
|
@@ -89,10 +89,14 @@ AddTest( | |||
TESTER vtkdiff | |||
REQUIREMENTS NOT OGS_USE_MPI | |||
DIFF_DATA | |||
GLOB cohesive_zone_load_path_pcs_0_ts_*.vtu displacement displacement 1e-16 0 |
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.
- Put back the comparison of displacement, displacement_jump1, and sigma_*.
- Use GLOB pattern, instead of writing out each time step.
- The tolerances for the stress_n are rather loose; how come?
- f_stress_n_analytical
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.
The GLOB pattern sounds like making the file comparison with an identical file name in the different folders. I am not sure.
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.
Yes, it does compare the files from the source folder (expected output) to the build folder (ctest output) and the files are named identically. Simply do as for displacement etc.
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.
The expected output contains the analytical solution 'f_stress_n_analytical' which is not included in the ctest output though... Can we make a comparison against the analytical solution at some selected rather than all the instants?
auto mesh_prop_w_n = MeshLib::getOrCreateMeshProperty<double>( | ||
const_cast<MeshLib::Mesh&>(mesh), "w_n", | ||
MeshLib::MeshItemType::Cell, 1); | ||
mesh_prop_w_n->resize(mesh.getNumberOfElements()); |
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.
The resize is not necessary. It's already done in the MeshLib::getOrCreateMeshProperty...
MeshLib::PropertyVector<double>* _mesh_prop_w_n = nullptr; | ||
MeshLib::PropertyVector<double>* _mesh_prop_w_s = nullptr; | ||
MeshLib::PropertyVector<double>* _mesh_prop_fracture_stress_shear = nullptr; | ||
MeshLib::PropertyVector<double>* _mesh_prop_fracture_stress_normal = nullptr; |
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 try to use either _n
and _s
or _normal
and _shear
, but not to mix the both.
Checklist
|
1f436db
to
175a9af
Compare
175a9af
to
f645f3e
Compare
f645f3e
to
efe2297
Compare
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.
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.
Looks good.
{ | ||
if (!_dofIndex_to_localIndex.empty()) | ||
{ | ||
auto const local_dof_size = local_x_.size(); |
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.
You can directly use local_x_.size() in the following for loop.
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.
Replaced accordingly.
auto const local_dof_size = local_x_.size(); | ||
|
||
_local_u.setZero(); | ||
for (unsigned i = 0; i < local_dof_size; i++) |
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.
Change unsigned to std::size_t.
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.
Changed accordingly.
efe2297
to
520e039
Compare
@@ -45,6 +44,9 @@ class SmallDeformationProcess final : public Process | |||
bool isLinear() const override; | |||
//! @} | |||
|
|||
void computeSecondaryVariableConcrete(double const t, |
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.
Sorry for the late comment. AFAIK computeSecondaryVariableConcrete()
is called after every single iteration.
In contrast postTimestepConcreteProcess()
is called only after each timestep, so probably much less often. You seem to use the secondary variables only for output. Wouldn't postTimestepConcreteProcess()
therefore suffice?
The only corner case that I am aware of is the output of iteration results. Or am I missing something?
For later developments, of course a preOutput()
method would be a good option.
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 thought it would be the other way around, but it looks like the compute secondary vars is called just after postTimestep UncoupledTimeLoop.cpp.
I agree with the need for preOutput(). --> another PR.
I'd suggest to keep this implementation for now.
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.
Yep, implementation can be kept. Then I was wrong. Maybe then in the future the two methods can be combined.
520e039
to
5e5263a
Compare
@renchao-lu I've seen you want to add a python-script to the tests/data, that's great! Just add it when you are ready as another PR. |
OpenGeoSys development has been moved to GitLab. |
This pull request is motivated to enrich secondary variables in the LIE/SmallDeformation as in the LIE/HydroMechanics, and add an element test for LIE cohesive zone model. The extended secondary variables consist of a fracture opening vector (w_n and w_s) and a fracture stress vector (f_stress_normal and f_stress_shear). With these output variables, it becomes more straightforward to make a comparison against the analytical solution in the element test.