Commit 85e8bea9 authored by Dmitry Yu. Naumov's avatar Dmitry Yu. Naumov
Browse files

[PL/RM] FEM; Read access to internal state vars.

parent 4d41ae9f
......@@ -102,6 +102,13 @@ struct LocalAssemblerInterface : public ProcessLib::LocalAssemblerInterface,
std::vector<NumLib::LocalToGlobalIndexMap const*> const& dof_table,
std::vector<double>& cache) const = 0;
virtual std::vector<double> getMaterialStateVariableInternalState(
std::function<BaseLib::DynamicSpan<double>(
typename MaterialLib::Solids::MechanicsBase<
DisplacementDim>::MaterialStateVariables&)>
get_values_span,
int n_components) const = 0;
// TODO move to NumLib::ExtrapolatableElement
virtual unsigned getNumberOfIntegrationPoints() const = 0;
......
......@@ -1286,6 +1286,23 @@ std::vector<double> const& RichardsMechanicsLocalAssembler<
_ip_data, &IpData::eps, cache);
}
template <typename ShapeFunctionDisplacement, typename ShapeFunctionPressure,
typename IntegrationMethod, int DisplacementDim>
std::vector<double> RichardsMechanicsLocalAssembler<
ShapeFunctionDisplacement, ShapeFunctionPressure, IntegrationMethod,
DisplacementDim>::
getMaterialStateVariableInternalState(
std::function<BaseLib::DynamicSpan<double>(
typename MaterialLib::Solids::MechanicsBase<
DisplacementDim>::MaterialStateVariables&)>
get_values_span,
int const n_components) const
{
return ProcessLib::getIntegrationPointDataMaterialStateVariables(
_ip_data, &IpData::material_state_variables, get_values_span,
n_components);
}
template <typename ShapeFunctionDisplacement, typename ShapeFunctionPressure,
typename IntegrationMethod, int DisplacementDim>
std::vector<double> const& RichardsMechanicsLocalAssembler<
......
......@@ -237,6 +237,13 @@ public:
std::vector<NumLib::LocalToGlobalIndexMap const*> const& dof_table,
std::vector<double>& cache) const override;
std::vector<double> getMaterialStateVariableInternalState(
std::function<BaseLib::DynamicSpan<double>(
typename MaterialLib::Solids::MechanicsBase<
DisplacementDim>::MaterialStateVariables&)>
get_values_span,
int n_components) const override;
std::vector<double> const& getIntPtDryDensitySolid(
const double t,
std::vector<GlobalVector*> const& x,
......
......@@ -136,4 +136,29 @@ std::size_t setIntegrationPointScalarData(
return n_integration_points;
}
template <typename IntegrationPointData, typename MemberType,
typename MaterialStateVariables>
std::vector<double> getIntegrationPointDataMaterialStateVariables(
std::vector<IntegrationPointData,
Eigen::aligned_allocator<IntegrationPointData>> const&
ip_data_vector,
MemberType member,
std::function<BaseLib::DynamicSpan<double>(MaterialStateVariables&)>
get_values_span,
int const n_components)
{
std::vector<double> result;
result.reserve(ip_data_vector.size() * n_components);
for (auto& ip_data : ip_data_vector)
{
auto const values_span = get_values_span(*(ip_data.*member));
assert(values_span.size == static_cast<std::size_t>(n_components));
result.insert(end(result), values_span.data,
values_span.data + values_span.size);
}
return result;
}
} // namespace ProcessLib
Supports Markdown
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