Currently, a lot of code is required to instantiate the appropriate laws/integrands. Like
template <int TDim>
auto TestLaw()
{
// Define the law using policy based design principles, hopefully applied correctly
using Damage = Constitutive::DamageLawExponential;
using StrainNorm = Constitutive::ModifiedMisesStrainNorm<TDim>;
using Evolution = Laws::EvolutionImplicit<TDim>;
using Law = Laws::LocalIsotropicDamage<TDim, Damage, Evolution>;
Damage dmg(kappa0, beta, alpha);
Evolution evolutionEq(StrainNorm(nu, fc / ft), /*numCells=*/1, /*numIps=*/1);
Laws::LinearElasticDamage<TDim> elasticDamage(E, nu);
return Law(elasticDamage, dmg, evolutionEq);
}
Some material parameters are required multiple times (kappa0 = ft/E) which is error prone and long. Also parameters like alpha or beta are not intuitive. But they do relate to real material parameters.
Solution
1) Define a material class.
Dealing with mechanical softening problems often involves the same set of parameters. Like
2) Add constructors that takes a SofteningMaterial to the softening laws/integrands, as well as the deeper classes like (strain norms, damage laws, linear elastic damage). This allows a proper policy based design with defaulted template arguments. The code above would then look like
template <int TDim>
auto TestLaw(SofteningMaterial material)
{
return Laws::LocalIsotropicDamage<TDim>(material); // with reasonable the default template arguments
}
3) Still allow construction with the individual parameters. Still allow customization by changing the template parameters.
Discussion:
Is that relevant for someone else? I think so as we often deal with concrete.
Naming alright? Access via public members alright? With m (mYoungsModulus vs youngsModulus)?
Problem
Currently, a lot of code is required to instantiate the appropriate laws/integrands. Like
Some material parameters are required multiple times (
kappa0 = ft/E
) which is error prone and long. Also parameters like alpha or beta are not intuitive. But they do relate to real material parameters.Solution
1) Define a material class. Dealing with mechanical softening problems often involves the same set of parameters. Like
2) Add constructors that takes a
SofteningMaterial
to the softening laws/integrands, as well as the deeper classes like (strain norms, damage laws, linear elastic damage). This allows a proper policy based design with defaulted template arguments. The code above would then look like3) Still allow construction with the individual parameters. Still allow customization by changing the template parameters.
Discussion:
m
(mYoungsModulus
vsyoungsModulus
)?