OGS
LogPenalty.h
Go to the documentation of this file.
1
10#pragma once
11
13
14namespace MaterialLib
15{
16namespace Fracture
17{
23inline double logPenaltyDerivative(double const aperture0,
24 double const aperture,
25 double const aperture_cutoff)
26{
27 if (aperture >= aperture0)
28 {
29 return 1;
30 }
31
32 // Logarithmic penalty
33 if (aperture > aperture_cutoff)
34 {
35 double const penalty = std::log(aperture / aperture0);
36 return 1 + penalty * penalty +
37 2 * penalty / aperture * (aperture - aperture0);
38 }
39
40 // Linear penalty below aperture cutoff
41 {
42 double const penalty = std::log(aperture_cutoff / aperture0);
43 return 1 + penalty * penalty +
44 2 * penalty / aperture_cutoff *
45 (2 * aperture - aperture_cutoff - aperture0);
46 }
47};
48
49inline double logPenalty(double const aperture0,
50 double const aperture,
51 double const aperture_cutoff)
52{
53 if (aperture >= aperture0)
54 {
55 return 1;
56 }
57
58 // Logarithmic penalty
59 if (aperture > aperture_cutoff)
60 {
61 double const penalty = std::log(aperture / aperture0);
62 return 1 + penalty * penalty;
63 }
64
65 // Linear penalty below aperture cutoff
66 {
67 double const penalty = std::log(aperture_cutoff / aperture0);
68 return 1 + penalty * penalty +
69 2 * penalty / aperture_cutoff * (aperture - aperture_cutoff);
70 }
71};
72} // namespace Fracture
73} // namespace MaterialLib
double logPenalty(double const aperture0, double const aperture, double const aperture_cutoff)
Definition LogPenalty.h:49
double logPenaltyDerivative(double const aperture0, double const aperture, double const aperture_cutoff)
Definition LogPenalty.h:23