version 0.4.1
linearalgebrahelper.hh File Reference

Helper for the autodiff library. More...

#include "concepts.hh"
#include "traits.hh"
#include <iosfwd>
#include <random>
#include <ranges>
#include <dune/common/tuplevector.hh>
#include <dune/functions/functionspacebases/lagrangebasis.hh>
#include <dune/istl/bvector.hh>
#include <Eigen/Core>
#include <autodiff/forward/dual/dual.hpp>

Go to the source code of this file.

Namespaces

namespace  Ikarus
 

Functions

template<typename Derived >
auto Ikarus::orthonormalizeMatrixColumns (const Eigen::MatrixBase< Derived > &A)
 Orthonormalizes all Matrix columns using Gram-Schmidt Orthogonalization. More...
 
template<typename ValueType >
auto Ikarus::viewAsFlatEigenVector (Dune::BlockVector< ValueType > &blockedVector)
 View Dune::BlockVector as an Eigen::Vector. More...
 
template<typename ValueType >
auto Ikarus::viewAsFlatEigenVector (const Dune::BlockVector< ValueType > &blockedVector)
 View const Dune::BlockVector as an Eigen::Vector. More...
 
template<typename ValueType >
auto Ikarus::viewAsEigenMatrixAsDynFixed (Dune::BlockVector< ValueType > &blockedVector)
 View Dune::BlockVector as an Eigen::Matrix with dynamic rows and fixed columns depending on the size of the ValueType. More...
 
template<typename ValueType >
auto Ikarus::viewAsEigenMatrixAsDynFixed (const Dune::BlockVector< ValueType > &blockedVector)
 Const view Dune::BlockVector as an Eigen::Matrix with dynamic rows and fixed columns depending on the size of the ValueType. More...
 
template<typename ValueType >
auto Ikarus::viewAsEigenMatrixFixedDyn (Dune::BlockVector< ValueType > &blockedVector)
 View Dune::BlockVector as an Eigen::Matrix with fixed rows depending on the size of the ValueType and dynamic columns. More...
 
template<typename ValueType >
auto Ikarus::viewAsEigenMatrixFixedDyn (const Dune::BlockVector< ValueType > &blockedVector)
 Const view Dune::BlockVector as an Eigen::Matrix with fixed rows depending on the size of the ValueType and dynamic columns. More...
 
template<typename Type >
requires requires { Type::correctionSize; }
size_t Ikarus::correctionSize (const Dune::BlockVector< Type > &a)
 Returns the total correction size of a block vector with a Manifold as the underlying type. More...
 
template<typename Type >
requires requires { Type::valueSize; }
size_t Ikarus::valueSize (const Dune::BlockVector< Type > &a)
 Returns the total value size of a block vector with a Manifold as the underlying type. More...
 
template<typename Type , typename Derived >
requires (Ikarus::Concepts::AddAssignAble<Type, decltype(b.template segment<Type::correctionSize>(0))> and requires() { Type::correctionSize; })
Dune::BlockVector< Type > & Ikarus::operator+= (Dune::BlockVector< Type > &a, const Eigen::MatrixBase< Derived > &b)
 Enables the += operator for Dune::BlockVector += Eigen::Vector. More...
 
template<typename Type , typename Derived >
requires (Ikarus::Concepts::AddAssignAble<Type, decltype(b.template segment<Type::correctionSize>(0))> and requires() { Type::correctionSize; })
Dune::BlockVector< Type > & Ikarus::operator-= (Dune::BlockVector< Type > &a, const Eigen::MatrixBase< Derived > &b)
 Enables the -= operator for Dune::BlockVector += Eigen::Vector. More...
 
template<typename... Types, typename Derived >
Dune::TupleVector< Types... > & Ikarus::operator+= (Dune::TupleVector< Types... > &a, const Eigen::MatrixBase< Derived > &b)
 Enables the += operator for Dune::TupleVector += Eigen::Vector. More...
 
template<typename ManifoldPoint , typename Derived >
requires (Ikarus::Concepts::AddAssignAble<ManifoldPoint, decltype(b.template segment<ManifoldPoint::valueSize>(0))> and requires() { ManifoldPoint::valueSize; })
Dune::BlockVector< ManifoldPoint > & Ikarus::addInEmbedding (Dune::BlockVector< ManifoldPoint > &a, const Eigen::MatrixBase< Derived > &b)
 Enables the addition in the embedding space of a vector in the space M^n, where M is a manifold with the points of type ManifoldPoint. More...
 
template<typename Derived >
requires (!std::floating_point<Derived>)
auto Ikarus::norm (const Eigen::MatrixBase< Derived > &v)
 Adding free norm function to Eigen types. More...
 
auto Ikarus::norm (const std::floating_point auto &v)
 Helper Free Function to have the same interface as for Eigen Vector Types. More...
 
