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

SmallDeformation nonlocal #2294

Merged
merged 12 commits into from Dec 19, 2018

Conversation

Projects
None yet
3 participants
@endJunction
Copy link
Member

endJunction commented Dec 11, 2018

Don't worry, most changes are the test cases, the code is around 2kLOC.

Based on Francesco's paper (published, not yet available online) "Experimental characterization and numerical modelling of fracture processes in granite".

Main difference to the SmallDeformation process is the additional, so called non-local integration loop.

@endJunction

This comment has been minimized.

Copy link
Member Author

endJunction commented Dec 11, 2018

@wenqing @TomFischer @renchao-lu Let's meet on Friday at 11 for discussion.

@endJunction endJunction force-pushed the endJunction:SDNonlocal branch 4 times, most recently from 3e82a00 to 282c727 Dec 11, 2018

@endJunction endJunction added please review and removed WIP 🏗 labels Dec 13, 2018

@endJunction endJunction force-pushed the endJunction:SDNonlocal branch from 282c727 to 764c8b8 Dec 13, 2018

@wenqing
Copy link
Member

wenqing left a comment

Looks good except some small stuffs.

@@ -53,6 +53,19 @@ template <int DisplacementDim>
MathLib::KelvinVector::KelvinMatrixType<DisplacementDim> sOdotS(
MathLib::KelvinVector::KelvinVectorType<DisplacementDim> const& v);

template <int DisplacementDim>
MathLib::KelvinVector::KelvinMatrixType<DisplacementDim>
elasticTangentStiffness(double const K, double const G)

This comment has been minimized.

@wenqing

wenqing Dec 17, 2018

Member

There is a similar function in MaterialLib/SolidModels/LinearElasticIsotropic.cpp, and it is called getElasticTensor. It might be good to use the same name.

This comment has been minimized.

@endJunction

endJunction Dec 18, 2018

Author Member

Good point. I chose the version with the first Lame parameter instead of the bulk modulus.

config.getConfigParameter<double>("internal_length");

SmallDeformationNonlocalProcessData<DisplacementDim> process_data{
materialIDs(mesh), std::move(solid_constitutive_relations),

This comment has been minimized.

@wenqing

wenqing Dec 17, 2018

Member

Is this line formatted by using clang-format?

This comment has been minimized.

@endJunction

endJunction Dec 18, 2018

Author Member

Yes. Table alignment.

{
double const damage = (1 - beta_d) * (1 - std::exp(-kappa_d / alpha_d));

if (damage < 0. || damage > 1.)

This comment has been minimized.

@wenqing

wenqing Dec 17, 2018

Member

Is it necessary that let damage = damage < 0. ? 0 : damage and damage = damage > 1. ? 1 : damage?

This comment has been minimized.

@endJunction

endJunction Dec 18, 2018

Author Member

Put an assert there and check for half open interval [0, 1).

// Compute sigma_eff from damage total stress sigma
using KelvinVectorType = typename BMatricesType::KelvinVectorType;
KelvinVectorType const sigma_eff_prev =
sigma_prev / (1. - damage_prev);

This comment has been minimized.

@wenqing

wenqing Dec 17, 2018

Member

Is there a possibility that damage_prev = 1.0?

This comment has been minimized.

@endJunction

endJunction Dec 18, 2018

Author Member

Damage can not be 1, see calculateDamage(). Comment added.

@endJunction endJunction force-pushed the endJunction:SDNonlocal branch from 764c8b8 to 555b759 Dec 18, 2018

@@ -18,7 +18,7 @@ double Invariants<KelvinVectorSize>::equivalentStress(
Eigen::Matrix<double, KelvinVectorSize, 1> const& deviatoric_v)
{
assert(std::abs(trace(deviatoric_v)) <=
5e-14 * diagonal(deviatoric_v).norm());
2e-13 * diagonal(deviatoric_v).norm());

This comment has been minimized.

@TomFischer

TomFischer Dec 18, 2018

Member

How did you find these magic number?

This comment has been minimized.

@endJunction

endJunction Dec 18, 2018

Author Member

reduce it until it works ;)

{//! \ogs_file_param_special{prj__processes__process__SMALL_DEFORMATION_NONLOCAL__process_variables__process_variable}
"process_variable"});

