Skip to content
Snippets Groups Projects
Commit 4bfd1fd4 authored by Norihiro Watanabe's avatar Norihiro Watanabe
Browse files

add LinearElasticIsotropic model for fractures

parent 2d68cd83
No related branches found
No related tags found
No related merge requests found
/**
* \copyright
* Copyright (c) 2012-2016, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
*/
#include "CreateLinearElasticIsotropic.h"
#include "LinearElasticIsotropic.h"
namespace MaterialLib
{
namespace Fracture
{
template <int DisplacementDim>
std::unique_ptr<FractureModelBase<DisplacementDim>>
createLinearElasticIsotropic(
std::vector<std::unique_ptr<ProcessLib::ParameterBase>> const& parameters,
BaseLib::ConfigTree const& config)
{
config.checkConfigParameter("type", "LinearElasticIsotropic");
DBUG("Create LinearElasticIsotropic material");
// Youngs modulus
auto& Kn = ProcessLib::findParameter<double>(
config, "kn", parameters, 1);
DBUG("Use '%s' as Kn parameter.", Kn.name.c_str());
// Poissons ratio
auto& Ks = ProcessLib::findParameter<double>(
config, "ks", parameters, 1);
DBUG("Use '%s' as Ks parameter.", Ks.name.c_str());
typename LinearElasticIsotropic<DisplacementDim>::MaterialProperties mp{
Kn, Ks};
return std::unique_ptr<LinearElasticIsotropic<DisplacementDim>>{
new LinearElasticIsotropic<DisplacementDim>{mp}};
}
template
std::unique_ptr<FractureModelBase<2>>
createLinearElasticIsotropic(
std::vector<std::unique_ptr<ProcessLib::ParameterBase>> const& parameters,
BaseLib::ConfigTree const& config);
template
std::unique_ptr<FractureModelBase<3>>
createLinearElasticIsotropic(
std::vector<std::unique_ptr<ProcessLib::ParameterBase>> const& parameters,
BaseLib::ConfigTree const& config);
} // namespace Fracture
} // namespace MaterialLib
/**
* \copyright
* Copyright (c) 2012-2016, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
*/
#pragma once
#include "ProcessLib/Utils/ProcessUtils.h" // required for findParameter
#include "FractureModelBase.h"
namespace MaterialLib
{
namespace Fracture
{
template <int DisplacementDim>
std::unique_ptr<FractureModelBase<DisplacementDim>>
createLinearElasticIsotropic(
std::vector<std::unique_ptr<ProcessLib::ParameterBase>> const& parameters,
BaseLib::ConfigTree const& config);
} // namespace Fracture
} // namespace MaterialLib
/**
* \copyright
* Copyright (c) 2012-2016, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
*/
#include "LinearElasticIsotropic.h"
namespace MaterialLib
{
namespace Fracture
{
template <int DisplacementDim>
void LinearElasticIsotropic<DisplacementDim>::computeConstitutiveRelation(
double const t,
ProcessLib::SpatialPosition const& x,
Eigen::Ref<Eigen::VectorXd const> w_prev,
Eigen::Ref<Eigen::VectorXd const> w,
Eigen::Ref<Eigen::VectorXd const> sigma_prev,
Eigen::Ref<Eigen::VectorXd> sigma,
Eigen::Ref<Eigen::MatrixXd> C)
{
const int index_ns = DisplacementDim - 1;
C.setZero();
for (int i=0; i<index_ns; i++)
C(i,i) = _mp.shear_stiffness(t, x)[0];
C(index_ns, index_ns) = _mp.normal_stiffness(t, x)[0];
sigma.noalias() = sigma_prev + C * (w - w_prev);
// correct if fracture is opening
if (sigma[index_ns] > 0)
{
C.setZero();
sigma.setZero();
}
}
template class LinearElasticIsotropic<2>;
template class LinearElasticIsotropic<3>;
} // namespace Fracture
} // namespace MaterialLib
/**
* \copyright
* Copyright (c) 2012-2016, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
*/
#pragma once
#include <Eigen/Eigen>
#include "ProcessLib/Parameter/Parameter.h"
#include "FractureModelBase.h"
namespace MaterialLib
{
namespace Fracture
{
template <int DisplacementDim>
class LinearElasticIsotropic final : public FractureModelBase<DisplacementDim>
{
public:
/// Variables specific to the material model
struct MaterialProperties
{
using P = ProcessLib::Parameter<double>;
using X = ProcessLib::SpatialPosition;
MaterialProperties(P const& normal_stiffness, P const& shear_stiffness)
: normal_stiffness(normal_stiffness), shear_stiffness(shear_stiffness)
{
}
P const& normal_stiffness;
P const& shear_stiffness;
};
public:
explicit LinearElasticIsotropic(
MaterialProperties const& material_properties)
: _mp(material_properties)
{
}
void computeConstitutiveRelation(
double const t,
ProcessLib::SpatialPosition const& x,
Eigen::Ref<Eigen::VectorXd const> w_prev,
Eigen::Ref<Eigen::VectorXd const> w,
Eigen::Ref<Eigen::VectorXd const> sigma_prev,
Eigen::Ref<Eigen::VectorXd> sigma,
Eigen::Ref<Eigen::MatrixXd> C) override;
private:
MaterialProperties _mp;
};
} // namespace Fracture
} // namespace MaterialLib
namespace MaterialLib
{
namespace Fracture
{
extern template class LinearElasticIsotropic<2>;
extern template class LinearElasticIsotropic<3>;
} // namespace Fractrue
} // namespace MaterialLib
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment