OGS
ProcessLib::Reflection::detail::GetFlattenedIPDataFromLocAsm< Dim, Accessor_IPDataVecInLocAsm, Accessor_CurrentLevelFromIPDataVecElement > Struct Template Reference

Detailed Description

template<int Dim, typename Accessor_IPDataVecInLocAsm, typename Accessor_CurrentLevelFromIPDataVecElement>
struct ProcessLib::Reflection::detail::GetFlattenedIPDataFromLocAsm< Dim, Accessor_IPDataVecInLocAsm, Accessor_CurrentLevelFromIPDataVecElement >

A function object taking a local assembler as its argument and returning a std::vector<double> of some specific "flattened" integration point (IP) data.

Template Parameters
Dimthe space dimension
Accessor_IPDataVecInLocAsmsee below
Accessor_CurrentLevelFromIPDataVecElementsee below

In OGS IP data is usually stored in the local assembler in the following way:

struct LocAsm
{
std::vector<IPData1> ip_data1;
std::vector<IPData2> ip_data2;
};

The types IPData1 and IPData2 might directly contain the IP data or might have struct members who contain the IP data, e.g.:

struct IPData1
{
double scalar1; // IPData1 directly holds IP data
Eigen::Vector<double, 3> vector1;
};
struct IPData_Level2
{
double scalar2;
Eigen::Vector<double, 6> kelvin2;
};
struct IPData2
{
IPData_Level2 level2; // IPData2 does not directly hold IP data
};

Accessor_IPDataVecInLocAsm is a function object with signature LocAsm const& -> std::vector<IPData> const&.

Accessor_CurrentLevelFromIPDataVecElement is a function object with signature IPData const& -> double (or Eigen::Vector), where IPData is the "top level" struct contained in the std::vector<IPData>.

I.e. the first accessor takes us from the local assembler to the IP data vector and the second accessor takes us from an IP data vector element to the final IP data of type double or Eigen::Vector.

Note
This function object transforms Kelvin vector typed IP data to a ParaView compatible symmetric tensor representation.

Definition at line 233 of file ReflectionIPData.h.

#include <ReflectionIPData.h>

Public Member Functions

template<typename LocAsm>
std::vector< double > operator() (LocAsm const &loc_asm) const

Public Attributes

Accessor_IPDataVecInLocAsm accessor_ip_data_vec_in_loc_asm
Accessor_CurrentLevelFromIPDataVecElement accessor_current_level_from_ip_data_vec_element

Member Function Documentation

◆ operator()()

template<int Dim, typename Accessor_IPDataVecInLocAsm, typename Accessor_CurrentLevelFromIPDataVecElement>
template<typename LocAsm>
std::vector< double > ProcessLib::Reflection::detail::GetFlattenedIPDataFromLocAsm< Dim, Accessor_IPDataVecInLocAsm, Accessor_CurrentLevelFromIPDataVecElement >::operator() ( LocAsm const & loc_asm) const
inline

Definition at line 244 of file ReflectionIPData.h.

245 {
249
250 // the concrete IP data, e.g. double or Eigen::Vector
253 IPDataVectorElement const&>>;
255 "This method only deals with raw data. The given "
256 "ConcreteIPData is not raw data.");
257
260 constexpr unsigned num_comp = num_rows * num_cols;
262 auto const num_ips = ip_data_vector.size();
263
265
266 for (std::size_t ip = 0; ip < num_ips; ++ip)
267 {
269 auto const& ip_data =
272
273 if constexpr (num_comp == 1)
274 {
275 // scalar
276 result[ip] = ip_data;
277 }
278 else if constexpr (num_rows == MathLib::KelvinVector::
280 num_cols == 1)
281 {
282 // Kelvin vector
283 auto const converted =
285 ip_data);
286
287 for (unsigned comp = 0; comp < num_comp; ++comp)
288 {
290 }
291 }
292 else if constexpr (num_cols == MathLib::KelvinVector::
294 num_rows == 1)
295 {
296 static_assert(
297 num_rows != 1 /* always false in this branch */,
298 "We support Kelvin column-vectors, but not Kelvin "
299 "row-vectors. The latter are unusual and confusion with "
300 "generic vectors might be possible.");
301 }
302 else if constexpr (num_rows == 1 || num_cols == 1)
303 {
304 // row or column vector
305 for (unsigned comp = 0; comp < num_comp; ++comp)
306 {
308 }
309 }
310 else
311 {
312 // matrix
313 // row-major traversal
314 for (unsigned row = 0; row < num_rows; ++row)
315 {
316 for (unsigned col = 0; col < num_cols; ++col)
317 {
318 result[ip * num_comp + row * num_cols + col] =
319 ip_data(row, col);
320 }
321 }
322 }
323 }
324 return result;
325 }
Eigen::Matrix< double, 4, 1 > kelvinVectorToSymmetricTensor(Eigen::Matrix< double, 4, 1, Eigen::ColMajor, 4, 1 > const &v)
constexpr int kelvin_vector_dimensions(int const displacement_dim)
Kelvin vector dimensions for given displacement dimension.
Accessor_CurrentLevelFromIPDataVecElement accessor_current_level_from_ip_data_vec_element

References accessor_current_level_from_ip_data_vec_element, accessor_ip_data_vec_in_loc_asm, MathLib::KelvinVector::kelvin_vector_dimensions(), and MathLib::KelvinVector::kelvinVectorToSymmetricTensor().

Member Data Documentation

◆ accessor_current_level_from_ip_data_vec_element

template<int Dim, typename Accessor_IPDataVecInLocAsm, typename Accessor_CurrentLevelFromIPDataVecElement>
Accessor_CurrentLevelFromIPDataVecElement ProcessLib::Reflection::detail::GetFlattenedIPDataFromLocAsm< Dim, Accessor_IPDataVecInLocAsm, Accessor_CurrentLevelFromIPDataVecElement >::accessor_current_level_from_ip_data_vec_element

Definition at line 241 of file ReflectionIPData.h.

Referenced by operator()().

◆ accessor_ip_data_vec_in_loc_asm

template<int Dim, typename Accessor_IPDataVecInLocAsm, typename Accessor_CurrentLevelFromIPDataVecElement>
Accessor_IPDataVecInLocAsm ProcessLib::Reflection::detail::GetFlattenedIPDataFromLocAsm< Dim, Accessor_IPDataVecInLocAsm, Accessor_CurrentLevelFromIPDataVecElement >::accessor_ip_data_vec_in_loc_asm

Definition at line 239 of file ReflectionIPData.h.

Referenced by operator()().


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