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

Added an element test as a LIE cohesive zone benchmark #2157

Merged
merged 3 commits into from Aug 5, 2018

Conversation

Projects
None yet
4 participants
@renchao-lu
Copy link
Member

renchao-lu commented Jul 3, 2018

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.

@renchao-lu renchao-lu force-pushed the renchao-lu:LIECohesiveZone_Benchmark branch 5 times, most recently from e0c3025 to 65db158 Jul 6, 2018

@renchao-lu renchao-lu force-pushed the renchao-lu:LIECohesiveZone_Benchmark branch from 65db158 to b572c2d Jul 13, 2018

@renchao-lu

This comment has been minimized.

Copy link
Member Author

renchao-lu commented Jul 13, 2018

Based upon the request, postTimestepConcreteProcess is replaced with computeSecondaryVariableConcrete in LIE/SmallDeformation.

@endJunction

This comment has been minimized.

Copy link
Member

endJunction commented Jul 13, 2018

Few more small things:

  • remove the executable flag from test files, e.g. Tests/Data/LIE/Mechanics/cohesive_zone_load_path.gml (chmod a-x Tests/Data/LIE/Mechanics/cohesive_zone_load_path.gml)
  • remove the pvd file from tests
@@ -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

This comment has been minimized.

@endJunction

endJunction Jul 13, 2018

Member
  • 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

This comment has been minimized.

@renchao-lu

renchao-lu Jul 14, 2018

Author Member

The GLOB pattern sounds like making the file comparison with an identical file name in the different folders. I am not sure.

This comment has been minimized.

@endJunction

endJunction Jul 14, 2018

Member

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.

This comment has been minimized.

@renchao-lu

renchao-lu Jul 14, 2018

Author Member

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());

This comment has been minimized.

@endJunction

endJunction Jul 13, 2018

Member

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;

This comment has been minimized.

@endJunction

endJunction Jul 13, 2018

Member

I'd try to use either _n and _s or _normal and _shear, but not to mix the both.

@renchao-lu

This comment has been minimized.

Copy link
Member Author

renchao-lu commented Jul 14, 2018

Checklist

  • Remove the executable flag from test files, e.g. Tests/Data/LIE/Mechanics/cohesive_zone_load_path.gml (chmod a-x Tests/Data/LIE/Mechanics/cohesive_zone_load_path.gml) [Done, appreciate it]
  • Remove the pvd file from tests [Done]
  • Put back the comparison of displacement, displacement_jump1, and sigma_*. [Done]
  • Use GLOB pattern, instead of writing out each time step. [Done]
  • The tolerances for the stress_n are rather loose; how come? [Fixed]
    Truncation of the variable 'w_n' causes the loss of accuracy in the previous calculation of analytical solution. Now it is fixed. The relative tolerance is reverted back to 5e-6.
  • f_stress_n_analytical [Done]
  • Clang-format [Learned, Done]
    Removed the particular commit for clang-formatting. Instead, it is done before making a commit.
  • Add a python script for describing how the analytical solution is computed (in Tests/Data/LIE/M) [to do]

@renchao-lu renchao-lu force-pushed the renchao-lu:LIECohesiveZone_Benchmark branch 4 times, most recently from 1f436db to 175a9af Jul 16, 2018

@endJunction endJunction force-pushed the renchao-lu:LIECohesiveZone_Benchmark branch from 175a9af to f645f3e Jul 19, 2018

@renchao-lu renchao-lu force-pushed the renchao-lu:LIECohesiveZone_Benchmark branch from f645f3e to efe2297 Jul 19, 2018

@endJunction
Copy link
Member

endJunction left a comment

Looks good!

I was wondering how you computed the analytical solution; if there is a python script or something please include it here too (in Tests/Data/LIE/M). A description in "Selected Benchmarks" would be nice too.

@fparisio @nagelt You might want to have a look on the results.

@wenqing
Copy link
Member

wenqing left a comment

Looks good.

{
if (!_dofIndex_to_localIndex.empty())
{
auto const local_dof_size = local_x_.size();

This comment has been minimized.

@wenqing

wenqing Jul 20, 2018

Member

You can directly use local_x_.size() in the following for loop.

This comment has been minimized.

@renchao-lu

renchao-lu Jul 23, 2018

Author Member

Replaced accordingly.

auto const local_dof_size = local_x_.size();

_local_u.setZero();
for (unsigned i = 0; i < local_dof_size; i++)

This comment has been minimized.

@wenqing

wenqing Jul 20, 2018

Member

Change unsigned to std::size_t.

This comment has been minimized.

@renchao-lu

renchao-lu Jul 23, 2018

Author Member

Changed accordingly.

@renchao-lu renchao-lu force-pushed the renchao-lu:LIECohesiveZone_Benchmark branch from efe2297 to 520e039 Jul 23, 2018

@@ -45,6 +44,9 @@ class SmallDeformationProcess final : public Process
bool isLinear() const override;
//! @}

void computeSecondaryVariableConcrete(double const t,

This comment has been minimized.

@chleh

chleh Jul 24, 2018

Collaborator

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.

This comment has been minimized.

@endJunction

endJunction Jul 24, 2018

Member

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.

This comment has been minimized.

@chleh

chleh Jul 24, 2018

Collaborator

Yep, implementation can be kept. Then I was wrong. Maybe then in the future the two methods can be combined.

@endJunction endJunction force-pushed the renchao-lu:LIECohesiveZone_Benchmark branch from 520e039 to 5e5263a Aug 5, 2018

@endJunction

This comment has been minimized.

Copy link
Member

endJunction commented Aug 5, 2018

@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.

@endJunction endJunction merged commit 622b10c into ufz:master Aug 5, 2018

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/jenkins/pr-merge This commit looks good
Details
deploy/netlify Deploy preview ready!
Details

@renchao-lu renchao-lu deleted the renchao-lu:LIECohesiveZone_Benchmark branch Dec 20, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.