16#include <dune/functions/functionspacebases/basistags.hh>
17#include <dune/functions/functionspacebases/lagrangebasis.hh>
20#include <Eigen/Sparse>
22#include <autodiff/forward/dual/dual.hpp>
29template <
typename Derived>
34template <auto matrixIndexPair,
typename MaterialImpl>
35struct VanishingStress;
37template <
typename Derived>
49 template <
typename Basis>
51 std::is_same_v<typename Basis::PreBasis::IndexMergingStrategy, Dune::Functions::BasisFactory::FlatInterleaved>;
55 template <
template <
typename,
int,
typename>
class U,
typename T>
56 struct LagrangeNodeHelper : std::false_type
59 template <
template <
typename,
int,
typename>
class U,
typename GV,
int k,
typename R>
60 struct LagrangeNodeHelper<U, U<GV, k, R>> : std::true_type
64 template <
template <
typename,
int,
typename>
class U,
typename T,
int k>
65 struct LagrangeNodeHelperOfOrder : std::false_type
68 template <
template <
typename,
int,
typename>
class U,
typename GV,
int k,
typename R>
69 struct LagrangeNodeHelperOfOrder<U, U<GV, k, R>, k> : std::true_type
82 concept LagrangeNode = Impl::LagrangeNodeHelper<Dune::Functions::LagrangeNode, N>::value;
91 template <
typename N,
int order>
92 concept LagrangeNodeOfOrder = Impl::LagrangeNodeHelperOfOrder<Dune::Functions::LagrangeNode, N, order>::value;
102 template <
typename B>
104 std::is_same_v<typename B::PreBasis::IndexMergingStrategy, Dune::Functions::BasisFactory::FlatLexicographic>;
115 template <
typename B>
126 template <
typename Basis>
128 std::is_same_v<typename Basis::PreBasis::IndexMergingStrategy, Dune::Functions::BasisFactory::BlockedInterleaved>;
139 template <
typename B>
141 std::is_same_v<typename B::PreBasis::IndexMergingStrategy, Dune::Functions::BasisFactory::BlockedLexicographic>;
149 template <
typename DLB>
151 typename DLB::Traits::RangeType;
152 typename DLB::Traits::JacobianType;
153 DLB::Traits::dimDomain;
154 typename DLB::Traits::DomainType;
156 typename DLB::Traits::DomainFieldType;
157 typename DLB::Traits::RangeFieldType;
159 duneLocalBasis.evaluateFunction(std::declval<typename DLB::Traits::DomainType>(),
160 std::declval<std::vector<typename DLB::Traits::RangeType>&>());
161 duneLocalBasis.evaluateJacobian(std::declval<typename DLB::Traits::DomainType>(),
162 std::declval<std::vector<typename DLB::Traits::JacobianType>&>());
174 template <
typename B>
184 template <
typename PF,
typename NLO,
typename SA>
186 { pft(args) } -> std::same_as<void>;
187 { pft.initialPrediction(nop, args) } -> std::same_as<void>;
188 { pft.intermediatePrediction(nop, args) } -> std::same_as<void>;
199 template <
typename ASS,
typename NLSI,
typename SA,
typename NonLinearOperator>
201 { adaptiveStepSizing(info, args, nop) } -> std::same_as<void>;
202 { adaptiveStepSizing.targetIterations() } -> std::same_as<int>;
203 { adaptiveStepSizing.setTargetIterations(std::declval<int>()) } -> std::same_as<void>;
214 template <
typename LS,
typename M,
typename V>
216 linearSolver.analyzePattern(A);
217 linearSolver.factorize(A);
218 linearSolver.solve(vec, vec);
228 template <
typename NLS>
230 std::tuple_size<typename NLS::NonLinearOperator::ParameterValues>::value == 2;
231 not(std::is_same_v<typename NLS::NonLinearOperator::ValueType, double> and
232 ((traits::isSpecializationTypeAndNonTypes<Eigen::Matrix,
233 typename NLS::NonLinearOperator::DerivativeType>::value) or
234 (traits::isSpecializationTypeNonTypeAndType<Eigen::SparseMatrix,
235 typename NLS::NonLinearOperator::DerivativeType>::value)));
245 template <
typename L,
typename R>
255 template <
typename L,
typename R>
256 concept AddAble =
requires(L x, R y) { x + y; };
265 template <
typename L,
typename R>
276 template <
typename L,
typename R>
287 template <
typename L,
typename R>
298 template <
typename L,
typename R>
309 template <
typename L,
typename R>
319 template <
typename L,
typename R>
328 template <
typename L>
337 template <
typename L>
346 template <
typename Op,
typename... Args>
354 template <
typename V>
355 concept EigenVector =
static_cast<bool>(V::IsVectorAtCompileTime);
362 template <
typename M>
363 concept EigenMatrix = traits::isSpecializationTypeAndNonTypes<Eigen::Matrix, M>::value;
365#define MAKE_EIGEN_FIXED_VECTOR_CONCEPT(Size) \
366 template <typename V> \
367 concept EigenVector##Size = \
368 static_cast<bool>(V::IsVectorAtCompileTime) and static_cast<bool>(V::SizeAtCompileTime == Size);
377#define MAKE_EIGEN_FIXED_MATRIX_CONCEPT(Size1, Size2) \
378 template <typename M> \
379 concept EigenMatrix##Size1##Size2 = static_cast<bool>(std::remove_cvref_t<M>::RowsAtCompileTime == Size1) and \
380 static_cast<bool>(std::remove_cvref_t<M>::ColsAtCompileTime == Size2);
419#define MAKE_EIGEN_FIXED_MATRIX_OR_VOIGT_CONCEPT(Size1, Size2) \
420 template <typename M> \
421 concept EigenMatrixOrVoigtNotation##Size1 = EigenMatrix##Size1##Size1<M> or EigenVector##Size2<M>;
428 template <
template <
typename...>
class MaterialToCheck,
typename Material>
429 consteval bool isMaterial() {
430 if constexpr (traits::isSpecialization<MaterialToCheck, Material>::value)
434 if constexpr (traits::isSpecialization<MaterialToCheck, typename Material::Underlying>::value) {
456 template <
template <
typename...>
class MaterialToCheck,
typename Material>
457 concept IsMaterial = Impl::isMaterial<MaterialToCheck, Material>();
460 template <
typename T>
463 typename T::Vectorizer;
464 typename T::Matricizer;
465 {
toString(t) } -> std::same_as<std::string>;
475 template <
typename MAT>
487 template <
template <
typename,
int,
int>
typename RT>
489 Impl::ResultType<RT<double, 1, 1>> or Impl::ResultType<RT<double, 1, 2>> or Impl::ResultType<RT<double, 1, 3>> or
490 Impl::ResultType<RT<double, 2, 3>> or Impl::ResultType<RT<double, 3, 3>>;
499 template <
typename T>
501 typename T::AffordanceCollectionType affordance,
DBCOption dbcOption) {
502 { t.requirement() } -> std::convertible_to<typename T::FERequirement&>;
503 { t.affordanceCollection() } -> std::convertible_to<typename T::AffordanceCollectionType>;
504 { t.dBCOption() } -> std::convertible_to<DBCOption>;
506 { t.bind(req, affordance, dbcOption) } -> std::same_as<void>;
507 { t.bind(req) } -> std::same_as<void>;
508 { t.bind(affordance) } -> std::same_as<void>;
509 { t.bind(dbcOption) } -> std::same_as<void>;
511 { t.bound() } -> std::convertible_to<bool>;
512 { t.boundToRequirement() } -> std::convertible_to<bool>;
513 { t.boundToAffordanceCollection() } -> std::convertible_to<bool>;
514 { t.boundToDBCOption() } -> std::convertible_to<bool>;
515 { t.estimateOfConnectivity() } -> std::convertible_to<size_t>;
517 { t.createFullVector(std::declval<Eigen::Ref<const Eigen::VectorXd>>()) } -> std::convertible_to<Eigen::VectorXd>;
518 { t.constraintsBelow(std::declval<size_t>()) } -> std::convertible_to<size_t>;
519 { t.isConstrained(std::declval<size_t>()) } -> std::convertible_to<bool>;
520 { t.size() } -> std::convertible_to<size_t>;
521 { t.reducedSize() } -> std::convertible_to<size_t>;
530 template <
typename T>
533 typename T::AffordanceCollectionType affordance,
DBCOption dbcOption) {
534 { t.scalar(req, affordance.scalarAffordance()) } -> std::convertible_to<const double&>;
535 { t.scalar() } -> std::convertible_to<const double&>;
544 template <
typename T>
546 requires(T t,
const typename T::FERequirement& req,
547 typename T::AffordanceCollectionType affordance,
DBCOption dbcOption) {
549 t.vector(req, affordance.vectorAffordance(), dbcOption)
550 } -> std::convertible_to<const Eigen::VectorXd&>;
551 { t.vector(dbcOption) } -> std::convertible_to<const Eigen::VectorXd&>;
552 { t.vector() } -> std::convertible_to<const Eigen::VectorXd&>;
561 template <
typename T>
563 requires(T t,
const typename T::FERequirement& req,
564 typename T::AffordanceCollectionType affordance,
DBCOption dbcOption) {
565 { t.matrix(req, affordance.matrixAffordance(), dbcOption) };
566 { t.matrix(dbcOption) };
573 typename DC::GridView;
574 { dc.update() } -> std::same_as<void>;
575 { dc.numPoints() } -> std::convertible_to<std::uint64_t>;
576 { dc.numCells() } -> std::convertible_to<std::uint64_t>;
577 { dc.gridView() } -> std::same_as<const typename DC::GridView&>;
590 template <
typename T>
591 struct is_dual : std::false_type
596 template <
typename T,
typename U>
597 struct is_dual<autodiff::detail::Dual<T, U>> : std::true_type
607 template <
typename T>
Contains stl-like type traits.
#define MAKE_EIGEN_FIXED_MATRIX_CONCEPT(Size1, Size2)
Definition: concepts.hh:377
#define MAKE_EIGEN_FIXED_MATRIX_OR_VOIGT_CONCEPT(Size1, Size2)
Definition: concepts.hh:419
#define MAKE_EIGEN_FIXED_VECTOR_CONCEPT(Size)
Definition: concepts.hh:365
Definition of several material related enums.
Definition: assemblermanipulatorbuildingblocks.hh:22
DBCOption
Definition: dirichletbcenforcement.hh:7
NonLinearOperator(const Impl::Functions< DerivativeArgs &&... > &a, const Impl::Parameter< ParameterArgs... > &b) -> NonLinearOperator< Impl::Functions< DerivativeArgs... >, Impl::Parameter< ParameterArgs... > >
auto transpose(const Eigen::EigenBase< Derived > &A)
constexpr std::string toString(DBCOption _e)
Definition: dirichletbcenforcement.hh:7
Definition: truncatedconjugategradient.hh:24
static constexpr bool isReduced
Static constant for determining if the material has vanishing stress or strain components (is reduced...
Definition: finiteelements/mechanics/materials/interface.hh:86
Definition: concepts.hh:30
Concept to check if a basis uses FlatInterleaved indexing strategy.
Definition: concepts.hh:50
Concept to check if a node in a basis tree is a Lagrangian node.
Definition: concepts.hh:82
Definition: concepts.hh:92
Concept to check if a basis uses FlatLexicographic indexing strategy.
Definition: concepts.hh:103
Concept to check if a basis uses FlatIndex indexing strategy.
Definition: concepts.hh:116
Concept to check if a basis uses BlockedInterleaved indexing strategy.
Definition: concepts.hh:127
Concept to check if a basis uses BlockedLexicographic indexing strategy.
Definition: concepts.hh:140
Concept to check if a local basis is a duneLocalBasis.
Definition: concepts.hh:150
Concept to check if a basis uses either BlockedLexicographic or BlockedInterleaved indexing strategy.
Definition: concepts.hh:175
Concept defining the requirements for a path-following strategy.
Definition: concepts.hh:185
Concept to check if a type implements all the needed functions to be an adaptive step sizing method.
Definition: concepts.hh:200
Concept to check if a linear solver implements all the needed functions for given vector and matrix t...
Definition: concepts.hh:215
Concept to check if a non-linear solver with its non-linear operator satisfies requirements for path ...
Definition: concepts.hh:229
Concept defining the requirements for types that support multiplication.
Definition: concepts.hh:246
Concept defining the requirements for types that support addition.
Definition: concepts.hh:256
Concept defining the requirements for types that support subtraction.
Definition: concepts.hh:266
Concept defining the requirements for types that support in-place multiplication.
Definition: concepts.hh:277
Concept defining the requirements for types that support in-place division.
Definition: concepts.hh:288
Concept defining the requirements for types that support in-place addition.
Definition: concepts.hh:299
Concept defining the requirements for types that support in-place subtraction.
Definition: concepts.hh:310
Concept defining the requirements for types that support division.
Definition: concepts.hh:320
Concept defining the requirements for types that support negation.
Definition: concepts.hh:329
Concept defining the requirements for types that support transposition.
Definition: concepts.hh:338
Concept defining the requirements for functors with arguments.
Definition: concepts.hh:347
Concept defining the requirements for Eigen vectors.
Definition: concepts.hh:355
Concept defining the requirements for Eigen matrices. This also includes Eigen vectors.
Definition: concepts.hh:363
Concept defining the requirements for a material type.
Definition: concepts.hh:457
Concepts defining the requirements for a material to be geometrically linear This is the case when th...
Definition: concepts.hh:476
A concept to check if a template type satisfies the ResultType requirements.
Definition: concepts.hh:488
Concept representing the requirements for a FlatAssembler.A type T satisfies FlatAssembler if it prov...
Definition: concepts.hh:500
Concept representing the requirements for a ScalarFlatAssembler.A type T satisfies ScalarFlatAssemble...
Definition: concepts.hh:531
Concept representing the requirements for a VectorFlatAssembler.A type T satisfies VectorFlatAssemble...
Definition: concepts.hh:545
Concept representing the requirements for a MatrixFlatAssembler.A type T satisfies MatrixFlatAssemble...
Definition: concepts.hh:562
Definition: concepts.hh:572
Definition: concepts.hh:581
Concept to check if the underlying scalar type is a dual type.
Definition: concepts.hh:608