template<typename Scalar , int size>
auto Ikarus::operator* (const Eigen::DiagonalMatrix< Scalar, size > &a, const Eigen::DiagonalMatrix< Scalar, size > &b)
 Eigen::DiagonalMatrix Product Missing in Eigen. More...
 
template<typename Scalar , int size>
auto Ikarus::operator+= (Eigen::DiagonalMatrix< Scalar, size > &a, const Eigen::DiagonalMatrix< Scalar, size > &b)
 In-place addition for Eigen::DiagonalMatrix. More...
 
template<typename Derived , typename Scalar , int size>
auto Ikarus::operator+ (const Eigen::MatrixBase< Derived > &a, const Eigen::DiagonalMatrix< Scalar, size > &b)
 Eigen::Matrix + Eigen::DiagonalMatrix addition missing in Eigen. More...
 
template<typename Derived , typename Scalar , int size>
auto Ikarus::operator+ (const Eigen::DiagonalMatrix< Scalar, size > &a, const Eigen::MatrixBase< Derived > &b)
 Eigen::DiagonalMatrix + Eigen::Matrix addition missing in Eigen. More...
 
template<typename Scalar , int size>
auto Ikarus::operator- (const Eigen::DiagonalMatrix< Scalar, size > &a)
 Unary minus for Eigen::DiagonalMatrix. More...
 
template<typename Derived , typename Derived2 >
auto Ikarus::operator+ (const Eigen::MatrixBase< Derived > &a, const Eigen::DiagonalWrapper< Derived2 > &b)
 Addition of Eigen::Matrix and Eigen::DiagonalWrapper. More...
 
template<typename Derived , typename Derived2 >
auto Ikarus::operator+ (const Eigen::DiagonalWrapper< Derived > &a, const Eigen::MatrixBase< Derived2 > &b)
 Addition of Eigen::DiagonalWrapper and Eigen::Matrix. More...
 
template<typename Scalar , int size>
std::ostream & Ikarus::operator<< (std::ostream &os, const Eigen::DiagonalMatrix< Scalar, size > &a)
 Output stream operator for Eigen::DiagonalMatrix. More...
 
template<typename Derived >
Derived Ikarus::sym (const Eigen::MatrixBase< Derived > &A)
 Returns the symmetric part of a matrix. More...
 
template<typename Derived >
Derived Ikarus::skew (const Eigen::MatrixBase< Derived > &A)
 Returns the skew part of a matrix. More...
 
template<typename Derived >
void Ikarus::printForMaple (const Eigen::EigenBase< Derived > &A)
 Method to print the matrix in a format that can directly be copied to Maple. More...
 
template<typename FieldVectorT >
auto Ikarus::createRandomVector (typename FieldVectorT::value_type lower=-1, typename FieldVectorT::value_type upper=1)
 Creates a random vector of the specified type within a given range. More...
 
template<typename ScalarType >
Eigen::Matrix< ScalarType, 3, 3 > Ikarus::skew (const Eigen::Vector< ScalarType, 3 > &a)
 Create skew 3x3 matrix from 3d vector. More...
 
template<typename Derived , size_t sizeOfCondensedIndices>
auto Ikarus::staticCondensation (const Eigen::MatrixBase< Derived > &E, const std::array< size_t, sizeOfCondensedIndices > &indices)
 Performs static condensation on a square matrix. More...
 
template<typename Derived , size_t sizeOfCondensedIndices>
auto Ikarus::reduceMatrix (const Eigen::MatrixBase< Derived > &E, const std::array< size_t, sizeOfCondensedIndices > &indices)
 
template<typename Derived , size_t sizeOfRemovedCols>
auto Ikarus::removeCol (const Eigen::MatrixBase< Derived > &E, const std::array< size_t, sizeOfRemovedCols > &indices)
 Removes specified columns from a matrix. More...
 
template<typename ST , typename MaterialImpl >
auto Ikarus::toVoigtAndMaybeReduce (const Eigen::Matrix< ST, 3, 3 > &E, const MaterialImpl &material, bool isStrain=true)
 Converts a 3x3 matrix to Voigt notation, possibly reducing it based on material properties. More...
 
template<typename M , typename Derived >
decltype(auto) Ikarus::enlargeIfReduced (const Eigen::MatrixBase< Derived > &E)
 Enlarges a matrix if it reduced in the context of material laws, i.e., VanishingStress If the material is not reduced the untouched matrix is returned and rendering the function as a NoOp. More...
 

Variables

template<int dim>
constexpr auto Ikarus::voigtNotationContainer = std::get<dim - 1>(Impl::voigtIndices)
 Container for Voigt notation indices based on dimension.1D: 0,0 2D: 0,0; 1,1; 0,1 3D: 0,0; 1,1; 2,2; 1,2; 0,2; 0,1. More...