DBUG("Associate displacement with process variable \'%s\'.",

This comment has been minimized.

@TomFischer

TomFischer Dec 18, 2018

Member

Why is the symbol ' escaped?

This comment has been minimized.

@endJunction

endJunction Dec 18, 2018

Author Member

Just to be on the safe side ;)
Removing.

if (damage < 0. || damage >= 1.)
{
ERR("Damage value %g outside of [0,1) interval.", damage);
assert(false && "damage not in [0,1) interval.");

This comment has been minimized.

@TomFischer

TomFischer Dec 18, 2018

Member

Why not OGS_FATAL?

typename BMatricesType::KelvinVectorType eps, eps_prev;
double free_energy_density = 0;
double damage = 0; ///< isotropic damage
double damage_prev = 0; ///< \copydoc damage

This comment has been minimized.

@TomFischer

TomFischer Dec 18, 2018

Member

Is the '\copydoc' intended?

This comment has been minimized.

@endJunction

endJunction Dec 18, 2018

Author Member

yes.

NumLib::LocalToGlobalIndexMap const& /*dof_table*/,
std::vector<double>& cache) const = 0;

// TODO move to NumLib::ExtrapolatableElement

This comment has been minimized.

@TomFischer

TomFischer Dec 18, 2018

Member

Is this TODO easy to fulfil?

This comment has been minimized.

@endJunction

endJunction Dec 18, 2018

Author Member

No. Is related to output and the TODO is in all processes.

{
namespace SmallDeformationNonlocal
{
/// Used by for extrapolation of the integration point values. It is ordered

This comment has been minimized.

@TomFischer

TomFischer Dec 18, 2018

Member

Either 'by' or 'for'.

This comment has been minimized.

@endJunction

endJunction Dec 18, 2018

Author Member

Fixing.

if (ehlers_solid_material == nullptr)
{
OGS_FATAL(
"The SmallDeformationNonlocalLocal supports only Ehlers "

This comment has been minimized.

@TomFischer

TomFischer Dec 18, 2018

Member

IMHO the word 'process' is missing.

This comment has been minimized.

@endJunction

endJunction Dec 18, 2018

Author Member

Fixing.

_element.getID());
}

if (name == "sigma_ip")

This comment has been minimized.

@TomFischer

TomFischer Dec 18, 2018

Member

This string comparison is done for every integration point. Is this computational expensive? Would an enum an option?

This comment has been minimized.

@endJunction

endJunction Dec 18, 2018

Author Member

Enum is not an option because each process might call this differently. The function call (and so the comparison) happens once for each element when setting initial conditions.

@endJunction endJunction force-pushed the endJunction:SDNonlocal branch from 555b759 to edc7f83 Dec 18, 2018

BMatricesType, ShapeMatricesType, DisplacementDim>>>
_ip_data;

IntegrationMethod _integration_method;

This comment has been minimized.

@TomFischer

TomFischer Dec 19, 2018

Member

Why not const?

This comment has been minimized.

@endJunction

endJunction Dec 19, 2018

Author Member

fixed.

private:
int const _integration_order;
std::function<std::vector<std::vector<double>>()> _callback;
};

This comment has been minimized.

@TomFischer

TomFischer Dec 19, 2018

Member

Please move the writer to separate files.

This comment has been minimized.

@endJunction

endJunction Dec 19, 2018

Author Member

Moved into single separate file.

endJunction added some commits Dec 11, 2018

[T] Relax tolerances for sigma.
These tests are failing on testing machines.
[MatL] Solids; Extract elasticTangentStiffness().
Same function is used in Ehlers and in the LinearElasticIsotropic.

@endJunction endJunction force-pushed the endJunction:SDNonlocal branch from edc7f83 to ec1e0bd Dec 19, 2018

@endJunction

This comment has been minimized.

Copy link
Member Author

endJunction commented Dec 19, 2018

@fparisio Once the paper is published we need to add the corresponding test descriptions to the web benchmark documentation page.

@endJunction endJunction merged commit 0fba06a into ufz:master Dec 19, 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

@endJunction endJunction deleted the endJunction:SDNonlocal branch Dec 19, 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.