dune-fem 2.12-git
Loading...
Searching...
No Matches
evaluatecaller.hh
Go to the documentation of this file.
1#ifndef DUNE_FEM_EVALUATECALLER_HH
2#define DUNE_FEM_EVALUATECALLER_HH
3
4#include <cstdlib>
5#include <iostream>
6#include <memory>
7#include <vector>
8
11
13
17
18//#ifdef USE_BASEFUNCTIONSET_CODEGEN
19//#ifndef DUNE_FEM_INCLUDE_AUTOGENERATEDCODE_FILENAME_SPEC
20// default filename for autogenerated code is simply autogeneratedcode.hh
21// this filename is overloaded by the codegeneration for the python modules
22//#include <autogeneratedcode.hh>
23//#endif
24
25#ifdef DUNE_FEM_INCLUDE_AUTOGENERATEDCODE_FILENAME_SPEC
26#define CODEGEN_INCLUDEMAXNUMS
27// include max number definitions
28#include DUNE_FEM_INCLUDE_AUTOGENERATEDCODE_FILENAME_SPEC
29#undef CODEGEN_INCLUDEMAXNUMS
30#endif
31
33//
34// pre-define these values for faster compilation
35//
37#ifndef MAX_NUMBER_OF_QUAD_POINTS
38#define MAX_NUMBER_OF_QUAD_POINTS 20
39#endif
40
41#ifndef MAX_NUMBER_OF_BASE_FCT
42#define MAX_NUMBER_OF_BASE_FCT 20
43#endif
44
45#ifndef MIN_NUMBER_OF_QUAD_POINTS
46#define MIN_NUMBER_OF_QUAD_POINTS 1
47#endif
48
49#ifndef MIN_NUMBER_OF_BASE_FCT
50#define MIN_NUMBER_OF_BASE_FCT 1
51#endif
52
54
55#ifdef DUNE_FEM_INCLUDE_AUTOGENERATEDCODE_FILENAME_SPEC
56// defined in evaluatecaller.hh
57#include DUNE_FEM_INCLUDE_AUTOGENERATEDCODE_FILENAME_SPEC
58#endif // DUNE_FEM_INCLUDE_AUTOGENERATEDCODE_FILENAME_SPEC
59
60namespace Dune
61{
62 namespace Fem
63 {
64 namespace Codegen
65 {
66
67 // forward declaration
68 template <class Traits,
69 int quadNop,
70 int numBaseFct >
71 class EvaluateCaller;
72
73 template< class QuadratureImp,
74 class FactorImp,
75 class LocalDofVectorImp,
76 class GeometryImp = EmptyGeometry >
78 {
80 typedef FactorImp FactorType;
81 typedef LocalDofVectorImp LocalDofVectorType;
82 typedef GeometryImp Geometry;
83 };
84
85 template <class Traits,
86 class BaseFunctionSet,
87 class RangeVectorImp>
89 {
90 typedef Traits BaseTraits;
91 typedef typename Traits :: QuadratureType QuadratureType ;
92 typedef typename Traits :: FactorType FactorType ;
93 typedef typename Traits :: LocalDofVectorType LocalDofVectorType ;
94 typedef typename Traits :: Geometry Geometry ;
95
96 typedef BaseFunctionSet BaseFunctionSetType;
97 typedef RangeVectorImp RangeVectorType;
98 };
99
100
101 //- base function evaluation interface
102 template <class Traits>
104 {
106 public:
108
109 protected:
112
115
116 // maximal number of different quadratures we can use here
117 static const int maxQuadratures = 25;
118
120 {
121 class Item : public std::pair< bool, StoragePointerType >
122 {
124
125 public:
126 Item() : BaseType(false, StoragePointerType() ) {}
127 };
128
129 protected:
131 public:
134
135 Item& get( const size_t id )
136 {
137 if( id >= storage_.size() )
138 {
139 storage_.resize( id + 10 );
140 }
141 return storage_[ id ];
142 }
143 };
144
145
147
148 public:
149 typedef typename Traits :: QuadratureType QuadratureType ;
150 typedef typename Traits :: FactorType FactorType ;
151 typedef typename Traits :: LocalDofVectorType LocalDofVectorType ;
152 typedef typename Traits :: Geometry Geometry ;
153
155
156 virtual void* storageAddress () const = 0;
157 virtual size_t storageSize () const = 0;
158
159 virtual void axpyRanges( const QuadratureType&,
160 const FactorType& ,
161 LocalDofVectorType & ) const = 0;
162
163 virtual void evaluateRanges( const QuadratureType& quad,
164 const LocalDofVectorType & dofs,
165 FactorType& factors) const = 0;
166
167 virtual void axpyJacobians( const QuadratureType&,
168 const Geometry&,
169 const FactorType& ,
170 LocalDofVectorType & ) const = 0;
171
172 virtual void evaluateJacobians( const QuadratureType&,
173 const Geometry&,
174 const LocalDofVectorType&,
175 FactorType&) const = 0;
176
177 template < class BaseFunctionSet, class Storage >
178 static const StoragePointerType& storage(const BaseFunctionSet& baseSet,
179 const Storage& dataCache,
180 const QuadratureType& quad)
181 {
182 // static vector holding all evaluator instances
183 static ThreadSafeValue< EvaluatorStorage > evaluatorStorage;
184 EvaluatorStorage& evaluators = *evaluatorStorage;
185
186 // check if object already created
187 const size_t quadId = quad.id();
188 auto& item = evaluators.get( quadId );
189 if( ! item.first )
190 {
191 const int nop = quad.nop();
192 static const int dimRange = BaseFunctionSet :: FunctionSpaceType:: dimRange;
193 const int numBaseFct = baseSet.size() / dimRange;
194
196
197#if 0 // NDEBUG
198 if( quad.isInterpolationQuadrature( numBaseFct ) )
199 std::cout << "EvaluateCallerInterface::storage: Not creating implementation because of interpolation feature!" <<std::endl;
200#endif
201
202 // if quadrature points or number of basis functions are not within
203 // the range of generated code snippets then don't search for
204 // a matching combination
205 // do not create an evaluation if the quadrature is an interpolation
206 // quadrature and matches the number of shape functions
207 if( (nop >= minQuadNop && nop <= maxQuadNop) &&
208 (numBaseFct >= minNumBaseFunctions && numBaseFct <= maxNumBaseFunctions) &&
209 ! quad.isInterpolationQuadrature( numBaseFct ) )
210 {
211 item.second.reset(
213 :: create( dataCache , nop, numBaseFct ) );
214 }
215
216 // if pointer was checked, set flag to true, pointer may still be a nullptr
217 item.first = true;
218 }
219
220 // this can be a nullptr (in this case the default implementation is used)
221 return item.second;
222 }
223 };
224
225 template <class Traits,
226 int dimRange,
227 int quadNop,
228 int numBaseFct >
230 : public EvaluateCallerInterface< typename Traits :: BaseTraits >
231 {
232 protected:
233 typedef typename Traits :: BaseFunctionSetType BaseFunctionSetType;
234 typedef typename Traits :: QuadratureType QuadratureType ;
235 typedef typename Traits :: FactorType FactorType ;
236 typedef typename Traits :: LocalDofVectorType LocalDofVectorType ;
237 typedef typename Traits :: Geometry Geometry ;
238 typedef typename Traits :: RangeVectorType RangeVectorType ;
239 typedef typename RangeVectorType :: value_type :: field_type FieldType;
240
243
244 // A copy is made of the storage here, otherwise strange memory corruptions happen
245 // TODO: needs further investigation
246 RangeVectorType rangeStorage_; // basis function evaluations
247
251
252 template <class K>
253 int getDim( const DenseVector< K >& vec) const
254 {
255 return vec.size();
256 }
257
258 template <class K>
259 int getDim( const DenseMatrix< K >& mat) const
260 {
261 // dimRange == rows which is 1 for basis storage
262 return getDim( mat[ 0 ] );
263 }
264
265 // initialize storage for ranges (i.e. scalar)
267 {
268 assert( rangeStorage_[ 0 ].size() == 1 );
269 {
270 const int quadPoints = rangeStorage_.size() / numBaseFct;
271 const int faces = quadPoints / quadNop;
273 for( int f=0; f<faces; ++f )
274 {
275 auto& rangeStorageTransposed = rangeStorageTransposed_[ f ];
276
277 // rearrange such that we store for one basis functions all
278 // evaluations for all quadrature points, i.e. numBaseFct * quadNop
279 rangeStorageTransposed.resize( numBaseFct * quadNop );
280 for( int i=0; i<numBaseFct; ++i )
281 {
282 const int idx = i * quadNop;
283 for( int j=0; j<quadNop; ++j )
284 {
285 int qp = f * quadNop + j ;
286 assert( j*numBaseFct + i < int(rangeStorage_.size()) );
287 // copy and transpose
288 rangeStorageTransposed[ idx + j ] = rangeStorage_[ qp*numBaseFct + i ][ 0 ];
289 }
290 }
291 }
292 }
293 }
294
295 // initialize storage for jacobians (i.e. vectors)
297 {
298 const int dim = rangeStorage_[ 0 ][ 0 ].size();
299 {
300 const int quadPoints = rangeStorage_.size() / numBaseFct;
301 const int faces = quadPoints / quadNop;
303 rangeStorageFlat_.resize( faces );
304 for( int f=0; f<faces; ++f )
305 {
306 auto& rangeStorageTransposed = rangeStorageTransposed_[ f ];
307 auto& rangeStorageFlat = rangeStorageFlat_[ f ];
308
309 // rearrange such that we store for one basis functions all
310 // evaluations for all quadrature points, i.e. numBaseFct * quadNop
311 rangeStorageTransposed.resize( numBaseFct * quadNop * dim );
312 rangeStorageFlat.resize( numBaseFct * quadNop * dim );
313 for( int i=0; i<numBaseFct; ++i )
314 {
315 const int idx = i * (quadNop * dim);
316 for( int j=0; j<quadNop; ++j )
317 {
318 int qp = f * quadNop + j ;
319 for( int d=0; d<dim; ++d )
320 {
321 rangeStorageFlat[ j*numBaseFct*dim + (i * dim) + d ] = rangeStorage_[ qp*numBaseFct + i ][ 0 ][ d ];
322 rangeStorageTransposed[ idx + (j * dim) + d ] = rangeStorage_[ qp*numBaseFct + i ][ 0 ][ d ];
323 }
324 }
325 }
326 }
327 }
328 }
329
330 template <class Quadrature>
331 //const DynamicArray< FieldType >&
333 getTwistedStorage( const Quadrature& quad ) const
334 {
335 // for evaluation the range storage dimension should be 1 and therefore
336 // rangeStorageTransposed should have been filled
337 assert( ! rangeStorageTransposed_.empty() );
338
339 // if we are in the ranges cases then basis can be stored transposed
340 // quadrature points is the outer loop
341 if constexpr ( Quadrature::twisted() )
342 {
343 if( quad.twistId() == 4 ) // no twist
344 return rangeStorageTransposed_[ quad.localFaceIndex() ];
345
346 auto& rangeStorageTwisted = rangeStorageTwisted_[ quad.twistId() ];
347 if( rangeStorageTwisted.empty() )
348 {
349 const int quadPoints = rangeStorage_.size() / numBaseFct;
350 const int faces = quadPoints / quadNop;
351 rangeStorageTwisted.resize( faces );
352 }
353
354 const int f = quad.localFaceIndex() ;
355 auto& rangeStorageFace = rangeStorageTwisted[ f ];
356 if( rangeStorageFace.empty() )
357 {
358 // either 1 or dim of grid
359 const int dim = getDim( rangeStorage_[ 0 ] );
360
361 const auto& rangeStorageTransposed = rangeStorageTransposed_[ f ];
362
363 // rearrange such that we store for one basis functions all
364 // evaluations for all quadrature points including the twisted mapping
365 rangeStorageFace.resize( rangeStorageTransposed.size() );
366 for( int i=0; i<numBaseFct; ++i )
367 {
368 const int idx = i * (quadNop * dim);
369 for( int j=0; j<quadNop; ++j )
370 {
371 const int qp = quad.localCachingPoint( j );
372 for( int d=0; d<dim; ++d )
373 {
374 rangeStorageFace[ idx + (j * dim) + d ] = rangeStorageTransposed[ idx + (qp * dim) + d ];
375 }
376 }
377 }
378 } // end if( rangeStorageTwisted.empty() )
379 return rangeStorageFace;
380 }
381 else // no twist (i.e. twist = 0 and twistId == 4 (-4 is mapped to 0))
382 {
383 return rangeStorageTransposed_[ quad.localFaceIndex() ];
384 }
385 }
386 public:
387 // type of interface class
389
391 : rangeStorage_( rangeStorage ), rangeStorageTwisted_( 8 ) // 8 different twists
392 {
394 std::is_same< typename RangeVectorType::value_type,
395 Dune::FieldVector< double, 1 > > :: value > () );
396 }
397
398 virtual void* storageAddress() const { return (void *) &rangeStorage_ ; }
399 virtual size_t storageSize() const { return rangeStorage_.size() ; }
400
401 virtual void axpyRanges( const QuadratureType& quad,
402 const FactorType& rangeFactors,
403 LocalDofVectorType & dofs ) const
404 {
406 ( quad, rangeStorage_, rangeFactors, dofs );
407 }
408
409 virtual void evaluateRanges( const QuadratureType& quad,
410 const LocalDofVectorType & dofs,
411 FactorType& rangeFactors) const
412 {
414 :: eval ( quad, getTwistedStorage( quad ), dofs, rangeFactors );
415 }
416
417 virtual void axpyJacobians( const QuadratureType& quad,
418 const Geometry& geometry,
419 const FactorType& jacFactors,
421 {
423 ( quad, geometry, rangeStorageFlat_[ quad.localFaceIndex() ], jacFactors, dofs );
424 }
425
426 virtual void evaluateJacobians( const QuadratureType& quad,
427 const Geometry& geometry,
429 FactorType& jacFactors) const
430 {
432 ( quad, geometry, getTwistedStorage( quad ), dofs, jacFactors );
433 }
434
435 static InterfaceType* create( const RangeVectorType& rangeStorage )
436 {
437 return new ThisType( rangeStorage );
438 }
439 };
440
441 // The default EvaluateImplementation is empty
442 // to create this has to be specified and derived from EvaluateCallerDefault
443 template <class Traits,
444 int dimRange,
445 int quadNop,
446 int numBaseFct >
448 : public EvaluateCallerInterface< typename Traits :: BaseTraits >
449 {
450 protected:
451 typedef typename Traits :: BaseFunctionSetType BaseFunctionSetType;
452 typedef typename Traits :: QuadratureType QuadratureType ;
453 typedef typename Traits :: FactorType FactorType ;
454 typedef typename Traits :: LocalDofVectorType LocalDofVectorType ;
455 typedef typename Traits :: Geometry Geometry ;
456 typedef typename Traits :: RangeVectorType RangeVectorType ;
457
459
461 public:
462 // type of interface class
464
466 {}
467
468 virtual void axpyRanges( const QuadratureType& quad,
469 const FactorType& rangeFactors,
470 LocalDofVectorType & dofs ) const
471 {
472 std::cerr << "ERROR: EvaluateImplementation::axpyRanges not overloaded!" << std::endl;
473 std::abort();
474 }
475
476 virtual void axpyJacobians( const QuadratureType& quad,
477 const Geometry& geometry,
478 const FactorType& jacFactors,
480 {
481 std::cerr << "ERROR: EvaluateImplementation::axpyJacobians not overloaded!" << std::endl;
482 std::abort();
483 }
484
485 virtual void evaluateRanges( const QuadratureType& quad,
486 const LocalDofVectorType & dofs,
487 FactorType& rangeFactors) const
488 {
489 std::cerr << "ERROR: EvaluateImplementation::evaluateRanges not overloaded!" << std::endl;
490 std::abort();
491 }
492
493 virtual void evaluateJacobians( const QuadratureType& quad,
494 const Geometry& geometry,
496 FactorType& jacFactors) const
497 {
498 std::cerr << "ERROR: EvaluateImplementation::evaluateJacobians not overloaded!" << std::endl;
499 std::abort();
500 }
501
503 {
504 #ifndef NDEBUG
505 std::cout << "Optimized EvaluateImplementation for < dimR="<<dimRange<< ", qp=" << quadNop << ", bases=" << numBaseFct << " > not created, falling back to default!" << std::endl;
506 //DUNE_THROW(NotImplemented,"EvaluateImplementation for < " << quadNop << " , " << numBaseFct << " > not created!");
507 //return (InterfaceType*) 0;
508 #endif
509 return nullptr;
510 }
511 };
512
513 template <class Traits,
514 int quadNop,
515 int numBaseFct >
517 {
518 protected:
519 typedef typename Traits :: BaseFunctionSetType BaseFunctionSetType;
520 static const int dimRange = BaseFunctionSetType :: FunctionSpaceType:: dimRange;
521 typedef typename Traits :: RangeVectorType RangeVectorType ;
523 public:
524 static InterfaceType* createObj( const RangeVectorType& rangeStorage,
525 const size_t numbase )
526 {
527 if( numBaseFct == numbase )
529 else
531 }
532
533 static InterfaceType* create( const RangeVectorType& rangeStorage,
534 const size_t quadnop, const size_t numbase )
535 {
536 if( quadNop == quadnop )
538 else
539 return EvaluateCaller< Traits, quadNop - 1, numBaseFct > :: create( rangeStorage, quadnop, numbase );
540 }
541 };
542
543 template <class Traits,
544 int numBaseFct >
545 class EvaluateCaller< Traits, MIN_NUMBER_OF_QUAD_POINTS, numBaseFct >
546 {
547 protected:
548 typedef typename Traits :: BaseFunctionSetType BaseFunctionSetType;
549 static const int dimRange = BaseFunctionSetType :: FunctionSpaceType:: dimRange;
550 enum { quadNop = MIN_NUMBER_OF_QUAD_POINTS };
551 typedef typename Traits :: RangeVectorType RangeVectorType ;
553 public:
554 static InterfaceType* createObj( const RangeVectorType& rangeStorage,
555 const size_t numbase )
556 {
557 if( numBaseFct == numbase )
559 else
561 }
562
563 static InterfaceType* create( const RangeVectorType& rangeStorage,
564 const size_t quadnop, const size_t numbase )
565 {
566 if( quadNop == quadnop )
568 else
569 {
570 std::cerr << "ERROR: EvaluateCaller< "<< quadNop << ", " << numBaseFct << " >::createObj: no working combination!" << std::endl;
571 std::abort();
572 }
573 }
574 };
575
576 template <class Traits,
577 int quadNop>
578 class EvaluateCaller< Traits, quadNop, MIN_NUMBER_OF_BASE_FCT >
579 {
580 protected:
581 typedef typename Traits :: BaseFunctionSetType BaseFunctionSetType;
582 static const int dimRange = BaseFunctionSetType :: FunctionSpaceType:: dimRange;
583 enum { numBaseFct = MIN_NUMBER_OF_BASE_FCT };
584 typedef typename Traits :: RangeVectorType RangeVectorType ;
586 public:
587 static InterfaceType* createObj( const RangeVectorType& rangeStorage,
588 const size_t numbase )
589 {
590 if( numBaseFct == numbase )
592 else
593 {
594 std::cerr << "ERROR: EvaluateCaller< "<< quadNop << ", " << numBaseFct << " >::createObj: no working combination!" << std::endl;
595 std::abort();
596 }
597 }
598
599 static InterfaceType* create( const RangeVectorType& rangeStorage,
600 const size_t quadnop, const size_t numbase )
601 {
602 if( quadNop == quadnop )
604 else
605 {
606 return EvaluateCaller< Traits, quadNop - 1, numBaseFct > :: create( rangeStorage, quadnop, numbase );
607 }
608 }
609 };
610
611 template <class Traits>
613 {
614 protected:
615 typedef typename Traits :: BaseFunctionSetType BaseFunctionSetType;
616 static const int dimRange = BaseFunctionSetType :: FunctionSpaceType:: dimRange;
617 enum { quadNop = MIN_NUMBER_OF_QUAD_POINTS };
618 enum { numBaseFct = MIN_NUMBER_OF_BASE_FCT };
619 typedef typename Traits :: RangeVectorType RangeVectorType ;
621 public:
622 static InterfaceType* createObj( const RangeVectorType& rangeStorage,
623 const size_t numbase )
624 {
625 if( numBaseFct == numbase )
627 else
628 {
629 std::cerr << "ERROR: EvaluateCaller< "<< quadNop << ", " << numBaseFct << " >::createObj: no working combination!" << std::endl;
630 std::abort();
631 }
632 }
633
634 static InterfaceType* create( const RangeVectorType& rangeStorage,
635 const size_t quadnop, const size_t numbase )
636 {
637 if( quadNop == quadnop )
639 else
640 {
641 std::cerr << "ERROR: EvaluateCaller< "<< quadNop << ", " << numBaseFct << " >::create: no working combination!" << std::endl;
642 std::abort();
643 }
644 }
645 };
646
647 } // namespace Codegen
648
649 } // namespace Fem
650
651} // namespace Dune
652
653#ifdef DUNE_FEM_INCLUDE_AUTOGENERATEDCODE_FILENAME_SPEC
654#define CODEGEN_INCLUDEEVALCALLERS
655// include specializations of EvaluateImplementation
656#include DUNE_FEM_INCLUDE_AUTOGENERATEDCODE_FILENAME_SPEC
657#undef CODEGEN_INCLUDEEVALCALLERS
658#endif
659#endif // #ifndef DUNE_FEM_EVALUATECALLER_HH
Matrix & mat
int id()
static type * create(const M &mat, bool verbose, bool reusevector)
int size() const
size_type dim() const
#define MIN_NUMBER_OF_QUAD_POINTS
Definition evaluatecaller.hh:46
#define MIN_NUMBER_OF_BASE_FCT
Definition evaluatecaller.hh:50
#define MAX_NUMBER_OF_BASE_FCT
Definition evaluatecaller.hh:42
#define MAX_NUMBER_OF_QUAD_POINTS
Definition evaluatecaller.hh:38
IteratorRange< typename DF::DofIteratorType > dofs(DF &df)
Iterates over all DOFs.
Definition rangegenerators.hh:76
constexpr size_type size() const
ThreadSafeValue realizes thread safety for a given variable by creating an instance of this variable ...
Definition threadsafevalue.hh:18
DenseMatrix based on std::vector< std::vector< T > >
Definition blockmatrix.hh:24
actual interface class for integration point lists
Definition quadrature.hh:158
Generic implementation of a Dune quadrature.
Definition quadratureimp.hh:196
Definition evaluatecaller.hh:517
static const int dimRange
Definition evaluatecaller.hh:520
EvaluateCallerInterface< typename Traits ::BaseTraits > InterfaceType
Definition evaluatecaller.hh:522
Traits::RangeVectorType RangeVectorType
Definition evaluatecaller.hh:521
static InterfaceType * create(const RangeVectorType &rangeStorage, const size_t quadnop, const size_t numbase)
Definition evaluatecaller.hh:533
static InterfaceType * createObj(const RangeVectorType &rangeStorage, const size_t numbase)
Definition evaluatecaller.hh:524
Traits::BaseFunctionSetType BaseFunctionSetType
Definition evaluatecaller.hh:519
GeometryImp Geometry
Definition evaluatecaller.hh:82
QuadratureImp QuadratureType
Definition evaluatecaller.hh:79
LocalDofVectorImp LocalDofVectorType
Definition evaluatecaller.hh:81
FactorImp FactorType
Definition evaluatecaller.hh:80
Definition evaluatecaller.hh:89
Traits::QuadratureType QuadratureType
Definition evaluatecaller.hh:91
Traits::LocalDofVectorType LocalDofVectorType
Definition evaluatecaller.hh:93
RangeVectorImp RangeVectorType
Definition evaluatecaller.hh:97
Traits BaseTraits
Definition evaluatecaller.hh:90
Traits::Geometry Geometry
Definition evaluatecaller.hh:94
Traits::FactorType FactorType
Definition evaluatecaller.hh:92
BaseFunctionSet BaseFunctionSetType
Definition evaluatecaller.hh:96
Definition evaluatecaller.hh:104
virtual void axpyJacobians(const QuadratureType &, const Geometry &, const FactorType &, LocalDofVectorType &) const =0
virtual ~EvaluateCallerInterface()
Definition evaluatecaller.hh:154
virtual void evaluateJacobians(const QuadratureType &, const Geometry &, const LocalDofVectorType &, FactorType &) const =0
virtual void axpyRanges(const QuadratureType &, const FactorType &, LocalDofVectorType &) const =0
static const int minNumBaseFunctions
Definition evaluatecaller.hh:111
static const int maxNumBaseFunctions
Definition evaluatecaller.hh:110
static const int maxQuadNop
Definition evaluatecaller.hh:113
Traits::Geometry Geometry
Definition evaluatecaller.hh:152
virtual void * storageAddress() const =0
static const int maxQuadratures
Definition evaluatecaller.hh:117
static const StoragePointerType & storage(const BaseFunctionSet &baseSet, const Storage &dataCache, const QuadratureType &quad)
Definition evaluatecaller.hh:178
Traits::QuadratureType QuadratureType
Definition evaluatecaller.hh:149
Traits::FactorType FactorType
Definition evaluatecaller.hh:150
virtual void evaluateRanges(const QuadratureType &quad, const LocalDofVectorType &dofs, FactorType &factors) const =0
static const int minQuadNop
Definition evaluatecaller.hh:114
EvaluateCallerInterface()
Definition evaluatecaller.hh:146
std::unique_ptr< ThisType > StoragePointerType
Definition evaluatecaller.hh:107
Traits::LocalDofVectorType LocalDofVectorType
Definition evaluatecaller.hh:151
Item & get(const size_t id)
Definition evaluatecaller.hh:135
std::vector< Item > storage_
Definition evaluatecaller.hh:130
Definition evaluatecaller.hh:231
Traits::QuadratureType QuadratureType
Definition evaluatecaller.hh:234
EvaluateRealImplementation(const RangeVectorType &rangeStorage)
Definition evaluatecaller.hh:390
virtual void axpyJacobians(const QuadratureType &quad, const Geometry &geometry, const FactorType &jacFactors, LocalDofVectorType &dofs) const
Definition evaluatecaller.hh:417
Traits::Geometry Geometry
Definition evaluatecaller.hh:237
Traits::FactorType FactorType
Definition evaluatecaller.hh:235
Traits::BaseFunctionSetType BaseFunctionSetType
Definition evaluatecaller.hh:233
EvaluateRealImplementation< Traits, dimRange, quadNop, numBaseFct > ThisType
Definition evaluatecaller.hh:241
static InterfaceType * create(const RangeVectorType &rangeStorage)
Definition evaluatecaller.hh:435
std::vector< std::vector< FieldType > > rangeStorageTransposed_
Definition evaluatecaller.hh:248
const std::vector< FieldType > & getTwistedStorage(const Quadrature &quad) const
Definition evaluatecaller.hh:333
virtual size_t storageSize() const
Definition evaluatecaller.hh:399
virtual void axpyRanges(const QuadratureType &quad, const FactorType &rangeFactors, LocalDofVectorType &dofs) const
Definition evaluatecaller.hh:401
std::vector< std::vector< std::vector< FieldType > > > rangeStorageTwisted_
Definition evaluatecaller.hh:250
BaseType InterfaceType
Definition evaluatecaller.hh:388
virtual void * storageAddress() const
Definition evaluatecaller.hh:398
std::vector< std::vector< FieldType > > rangeStorageFlat_
Definition evaluatecaller.hh:249
int getDim(const DenseVector< K > &vec) const
Definition evaluatecaller.hh:253
Traits::LocalDofVectorType LocalDofVectorType
Definition evaluatecaller.hh:236
RangeVectorType rangeStorage_
Definition evaluatecaller.hh:246
virtual void evaluateJacobians(const QuadratureType &quad, const Geometry &geometry, const LocalDofVectorType &dofs, FactorType &jacFactors) const
Definition evaluatecaller.hh:426
int getDim(const DenseMatrix< K > &mat) const
Definition evaluatecaller.hh:259
Traits::RangeVectorType RangeVectorType
Definition evaluatecaller.hh:238
virtual void evaluateRanges(const QuadratureType &quad, const LocalDofVectorType &dofs, FactorType &rangeFactors) const
Definition evaluatecaller.hh:409
void initRangeStorageTransposed(const std::integral_constant< bool, false >)
Definition evaluatecaller.hh:296
RangeVectorType::value_type::field_type FieldType
Definition evaluatecaller.hh:239
EvaluateCallerInterface< typename Traits ::BaseTraits > BaseType
Definition evaluatecaller.hh:242
void initRangeStorageTransposed(const std::integral_constant< bool, true >)
Definition evaluatecaller.hh:266
Definition evaluatecaller.hh:449
BaseType InterfaceType
Definition evaluatecaller.hh:463
Traits::Geometry Geometry
Definition evaluatecaller.hh:455
virtual void axpyJacobians(const QuadratureType &quad, const Geometry &geometry, const FactorType &jacFactors, LocalDofVectorType &dofs) const
Definition evaluatecaller.hh:476
EvaluateCallerInterface< typename Traits ::BaseTraits > BaseType
Definition evaluatecaller.hh:460
Traits::BaseFunctionSetType BaseFunctionSetType
Definition evaluatecaller.hh:451
EvaluateImplementation(const RangeVectorType &rangeStorage)
Definition evaluatecaller.hh:465
virtual void evaluateRanges(const QuadratureType &quad, const LocalDofVectorType &dofs, FactorType &rangeFactors) const
Definition evaluatecaller.hh:485
Traits::QuadratureType QuadratureType
Definition evaluatecaller.hh:452
virtual void axpyRanges(const QuadratureType &quad, const FactorType &rangeFactors, LocalDofVectorType &dofs) const
Definition evaluatecaller.hh:468
EvaluateImplementation< Traits, dimRange, quadNop, numBaseFct > ThisType
Definition evaluatecaller.hh:458
static InterfaceType * create(const RangeVectorType &)
Definition evaluatecaller.hh:502
Traits::RangeVectorType RangeVectorType
Definition evaluatecaller.hh:456
Traits::LocalDofVectorType LocalDofVectorType
Definition evaluatecaller.hh:454
virtual void evaluateJacobians(const QuadratureType &quad, const Geometry &geometry, const LocalDofVectorType &dofs, FactorType &jacFactors) const
Definition evaluatecaller.hh:493
Traits::FactorType FactorType
Definition evaluatecaller.hh:453
EvaluateCallerInterface< typename Traits ::BaseTraits > InterfaceType
Definition evaluatecaller.hh:552
static InterfaceType * createObj(const RangeVectorType &rangeStorage, const size_t numbase)
Definition evaluatecaller.hh:554
Traits::RangeVectorType RangeVectorType
Definition evaluatecaller.hh:551
static InterfaceType * create(const RangeVectorType &rangeStorage, const size_t quadnop, const size_t numbase)
Definition evaluatecaller.hh:563
Traits::BaseFunctionSetType BaseFunctionSetType
Definition evaluatecaller.hh:548
EvaluateCallerInterface< typename Traits ::BaseTraits > InterfaceType
Definition evaluatecaller.hh:585
static InterfaceType * createObj(const RangeVectorType &rangeStorage, const size_t numbase)
Definition evaluatecaller.hh:587
Traits::BaseFunctionSetType BaseFunctionSetType
Definition evaluatecaller.hh:581
Traits::RangeVectorType RangeVectorType
Definition evaluatecaller.hh:584
static InterfaceType * create(const RangeVectorType &rangeStorage, const size_t quadnop, const size_t numbase)
Definition evaluatecaller.hh:599
static InterfaceType * create(const RangeVectorType &rangeStorage, const size_t quadnop, const size_t numbase)
Definition evaluatecaller.hh:634
EvaluateCallerInterface< typename Traits ::BaseTraits > InterfaceType
Definition evaluatecaller.hh:620
static InterfaceType * createObj(const RangeVectorType &rangeStorage, const size_t numbase)
Definition evaluatecaller.hh:622
Traits::BaseFunctionSetType BaseFunctionSetType
Definition evaluatecaller.hh:615
Definition evaluatecallerdefaultimpl.hh:19
Definition evaluatecallerdefaultimpl.hh:61
Definition evaluatecallerdefaultimpl.hh:106
Definition evaluatecallerdefaultimpl.hh:148
T abort(T... args)
T empty(T... args)
T endl(T... args)
T resize(T... args)
T size(T... args)