Commit d99dc481 authored by wenqing's avatar wenqing

[HM] Replaced component wise stress/strain output with tensor wise one

parent 2ac95d70
......@@ -26,6 +26,7 @@
#include "ProcessLib/Deformation/BMatrixPolicy.h"
#include "ProcessLib/Deformation/LinearBMatrix.h"
#include "ProcessLib/LocalAssemblerTraits.h"
#include "ProcessLib/Utils/SetOrGetIntegrationPointData.h"
namespace ProcessLib
{
......@@ -242,157 +243,33 @@ public:
std::vector<double> getEpsilon() const override;
std::vector<double> const& getIntPtSigmaXX(
const double /*t*/,
std::vector<GlobalVector*> const& /*x*/,
std::vector<NumLib::LocalToGlobalIndexMap const*> const& /*dof_table*/,
std::vector<double>& cache) const override
{
return getIntPtSigma(cache, 0);
}
std::vector<double> const& getIntPtSigmaYY(
const double /*t*/,
std::vector<GlobalVector*> const& /*x*/,
std::vector<NumLib::LocalToGlobalIndexMap const*> const& /*dof_table*/,
std::vector<double>& cache) const override
{
return getIntPtSigma(cache, 1);
}
std::vector<double> const& getIntPtSigmaZZ(
const double /*t*/,
std::vector<GlobalVector*> const& /*x*/,
std::vector<NumLib::LocalToGlobalIndexMap const*> const& /*dof_table*/,
std::vector<double>& cache) const override
{
return getIntPtSigma(cache, 2);
}
std::vector<double> const& getIntPtSigmaXY(
const double /*t*/,
std::vector<GlobalVector*> const& /*x*/,
std::vector<NumLib::LocalToGlobalIndexMap const*> const& /*dof_table*/,
std::vector<double>& cache) const override
{
return getIntPtSigma(cache, 3);
}
std::vector<double> const& getIntPtSigmaXZ(
const double /*t*/,
std::vector<GlobalVector*> const& /*x*/,
std::vector<NumLib::LocalToGlobalIndexMap const*> const& /*dof_table*/,
std::vector<double>& cache) const override
{
assert(DisplacementDim == 3);
return getIntPtSigma(cache, 4);
}
std::vector<double> const& getIntPtSigmaYZ(
const double /*t*/,
std::vector<GlobalVector*> const& /*x*/,
std::vector<NumLib::LocalToGlobalIndexMap const*> const& /*dof_table*/,
std::vector<double>& cache) const override
{
assert(DisplacementDim == 3);
return getIntPtSigma(cache, 5);
}
std::vector<double> const& getIntPtEpsilonXX(
const double /*t*/,
std::vector<GlobalVector*> const& /*x*/,
std::vector<NumLib::LocalToGlobalIndexMap const*> const& /*dof_table*/,
std::vector<double>& cache) const override
{
return getIntPtEpsilon(cache, 0);
}
std::vector<double> const& getIntPtEpsilonYY(
const double /*t*/,
std::vector<GlobalVector*> const& /*x*/,
std::vector<NumLib::LocalToGlobalIndexMap const*> const& /*dof_table*/,
std::vector<double>& cache) const override
{
return getIntPtEpsilon(cache, 1);
}
std::vector<double> const& getIntPtEpsilonZZ(
const double /*t*/,
std::vector<GlobalVector*> const& /*x*/,
std::vector<NumLib::LocalToGlobalIndexMap const*> const& /*dof_table*/,
std::vector<double>& cache) const override
{
return getIntPtEpsilon(cache, 2);
}
std::vector<double> const& getIntPtEpsilonXY(
const double /*t*/,
std::vector<GlobalVector*> const& /*x*/,
std::vector<NumLib::LocalToGlobalIndexMap const*> const& /*dof_table*/,
std::vector<double>& cache) const override
{
return getIntPtEpsilon(cache, 3);
}
std::vector<double> const& getIntPtDarcyVelocity(
const double t,
std::vector<GlobalVector*> const& x,
std::vector<NumLib::LocalToGlobalIndexMap const*> const& dof_table,
std::vector<double>& cache) const override;
std::vector<double> const& getIntPtEpsilonXZ(
std::vector<double> const& getIntPtSigma(
const double /*t*/,
std::vector<GlobalVector*> const& /*x*/,
std::vector<NumLib::LocalToGlobalIndexMap const*> const& /*dof_table*/,
std::vector<double>& cache) const override
{
assert(DisplacementDim == 3);
return getIntPtEpsilon(cache, 4);
return ProcessLib::getIntegrationPointKelvinVectorData<DisplacementDim>(
_ip_data, &IpData::sigma_eff, cache);
}
std::vector<double> const& getIntPtEpsilonYZ(
std::vector<double> const& getIntPtEpsilon(
const double /*t*/,
std::vector<GlobalVector*> const& /*x*/,
std::vector<NumLib::LocalToGlobalIndexMap const*> const& /*dof_table*/,
std::vector<double>& cache) const override
{
assert(DisplacementDim == 3);
return getIntPtEpsilon(cache, 5);
return ProcessLib::getIntegrationPointKelvinVectorData<DisplacementDim>(
_ip_data, &IpData::eps, cache);
}
std::vector<double> const& getIntPtDarcyVelocity(
const double t,
std::vector<GlobalVector*> const& x,
std::vector<NumLib::LocalToGlobalIndexMap const*> const& dof_table,
std::vector<double>& cache) const override;
private:
std::vector<double> const& getIntPtSigma(std::vector<double>& cache,
std::size_t const component) const
{
cache.clear();
cache.reserve(_ip_data.size());
for (auto const& ip_data : _ip_data)
{
if (component < 3)
{ // xx, yy, zz components
cache.push_back(ip_data.sigma_eff[component]);
}
else
{ // mixed xy, yz, xz components
cache.push_back(ip_data.sigma_eff[component] / std::sqrt(2));
}
}
return cache;
}
std::vector<double> const& getIntPtEpsilon(
std::vector<double>& cache, std::size_t const component) const
{
cache.clear();
cache.reserve(_ip_data.size());
transform(cbegin(_ip_data), cend(_ip_data), back_inserter(cache),
[&](auto const& ip_data) { return ip_data.eps[component]; });
return cache;
}
/**
* Assemble local matrices and vectors arise from the linearized discretized
......
......@@ -218,47 +218,15 @@ void HydroMechanicsProcess<DisplacementDim>::initializeConcreteProcess(
std::move(get_ip_values_function)));
};
add_secondary_variable(
"sigma_xx", 1, &LocalAssemblerIF::getIntPtSigmaXX);
add_secondary_variable(
"sigma_yy", 1, &LocalAssemblerIF::getIntPtSigmaYY);
add_secondary_variable(
"sigma_zz", 1, &LocalAssemblerIF::getIntPtSigmaZZ);
add_secondary_variable(
"sigma_xy", 1, &LocalAssemblerIF::getIntPtSigmaXY);
if (DisplacementDim == 3)
{
add_secondary_variable(
"sigma_xz", 1, &LocalAssemblerIF::getIntPtSigmaXZ);
add_secondary_variable(
"sigma_yz", 1, &LocalAssemblerIF::getIntPtSigmaYZ);
}
add_secondary_variable(
"epsilon_xx", 1, &LocalAssemblerIF::getIntPtEpsilonXX);
add_secondary_variable(
"epsilon_yy", 1, &LocalAssemblerIF::getIntPtEpsilonYY);
add_secondary_variable(
"epsilon_zz", 1, &LocalAssemblerIF::getIntPtEpsilonZZ);
add_secondary_variable(
"epsilon_xy", 1, &LocalAssemblerIF::getIntPtEpsilonXY);
if (DisplacementDim == 3)
{
add_secondary_variable(
"epsilon_xz", 1, &LocalAssemblerIF::getIntPtEpsilonXZ);
add_secondary_variable(
"epsilon_yz", 1, &LocalAssemblerIF::getIntPtEpsilonYZ);
}
add_secondary_variable("sigma",
MathLib::KelvinVector::KelvinVectorType<
DisplacementDim>::RowsAtCompileTime,
&LocalAssemblerIF::getIntPtSigma);
add_secondary_variable("epsilon",
MathLib::KelvinVector::KelvinVectorType<
DisplacementDim>::RowsAtCompileTime,
&LocalAssemblerIF::getIntPtEpsilon);
add_secondary_variable("velocity",
DisplacementDim,
......
......@@ -30,74 +30,14 @@ struct LocalAssemblerInterface : public ProcessLib::LocalAssemblerInterface,
virtual std::vector<double> getEpsilon() const = 0;
virtual std::vector<double> const& getIntPtSigmaXX(
const double /*t*/,
std::vector<GlobalVector*> const& x,
std::vector<NumLib::LocalToGlobalIndexMap const*> const& dof_table,
std::vector<double>& cache) const = 0;
virtual std::vector<double> const& getIntPtSigmaYY(
const double /*t*/,
std::vector<GlobalVector*> const& x,
std::vector<NumLib::LocalToGlobalIndexMap const*> const& dof_table,
std::vector<double>& cache) const = 0;
virtual std::vector<double> const& getIntPtSigmaZZ(
const double /*t*/,
std::vector<GlobalVector*> const& x,
std::vector<NumLib::LocalToGlobalIndexMap const*> const& dof_table,
std::vector<double>& cache) const = 0;
virtual std::vector<double> const& getIntPtSigmaXY(
const double /*t*/,
std::vector<GlobalVector*> const& x,
std::vector<NumLib::LocalToGlobalIndexMap const*> const& dof_table,
std::vector<double>& cache) const = 0;
virtual std::vector<double> const& getIntPtSigmaXZ(
const double /*t*/,
std::vector<GlobalVector*> const& x,
std::vector<NumLib::LocalToGlobalIndexMap const*> const& dof_table,
std::vector<double>& cache) const = 0;
virtual std::vector<double> const& getIntPtSigmaYZ(
const double /*t*/,
std::vector<GlobalVector*> const& x,
std::vector<NumLib::LocalToGlobalIndexMap const*> const& dof_table,
std::vector<double>& cache) const = 0;
virtual std::vector<double> const& getIntPtEpsilonXX(
const double /*t*/,
std::vector<GlobalVector*> const& x,
std::vector<NumLib::LocalToGlobalIndexMap const*> const& dof_table,
std::vector<double>& cache) const = 0;
virtual std::vector<double> const& getIntPtEpsilonYY(
const double /*t*/,
std::vector<GlobalVector*> const& x,
std::vector<NumLib::LocalToGlobalIndexMap const*> const& dof_table,
std::vector<double>& cache) const = 0;
virtual std::vector<double> const& getIntPtEpsilonZZ(
const double /*t*/,
std::vector<GlobalVector*> const& x,
std::vector<NumLib::LocalToGlobalIndexMap const*> const& dof_table,
std::vector<double>& cache) const = 0;
virtual std::vector<double> const& getIntPtEpsilonXY(
const double /*t*/,
std::vector<GlobalVector*> const& x,
std::vector<NumLib::LocalToGlobalIndexMap const*> const& dof_table,
std::vector<double>& cache) const = 0;
virtual std::vector<double> const& getIntPtEpsilonXZ(
const double /*t*/,
virtual std::vector<double> const& getIntPtSigma(
const double t,
std::vector<GlobalVector*> const& x,
std::vector<NumLib::LocalToGlobalIndexMap const*> const& dof_table,
std::vector<double>& cache) const = 0;
virtual std::vector<double> const& getIntPtEpsilonYZ(
const double /*t*/,
virtual std::vector<double> const& getIntPtEpsilon(
const double t,
std::vector<GlobalVector*> const& x,
std::vector<NumLib::LocalToGlobalIndexMap const*> const& dof_table,
std::vector<double>& cache) const = 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment