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>
35template <
typename Derived>
47 template <
typename Basis>
49 std::is_same_v<typename Basis::PreBasis::IndexMergingStrategy, Dune::Functions::BasisFactory::FlatInterleaved>;
53 template <
template <
typename,
int,
typename>
class U,
typename T>
54 struct LagrangeNodeHelper : std::false_type
57 template <
template <
typename,
int,
typename>
class U,
typename GV,
int k,
typename R>
58 struct LagrangeNodeHelper<U, U<GV, k, R>> : std::true_type
62 template <
template <
typename,
int,
typename>
class U,
typename T,
int k>
63 struct LagrangeNodeHelperOfOrder : std::false_type
66 template <
template <
typename,
int,
typename>
class U,
typename GV,
int k,
typename R>
67 struct LagrangeNodeHelperOfOrder<U, U<GV, k, R>, k> : std::true_type
80 concept LagrangeNode = Impl::LagrangeNodeHelper<Dune::Functions::LagrangeNode, N>::value;
89 template <
typename N,
int order>
90 concept LagrangeNodeOfOrder = Impl::LagrangeNodeHelperOfOrder<Dune::Functions::LagrangeNode, N, order>::value;
100 template <
typename B>
102 std::is_same_v<typename B::PreBasis::IndexMergingStrategy, Dune::Functions::BasisFactory::FlatLexicographic>;
113 template <
typename B>
124 template <
typename Basis>
126 std::is_same_v<typename Basis::PreBasis::IndexMergingStrategy, Dune::Functions::BasisFactory::BlockedInterleaved>;
137 template <
typename B>
139 std::is_same_v<typename B::PreBasis::IndexMergingStrategy, Dune::Functions::BasisFactory::BlockedLexicographic>;
147 template <
typename DLB>
149 typename DLB::Traits::RangeType;
150 typename DLB::Traits::JacobianType;
151 DLB::Traits::dimDomain;
152 typename DLB::Traits::DomainType;
154 typename DLB::Traits::DomainFieldType;
155 typename DLB::Traits::RangeFieldType;
157 duneLocalBasis.evaluateFunction(std::declval<typename DLB::Traits::DomainType>(),
158 std::declval<std::vector<typename DLB::Traits::RangeType>&>());
159 duneLocalBasis.evaluateJacobian(std::declval<typename DLB::Traits::DomainType>(),
160 std::declval<std::vector<typename DLB::Traits::JacobianType>&>());
172 template <
typename B>
182 template <
typename PF,
typename NLO,
typename SA>
184 { pft(args) } -> std::same_as<void>;
185 { pft.initialPrediction(nop, args) } -> std::same_as<void>;
186 { pft.intermediatePrediction(nop, args) } -> std::same_as<void>;
197 template <
typename ASS,
typename NLSI,
typename SA,
typename NonLinearOperator>
199 { adaptiveStepSizing(info, args, nop) } -> std::same_as<void>;
200 { adaptiveStepSizing.targetIterations() } -> std::same_as<int>;
201 { adaptiveStepSizing.setTargetIterations(std::declval<int>()) } -> std::same_as<void>;
212 template <
typename LS,
typename M,
typename V>
214 linearSolver.analyzePattern(A);
215 linearSolver.factorize(A);
216 linearSolver.solve(vec, vec);
226 template <
typename NLS>
228 std::tuple_size<typename NLS::NonLinearOperator::ParameterValues>::value == 2;
229 not(std::is_same_v<typename NLS::NonLinearOperator::ValueType, double> and
230 ((traits::isSpecializationTypeAndNonTypes<Eigen::Matrix,
231 typename NLS::NonLinearOperator::DerivativeType>::value) or
232 (traits::isSpecializationTypeNonTypeAndType<Eigen::SparseMatrix,
233 typename NLS::NonLinearOperator::DerivativeType>::value)));
243 template <
typename L,
typename R>
253 template <
typename L,
typename R>
254 concept AddAble =
requires(L x, R y) { x + y; };
263 template <
typename L,
typename R>
274 template <
typename L,
typename R>
285 template <
typename L,
typename R>
296 template <
typename L,
typename R>
307 template <
typename L,
typename R>
317 template <
typename L,
typename R>
326 template <
typename L>
335 template <
typename L>
344 template <
typename Op,
typename... Args>
352 template <
typename V>
353 concept EigenVector =
static_cast<bool>(V::IsVectorAtCompileTime);
360 template <
typename M>
361 concept EigenMatrix = traits::isSpecializationTypeAndNonTypes<Eigen::Matrix, M>::value;
363#define MAKE_EIGEN_FIXED_VECTOR_CONCEPT(Size) \
364 template <typename V> \
365 concept EigenVector##Size = \
366 static_cast<bool>(V::IsVectorAtCompileTime) and static_cast<bool>(V::SizeAtCompileTime == Size);
375#define MAKE_EIGEN_FIXED_MATRIX_CONCEPT(Size1, Size2) \
376 template <typename M> \
377 concept EigenMatrix##Size1##Size2 = static_cast<bool>(std::remove_cvref_t<M>::RowsAtCompileTime == Size1) and \
378 static_cast<bool>(std::remove_cvref_t<M>::ColsAtCompileTime == Size2);
417#define MAKE_EIGEN_FIXED_MATRIX_OR_VOIGT_CONCEPT(Size1, Size2) \
418 template <typename M> \
419 concept EigenMatrixOrVoigtNotation##Size1 = EigenMatrix##Size1##Size1<M> or EigenVector##Size2<M>;
426 template <
template <
typename...>
class MaterialToCheck,
typename Material>
427 consteval bool isMaterial() {
428 if constexpr (traits::isSpecialization<MaterialToCheck, Material>::value)
431 if constexpr (Material::isReduced) {
432 if constexpr (traits::isSpecialization<MaterialToCheck, typename Material::Underlying>::value) {
454 template <
template <
typename...>
class MaterialToCheck,
typename Material>
455 concept IsMaterial = Impl::isMaterial<MaterialToCheck, Material>();
458 template <
typename T>
461 typename T::Vectorizer;
462 typename T::Matricizer;
463 {
toString(t) } -> std::same_as<std::string>;
473 template <
typename MAT>
485 template <
template <
typename,
int,
int>
typename RT>
487 Impl::ResultType<RT<double, 1, 1>> or Impl::ResultType<RT<double, 1, 2>> or Impl::ResultType<RT<double, 1, 3>> or
488 Impl::ResultType<RT<double, 2, 3>> or Impl::ResultType<RT<double, 3, 3>>;
497 template <
typename T>
499 typename T::AffordanceCollectionType affordance,
DBCOption dbcOption) {
500 { t.requirement() } -> std::convertible_to<typename T::FERequirement&>;
501 { t.affordanceCollection() } -> std::convertible_to<typename T::AffordanceCollectionType>;
502 { t.dBCOption() } -> std::convertible_to<DBCOption>;
504 { t.bind(req, affordance, dbcOption) } -> std::same_as<void>;
505 { t.bind(req) } -> std::same_as<void>;
506 { t.bind(affordance) } -> std::same_as<void>;
507 { t.bind(dbcOption) } -> std::same_as<void>;
509 { t.bound() } -> std::convertible_to<bool>;
510 { t.boundToRequirement() } -> std::convertible_to<bool>;
511 { t.boundToAffordanceCollection() } -> std::convertible_to<bool>;
512 { t.boundToDBCOption() } -> std::convertible_to<bool>;
513 { t.estimateOfConnectivity() } -> std::convertible_to<size_t>;
515 { t.createFullVector(std::declval<Eigen::Ref<const Eigen::VectorXd>>()) } -> std::convertible_to<Eigen::VectorXd>;
516 { t.constraintsBelow(std::declval<size_t>()) } -> std::convertible_to<size_t>;
517 { t.isConstrained(std::declval<size_t>()) } -> std::convertible_to<bool>;
518 { t.size() } -> std::convertible_to<size_t>;
519 { t.reducedSize() } -> std::convertible_to<size_t>;
528 template <
typename T>
531 typename T::AffordanceCollectionType affordance,
DBCOption dbcOption) {
532 { t.scalar(req, affordance.scalarAffordance()) } -> std::convertible_to<const double&>;
533 { t.scalar() } -> std::convertible_to<const double&>;
542 template <
typename T>
544 requires(T t,
const typename T::FERequirement& req,
545 typename T::AffordanceCollectionType affordance,
DBCOption dbcOption) {
547 t.vector(req, affordance.vectorAffordance(), dbcOption)
548 } -> std::convertible_to<const Eigen::VectorXd&>;
549 { t.vector(dbcOption) } -> std::convertible_to<const Eigen::VectorXd&>;
550 { t.vector() } -> std::convertible_to<const Eigen::VectorXd&>;
559 template <
typename T>
561 requires(T t,
const typename T::FERequirement& req,
562 typename T::AffordanceCollectionType affordance,
DBCOption dbcOption) {
563 { t.matrix(req, affordance.matrixAffordance(), dbcOption) };
564 { t.matrix(dbcOption) };
571 typename DC::GridView;
572 { dc.update() } -> std::same_as<void>;
573 { dc.numPoints() } -> std::convertible_to<std::uint64_t>;
574 { dc.numCells() } -> std::convertible_to<std::uint64_t>;
575 { dc.gridView() } -> std::same_as<const typename DC::GridView&>;
588 template <
typename T>
589 struct is_dual : std::false_type
594 template <
typename T,
typename U>
595 struct is_dual<autodiff::detail::Dual<T, U>> : std::true_type
605 template <
typename T>
Contains stl-like type traits.
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
Definition: utils/concepts.hh:30
Concept to check if a basis uses FlatInterleaved indexing strategy.
Definition: utils/concepts.hh:48
Concept to check if a node in a basis tree is a Lagrangian node.
Definition: utils/concepts.hh:80
Definition: utils/concepts.hh:90
Concept to check if a basis uses FlatLexicographic indexing strategy.
Definition: utils/concepts.hh:101
Concept to check if a basis uses FlatIndex indexing strategy.
Definition: utils/concepts.hh:114
Concept to check if a basis uses BlockedInterleaved indexing strategy.
Definition: utils/concepts.hh:125
Concept to check if a basis uses BlockedLexicographic indexing strategy.
Definition: utils/concepts.hh:138
Concept to check if a local basis is a duneLocalBasis.
Definition: utils/concepts.hh:148
Concept to check if a basis uses either BlockedLexicographic or BlockedInterleaved indexing strategy.
Definition: utils/concepts.hh:173
Concept defining the requirements for a path-following strategy.
Definition: utils/concepts.hh:183
Concept to check if a type implements all the needed functions to be an adaptive step sizing method.
Definition: utils/concepts.hh:198
Concept to check if a linear solver implements all the needed functions for given vector and matrix t...
Definition: utils/concepts.hh:213
Concept to check if a non-linear solver with its non-linear operator satisfies requirements for path ...
Definition: utils/concepts.hh:227
Concept defining the requirements for types that support multiplication.
Definition: utils/concepts.hh:244
Concept defining the requirements for types that support addition.
Definition: utils/concepts.hh:254
Concept defining the requirements for types that support subtraction.
Definition: utils/concepts.hh:264
Concept defining the requirements for types that support in-place multiplication.
Definition: utils/concepts.hh:275
Concept defining the requirements for types that support in-place division.
Definition: utils/concepts.hh:286
Concept defining the requirements for types that support in-place addition.
Definition: utils/concepts.hh:297
Concept defining the requirements for types that support in-place subtraction.
Definition: utils/concepts.hh:308
Concept defining the requirements for types that support division.
Definition: utils/concepts.hh:318
Concept defining the requirements for types that support negation.
Definition: utils/concepts.hh:327
Concept defining the requirements for types that support transposition.
Definition: utils/concepts.hh:336
Concept defining the requirements for functors with arguments.
Definition: utils/concepts.hh:345
Concept defining the requirements for Eigen vectors.
Definition: utils/concepts.hh:353
Concept defining the requirements for Eigen matrices. This also includes Eigen vectors.
Definition: utils/concepts.hh:361
Concept defining the requirements for a material type.
Definition: utils/concepts.hh:455
Concepts defining the requirements for a material to be geometrically linear This is the case when th...
Definition: utils/concepts.hh:474
A concept to check if a template type satisfies the ResultType requirements.
Definition: utils/concepts.hh:486
Concept representing the requirements for a FlatAssembler.A type T satisfies FlatAssembler if it prov...
Definition: utils/concepts.hh:498
Concept representing the requirements for a ScalarFlatAssembler.A type T satisfies ScalarFlatAssemble...
Definition: utils/concepts.hh:529
Concept representing the requirements for a VectorFlatAssembler.A type T satisfies VectorFlatAssemble...
Definition: utils/concepts.hh:543
Concept representing the requirements for a MatrixFlatAssembler.A type T satisfies MatrixFlatAssemble...
Definition: utils/concepts.hh:560
Definition: utils/concepts.hh:570
Definition: utils/concepts.hh:579
Concept to check if the underlying scalar type is a dual type.
Definition: utils/concepts.hh:606
#define MAKE_EIGEN_FIXED_MATRIX_CONCEPT(Size1, Size2)
Definition: utils/concepts.hh:375
#define MAKE_EIGEN_FIXED_MATRIX_OR_VOIGT_CONCEPT(Size1, Size2)
Definition: utils/concepts.hh:417
#define MAKE_EIGEN_FIXED_VECTOR_CONCEPT(Size)
Definition: utils/concepts.hh:363