v0.13.0
Classes | Functions | Variables
HenckyOps Namespace Reference

Classes

struct  CommonData
 
struct  OpCalculateEigenVals
 
struct  OpCalculateLogC
 
struct  OpCalculateLogC_dC
 
struct  OpCalculateHenckyStress
 
struct  OpCalculateHenckyPlasticStress
 
struct  OpCalculatePiolaStress
 
struct  OpHenckyTangent
 
struct  OpPostProcHencky
 

Functions

auto is_eq (const double &a, const double &b)
 
template<int DIM>
auto get_uniq_nb (double *ptr)
 
template<int DIM>
auto sort_eigen_vals (FTensor::Tensor1< double, DIM > &eig, FTensor::Tensor2< double, DIM, DIM > &eigen_vec)
 

Variables

constexpr double eps = std::numeric_limits<float>::epsilon()
 
auto f = [](double v) { return 0.5 * std::log(static_cast<long double>(v)); }
 
auto d_f = [](double v) { return 0.5 / static_cast<long double>(v); }
 
auto dd_f
 

Function Documentation

◆ get_uniq_nb()

template<int DIM>
auto HenckyOps::get_uniq_nb ( double *  ptr)

Definition at line 29 of file HenckyOps.hpp.

29  {
30  std::array<double, DIM> tmp;
31  std::copy(ptr, &ptr[DIM], tmp.begin());
32  std::sort(tmp.begin(), tmp.end());
33  return std::distance(tmp.begin(), std::unique(tmp.begin(), tmp.end(), is_eq));
34 };
auto is_eq(const double &a, const double &b)
Definition: HenckyOps.hpp:25

◆ is_eq()

auto HenckyOps::is_eq ( const double &  a,
const double &  b 
)

Definition at line 25 of file HenckyOps.hpp.

25  {
26  return std::abs(a - b) < eps;
27 };
constexpr double a
constexpr double eps
Definition: HenckyOps.hpp:17

◆ sort_eigen_vals()

template<int DIM>
auto HenckyOps::sort_eigen_vals ( FTensor::Tensor1< double, DIM > &  eig,
FTensor::Tensor2< double, DIM, DIM > &  eigen_vec 
)

Definition at line 37 of file HenckyOps.hpp.

38  {
39  std::array<std::pair<double, size_t>, DIM> tmp;
40  auto is_eq_pair = [](const auto &a, const auto &b) {
41  return a.first < b.first;
42  };
43 
44  for (size_t i = 0; i != DIM; ++i)
45  tmp[i] = std::make_pair(eig(i), i);
46  std::sort(tmp.begin(), tmp.end(), is_eq_pair);
47 
48  int i, j, k;
49  if (is_eq_pair(tmp[0], tmp[1])) {
50  i = tmp[0].second;
51  j = tmp[2].second;
52  k = tmp[1].second;
53  } else {
54  i = tmp[0].second;
55  j = tmp[1].second;
56  k = tmp[2].second;
57  }
58 
60  eigen_vec(i, 0), eigen_vec(i, 1), eigen_vec(i, 2),
61 
62  eigen_vec(j, 0), eigen_vec(j, 1), eigen_vec(j, 2),
63 
64  eigen_vec(k, 0), eigen_vec(k, 1), eigen_vec(k, 2)};
65 
66  FTensor::Tensor1<double, 3> eig_c{eig(i), eig(j), eig(k)};
67 
68  {
71  eig(i) = eig_c(i);
72  eigen_vec(i, j) = eigen_vec_c(i, j);
73  }
74 };
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k

Variable Documentation

◆ d_f

auto HenckyOps::d_f = [](double v) { return 0.5 / static_cast<long double>(v); }
Examples
matrix_function.cpp.

Definition at line 20 of file HenckyOps.hpp.

◆ dd_f

auto HenckyOps::dd_f
Initial value:
= [](double v) {
return -0.5 / (static_cast<long double>(v) * static_cast<long double>(v));
}
double v
phase velocity of light in medium (cm/ns)
Examples
matrix_function.cpp.

Definition at line 21 of file HenckyOps.hpp.

◆ eps

constexpr double HenckyOps::eps = std::numeric_limits<float>::epsilon()
constexpr

Definition at line 17 of file HenckyOps.hpp.

◆ f

auto HenckyOps::f = [](double v) { return 0.5 * std::log(static_cast<long double>(v)); }