OGS
ProcessLib::Deformation::CollectIntegrationPointDataForExtrapolation< InternalVariable > Class Template Referencefinal

Detailed Description

template<typename InternalVariable>
class ProcessLib::Deformation::CollectIntegrationPointDataForExtrapolation< InternalVariable >

Definition at line 137 of file SolidMaterialInternalToSecondaryVariables.h.

#include <SolidMaterialInternalToSecondaryVariables.h>

Public Member Functions

 CollectIntegrationPointDataForExtrapolation (InternalVariablesCollection< InternalVariable > &&internal_variables_collection)
 
template<typename LocalAssemblerInterface >
std::vector< double > const & operator() (LocalAssemblerInterface const &loc_asm, const double, std::vector< GlobalVector * > const &, std::vector< NumLib::LocalToGlobalIndexMap const * > const &, std::vector< double > &cache) const
 

Private Attributes

InternalVariablesCollection< InternalVariable > internal_variables_collection_
 

Constructor & Destructor Documentation

◆ CollectIntegrationPointDataForExtrapolation()

template<typename InternalVariable >
ProcessLib::Deformation::CollectIntegrationPointDataForExtrapolation< InternalVariable >::CollectIntegrationPointDataForExtrapolation ( InternalVariablesCollection< InternalVariable > && internal_variables_collection)
inlineexplicit

Definition at line 140 of file SolidMaterialInternalToSecondaryVariables.h.

144 std::move(internal_variables_collection))
145 {
146 }

Member Function Documentation

◆ operator()()

template<typename InternalVariable >
template<typename LocalAssemblerInterface >
std::vector< double > const & ProcessLib::Deformation::CollectIntegrationPointDataForExtrapolation< InternalVariable >::operator() ( LocalAssemblerInterface const & loc_asm,
const double ,
std::vector< GlobalVector * > const & ,
std::vector< NumLib::LocalToGlobalIndexMap const * > const & ,
std::vector< double > & cache ) const
inline

Definition at line 149 of file SolidMaterialInternalToSecondaryVariables.h.

155 {
156 cache.clear();
157
158 auto const* const iv =
159 internal_variables_collection_.findInternalVariable(loc_asm);
160
161 if (iv == nullptr)
162 {
163 // If the material model for the present material group does not
164 // have the requested internal variable, return an empty vector,
165 // which will be ignored by the extrapolation algorithm.
166 return cache;
167 }
168
169 auto const& fct = iv->getter;
170
171 const unsigned num_int_pts = loc_asm.getNumberOfIntegrationPoints();
172 assert(num_int_pts > 0);
173
174 auto cache_mat = MathLib::createZeroedMatrix<Eigen::Matrix<
175 double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>>(
176 cache, internal_variables_collection_.num_components, num_int_pts);
177
178 // TODO avoid the heap allocation (one per finite element)
179 std::vector<double> cache_column(num_int_pts);
180
181 for (unsigned i = 0; i < num_int_pts; ++i)
182 {
183 auto const& state = loc_asm.getMaterialStateVariablesAt(i);
184
185 auto const& int_pt_values = fct(state, cache_column);
186 assert(int_pt_values.size() ==
187 static_cast<std::size_t>(
188 internal_variables_collection_.num_components));
189 auto const int_pt_values_vec = MathLib::toVector(int_pt_values);
190
191 cache_mat.col(i).noalias() = int_pt_values_vec;
192 }
193
194 return cache;
195 }
Eigen::Map< const Vector > toVector(std::vector< double > const &data, Eigen::VectorXd::Index size)
Creates an Eigen mapped vector from the given data vector.
Eigen::Map< Matrix > createZeroedMatrix(std::vector< double > &data, Eigen::MatrixXd::Index rows, Eigen::MatrixXd::Index cols)

References MathLib::createZeroedMatrix(), ProcessLib::Deformation::CollectIntegrationPointDataForExtrapolation< InternalVariable >::internal_variables_collection_, and MathLib::toVector().

Member Data Documentation

◆ internal_variables_collection_

template<typename InternalVariable >
InternalVariablesCollection<InternalVariable> ProcessLib::Deformation::CollectIntegrationPointDataForExtrapolation< InternalVariable >::internal_variables_collection_
private

The documentation for this class was generated from the following file: