dune-fem  2.8-git
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 
9 #include <dune/common/exceptions.hh>
10 #include <dune/common/fmatrix.hh>
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 
60 namespace 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:
107  typedef std::unique_ptr< ThisType > StoragePointerType;
108  typedef std::pair< bool, StoragePointerType > StorageItemType;
109 
110  protected:
113 
116 
117  // maximal number of different quadratures we can use here
118  static const int maxQuadratures = 50;
119 
121  {
122  protected:
123  std::vector< StorageItemType > storage_;
124  public:
127  {
128  for( auto& item : storage_ )
129  {
130  item.first = false ;
131  item.second.reset();
132  }
133  }
134 
135  StorageItemType& operator [] ( const int i ) { return storage_[ i ]; }
136  const StorageItemType& operator [] ( const int i ) const { return storage_[ i ]; }
137  };
138 
139 
141 
142  public:
143  typedef typename Traits :: QuadratureType QuadratureType ;
144  typedef typename Traits :: FactorType FactorType ;
145  typedef typename Traits :: LocalDofVectorType LocalDofVectorType ;
146  typedef typename Traits :: Geometry Geometry ;
147 
149 
150  virtual void* storageAddress () const = 0;
151  virtual size_t storageSize () const = 0;
152 
153  virtual void axpyRanges( const QuadratureType&,
154  const FactorType& ,
155  LocalDofVectorType & ) const = 0;
156 
157  virtual void evaluateRanges( const QuadratureType& quad,
158  const LocalDofVectorType & dofs,
159  FactorType& factors) const = 0;
160 
161  virtual void axpyJacobians( const QuadratureType&,
162  const Geometry&,
163  const FactorType& ,
164  LocalDofVectorType & ) const = 0;
165 
166  virtual void evaluateJacobians( const QuadratureType&,
167  const Geometry&,
168  const LocalDofVectorType&,
169  FactorType&) const = 0;
170 
171  template < class BaseFunctionSet, class Storage >
172  static const StoragePointerType& storage(const BaseFunctionSet& baseSet,
173  const Storage& dataCache,
174  const QuadratureType& quad)
175  {
176  const int nop = quad.nop();
177  static const int dimRange = BaseFunctionSet :: FunctionSpaceType:: dimRange;
178  const int numBaseFct = baseSet.size() / dimRange;
179 
180  assert( quad.id() < maxQuadratures );
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  if( ! evaluators[ quadId ].first )
189  {
191  auto& item = evaluators[ quadId ];
192 
193 #if 0 // NDEBUG
194  if( quad.isInterpolationQuadrature( numBaseFct ) )
195  std::cout << "EvaluateCallerInterface::storage: Not creating implementation because of interpolation feature!" <<std::endl;
196 #endif
197 
198  // if quadrature points or number of basis functions are not within
199  // the range of generated code snippets then don't search for
200  // a matching combination
201  // do not create an evaluation if the quadrature is an interpolation
202  // quadrature and matches the number of shape functions
203  if( (nop >= minQuadNop && nop <= maxQuadNop) &&
204  (numBaseFct >= minNumBaseFunctions && numBaseFct <= maxNumBaseFunctions) &&
205  ! quad.isInterpolationQuadrature( numBaseFct ) )
206  {
207  item.second.reset(
209  :: create( dataCache , nop, numBaseFct ) );
210  }
211 
212  // if pointer was checked, set flag to true, pointer may still be a nullptr
213  item.first = true;
214  }
215 
216  // this can be a nullptr (in this case the default implementation is used)
217  return evaluators[ quadId ].second;
218  }
219  };
220 
221  template <class Traits,
222  int dimRange,
223  int quadNop,
224  int numBaseFct >
226  : public EvaluateCallerInterface< typename Traits :: BaseTraits >
227  {
228  protected:
229  typedef typename Traits :: BaseFunctionSetType BaseFunctionSetType;
230  typedef typename Traits :: QuadratureType QuadratureType ;
231  typedef typename Traits :: FactorType FactorType ;
232  typedef typename Traits :: LocalDofVectorType LocalDofVectorType ;
233  typedef typename Traits :: Geometry Geometry ;
234  typedef typename Traits :: RangeVectorType RangeVectorType ;
235  typedef typename RangeVectorType :: value_type :: field_type FieldType;
236 
239 
240  // A copy is made of the storage here, otherwise strange memory corruptions happen
241  // TODO: needs further investigation
242  RangeVectorType rangeStorage_; // basis function evaluations
243 
244  std::vector< std::vector< FieldType > > rangeStorageTransposed_;
245  std::vector< std::vector< FieldType > > rangeStorageFlat_;
246  mutable std::vector< std::vector< std::vector< FieldType > > > rangeStorageTwisted_;
247 
248  template <class K>
249  int getDim( const DenseVector< K >& vec) const
250  {
251  return vec.size();
252  }
253 
254  template <class K>
255  int getDim( const DenseMatrix< K >& mat) const
256  {
257  // dimRange == rows which is 1 for basis storage
258  return getDim( mat[ 0 ] );
259  }
260 
261  // initialize storage for ranges (i.e. scalar)
262  void initRangeStorageTransposed( const std::integral_constant< bool, true > )
263  {
264  assert( rangeStorage_[ 0 ].size() == 1 );
265  {
266  const int quadPoints = rangeStorage_.size() / numBaseFct;
267  const int faces = quadPoints / quadNop;
268  rangeStorageTransposed_.resize( faces );
269  for( int f=0; f<faces; ++f )
270  {
271  auto& rangeStorageTransposed = rangeStorageTransposed_[ f ];
272 
273  // rearrange such that we store for one basis functions all
274  // evaluations for all quadrature points, i.e. numBaseFct * quadNop
275  rangeStorageTransposed.resize( numBaseFct * quadNop );
276  for( int i=0; i<numBaseFct; ++i )
277  {
278  const int idx = i * quadNop;
279  for( int j=0; j<quadNop; ++j )
280  {
281  int qp = f * quadNop + j ;
282  assert( j*numBaseFct + i < int(rangeStorage_.size()) );
283  // copy and transpose
284  rangeStorageTransposed[ idx + j ] = rangeStorage_[ qp*numBaseFct + i ][ 0 ];
285  }
286  }
287  }
288  }
289  }
290 
291  // initialize storage for jacobians (i.e. vectors)
292  void initRangeStorageTransposed( const std::integral_constant< bool, false > )
293  {
294  const int dim = rangeStorage_[ 0 ][ 0 ].size();
295  {
296  const int quadPoints = rangeStorage_.size() / numBaseFct;
297  const int faces = quadPoints / quadNop;
298  rangeStorageTransposed_.resize( faces );
299  rangeStorageFlat_.resize( faces );
300  for( int f=0; f<faces; ++f )
301  {
302  auto& rangeStorageTransposed = rangeStorageTransposed_[ f ];
303  auto& rangeStorageFlat = rangeStorageFlat_[ f ];
304 
305  // rearrange such that we store for one basis functions all
306  // evaluations for all quadrature points, i.e. numBaseFct * quadNop
307  rangeStorageTransposed.resize( numBaseFct * quadNop * dim );
308  rangeStorageFlat.resize( numBaseFct * quadNop * dim );
309  for( int i=0; i<numBaseFct; ++i )
310  {
311  const int idx = i * (quadNop * dim);
312  for( int j=0; j<quadNop; ++j )
313  {
314  int qp = f * quadNop + j ;
315  for( int d=0; d<dim; ++d )
316  {
317  rangeStorageFlat[ j*numBaseFct*dim + (i * dim) + d ] = rangeStorage_[ qp*numBaseFct + i ][ 0 ][ d ];
318  rangeStorageTransposed[ idx + (j * dim) + d ] = rangeStorage_[ qp*numBaseFct + i ][ 0 ][ d ];
319  }
320  }
321  }
322  }
323  }
324  }
325 
326  template <class Quadrature>
327  //const DynamicArray< FieldType >&
328  const std::vector< FieldType >&
329  getTwistedStorage( const Quadrature& quad ) const
330  {
331  // for evaluation the range storage dimension should be 1 and therefore
332  // rangeStorageTransposed should have been filled
333  assert( ! rangeStorageTransposed_.empty() );
334 
335  // if we are in the ranges cases then basis can be stored transposed
336  // quadrature points is the outer loop
337  if( quad.twisted() )
338  {
339  auto& rangeStorageTwisted = rangeStorageTwisted_[ quad.twistId() ];
340  if( rangeStorageTwisted.empty() )
341  {
342  // either 1 or dim of grid
343  const int dim = getDim( rangeStorage_[ 0 ] );
344 
345  const int quadPoints = rangeStorage_.size() / numBaseFct;
346  const int faces = quadPoints / quadNop;
347  rangeStorageTwisted.resize( faces );
348  for( int f=0; f<faces; ++f )
349  {
350  auto& rangeStorageFace = rangeStorageTwisted[ f ];
351  const auto& rangeStorageTransposed = rangeStorageTransposed_[ f ];
352 
353  // rearrange such that we store for one basis functions all
354  // evaluations for all quadrature points including the twisted mapping
355  rangeStorageFace.resize( rangeStorageTransposed.size() );
356  for( int i=0; i<numBaseFct; ++i )
357  {
358  const int idx = i * quadNop;
359  for( int j=0; j<quadNop; ++j )
360  {
361  const int qp = quad.localCachingPoint( j );
362  for( int d=0; d<dim; ++d )
363  {
364  rangeStorageFace[ idx + (j * dim) + d ] = rangeStorageTransposed[ idx + (qp * dim) + d ];
365  }
366  }
367  }
368  }
369  } // end if( rangeStorageTwisted.empty() )
370  return rangeStorageTwisted[ quad.localFaceIndex() ];
371  }
372  else // no twist (i.e. twist = 0 and twistId == 5 (-4 is mapped to 0))
373  {
374  return rangeStorageTransposed_[ quad.localFaceIndex() ];
375  }
376  }
377  public:
378  // type of interface class
380 
382  : rangeStorage_( rangeStorage ), rangeStorageTwisted_( 8 ) // 8 different twists
383  {
384  initRangeStorageTransposed( std::integral_constant< bool,
385  std::is_same< typename RangeVectorType::value_type,
386  Dune::FieldVector< double, 1 > > :: value > () );
387  }
388 
389  virtual void* storageAddress() const { return (void *) &rangeStorage_ ; }
390  virtual size_t storageSize() const { return rangeStorage_.size() ; }
391 
392  virtual void axpyRanges( const QuadratureType& quad,
393  const FactorType& rangeFactors,
394  LocalDofVectorType & dofs ) const
395  {
397  ( quad, rangeStorage_, rangeFactors, dofs );
398  }
399 
400  virtual void evaluateRanges( const QuadratureType& quad,
401  const LocalDofVectorType & dofs,
402  FactorType& rangeFactors) const
403  {
405  :: eval ( quad, getTwistedStorage( quad ), dofs, rangeFactors );
406  }
407 
408  virtual void axpyJacobians( const QuadratureType& quad,
409  const Geometry& geometry,
410  const FactorType& jacFactors,
411  LocalDofVectorType& dofs) const
412  {
414  ( quad, geometry, rangeStorageFlat_[ quad.localFaceIndex() ], jacFactors, dofs );
415  }
416 
417  virtual void evaluateJacobians( const QuadratureType& quad,
418  const Geometry& geometry,
419  const LocalDofVectorType& dofs,
420  FactorType& jacFactors) const
421  {
423  ( quad, geometry, getTwistedStorage( quad ), dofs, jacFactors );
424  }
425 
426  static InterfaceType* create( const RangeVectorType& rangeStorage )
427  {
428  return new ThisType( rangeStorage );
429  }
430  };
431 
432  // The default EvaluateImplementation is empty
433  // to create this has to be specified and derived from EvaluateCallerDefault
434  template <class Traits,
435  int dimRange,
436  int quadNop,
437  int numBaseFct >
439  : public EvaluateCallerInterface< typename Traits :: BaseTraits >
440  {
441  protected:
442  typedef typename Traits :: BaseFunctionSetType BaseFunctionSetType;
443  typedef typename Traits :: QuadratureType QuadratureType ;
444  typedef typename Traits :: FactorType FactorType ;
445  typedef typename Traits :: LocalDofVectorType LocalDofVectorType ;
446  typedef typename Traits :: Geometry Geometry ;
447  typedef typename Traits :: RangeVectorType RangeVectorType ;
448 
450 
452  public:
453  // type of interface class
455 
457  {}
458 
459  virtual void axpyRanges( const QuadratureType& quad,
460  const FactorType& rangeFactors,
461  LocalDofVectorType & dofs ) const
462  {
463  std::cerr << "ERROR: EvaluateImplementation::axpyRanges not overloaded!" << std::endl;
464  std::abort();
465  }
466 
467  virtual void axpyJacobians( const QuadratureType& quad,
468  const Geometry& geometry,
469  const FactorType& jacFactors,
470  LocalDofVectorType& dofs) const
471  {
472  std::cerr << "ERROR: EvaluateImplementation::axpyJacobians not overloaded!" << std::endl;
473  std::abort();
474  }
475 
476  virtual void evaluateRanges( const QuadratureType& quad,
477  const LocalDofVectorType & dofs,
478  FactorType& rangeFactors) const
479  {
480  std::cerr << "ERROR: EvaluateImplementation::evaluateRanges not overloaded!" << std::endl;
481  std::abort();
482  }
483 
484  virtual void evaluateJacobians( const QuadratureType& quad,
485  const Geometry& geometry,
486  const LocalDofVectorType& dofs,
487  FactorType& jacFactors) const
488  {
489  std::cerr << "ERROR: EvaluateImplementation::evaluateJacobians not overloaded!" << std::endl;
490  std::abort();
491  }
492 
494  {
495  #ifndef NDEBUG
496  std::cout << "Optimized EvaluateImplementation for < dimR="<<dimRange<< ", qp=" << quadNop << ", bases=" << numBaseFct << " > not created, falling back to default!" << std::endl;
497  //DUNE_THROW(NotImplemented,"EvaluateImplementation for < " << quadNop << " , " << numBaseFct << " > not created!");
498  //return (InterfaceType*) 0;
499  #endif
500  return nullptr;
501  }
502  };
503 
504  template <class Traits,
505  int quadNop,
506  int numBaseFct >
508  {
509  protected:
510  typedef typename Traits :: BaseFunctionSetType BaseFunctionSetType;
511  static const int dimRange = BaseFunctionSetType :: FunctionSpaceType:: dimRange;
512  typedef typename Traits :: RangeVectorType RangeVectorType ;
514  public:
515  static InterfaceType* createObj( const RangeVectorType& rangeStorage,
516  const size_t numbase )
517  {
518  if( numBaseFct == numbase )
520  else
522  }
523 
524  static InterfaceType* create( const RangeVectorType& rangeStorage,
525  const size_t quadnop, const size_t numbase )
526  {
527  if( quadNop == quadnop )
528  return EvaluateCaller< Traits, quadNop, numBaseFct > :: createObj( rangeStorage, numbase );
529  else
530  return EvaluateCaller< Traits, quadNop - 1, numBaseFct > :: create( rangeStorage, quadnop, numbase );
531  }
532  };
533 
534  template <class Traits,
535  int numBaseFct >
536  class EvaluateCaller< Traits, MIN_NUMBER_OF_QUAD_POINTS, numBaseFct >
537  {
538  protected:
539  typedef typename Traits :: BaseFunctionSetType BaseFunctionSetType;
540  static const int dimRange = BaseFunctionSetType :: FunctionSpaceType:: dimRange;
541  enum { quadNop = MIN_NUMBER_OF_QUAD_POINTS };
542  typedef typename Traits :: RangeVectorType RangeVectorType ;
544  public:
545  static InterfaceType* createObj( const RangeVectorType& rangeStorage,
546  const size_t numbase )
547  {
548  if( numBaseFct == numbase )
550  else
552  }
553 
554  static InterfaceType* create( const RangeVectorType& rangeStorage,
555  const size_t quadnop, const size_t numbase )
556  {
557  if( quadNop == quadnop )
558  return EvaluateCaller< Traits, quadNop, numBaseFct > :: createObj( rangeStorage, numbase );
559  else
560  {
561  std::cerr << "ERROR: EvaluateCaller< "<< quadNop << ", " << numBaseFct << " >::createObj: no working combination!" << std::endl;
562  std::abort();
563  }
564  }
565  };
566 
567  template <class Traits,
568  int quadNop>
569  class EvaluateCaller< Traits, quadNop, MIN_NUMBER_OF_BASE_FCT >
570  {
571  protected:
572  typedef typename Traits :: BaseFunctionSetType BaseFunctionSetType;
573  static const int dimRange = BaseFunctionSetType :: FunctionSpaceType:: dimRange;
574  enum { numBaseFct = MIN_NUMBER_OF_BASE_FCT };
575  typedef typename Traits :: RangeVectorType RangeVectorType ;
577  public:
578  static InterfaceType* createObj( const RangeVectorType& rangeStorage,
579  const size_t numbase )
580  {
581  if( numBaseFct == numbase )
583  else
584  {
585  std::cerr << "ERROR: EvaluateCaller< "<< quadNop << ", " << numBaseFct << " >::createObj: no working combination!" << std::endl;
586  std::abort();
587  }
588  }
589 
590  static InterfaceType* create( const RangeVectorType& rangeStorage,
591  const size_t quadnop, const size_t numbase )
592  {
593  if( quadNop == quadnop )
594  return EvaluateCaller< Traits, quadNop, numBaseFct > :: createObj( rangeStorage, numbase );
595  else
596  {
597  return EvaluateCaller< Traits, quadNop - 1, numBaseFct > :: create( rangeStorage, quadnop, numbase );
598  }
599  }
600  };
601 
602  template <class Traits>
604  {
605  protected:
606  typedef typename Traits :: BaseFunctionSetType BaseFunctionSetType;
607  static const int dimRange = BaseFunctionSetType :: FunctionSpaceType:: dimRange;
608  enum { quadNop = MIN_NUMBER_OF_QUAD_POINTS };
609  enum { numBaseFct = MIN_NUMBER_OF_BASE_FCT };
610  typedef typename Traits :: RangeVectorType RangeVectorType ;
612  public:
613  static InterfaceType* createObj( const RangeVectorType& rangeStorage,
614  const size_t numbase )
615  {
616  if( numBaseFct == numbase )
618  else
619  {
620  std::cerr << "ERROR: EvaluateCaller< "<< quadNop << ", " << numBaseFct << " >::createObj: no working combination!" << std::endl;
621  std::abort();
622  }
623  }
624 
625  static InterfaceType* create( const RangeVectorType& rangeStorage,
626  const size_t quadnop, const size_t numbase )
627  {
628  if( quadNop == quadnop )
629  return EvaluateCaller< Traits, quadNop, numBaseFct > :: createObj( rangeStorage, numbase );
630  else
631  {
632  std::cerr << "ERROR: EvaluateCaller< "<< quadNop << ", " << numBaseFct << " >::create: no working combination!" << std::endl;
633  std::abort();
634  }
635  }
636  };
637 
638  } // namespace Codegen
639 
640  } // namespace Fem
641 
642 } // namespace Dune
643 
644 #ifdef DUNE_FEM_INCLUDE_AUTOGENERATEDCODE_FILENAME_SPEC
645 #define CODEGEN_INCLUDEEVALCALLERS
646 // include specializations of EvaluateImplementation
647 #include DUNE_FEM_INCLUDE_AUTOGENERATEDCODE_FILENAME_SPEC
648 #undef CODEGEN_INCLUDEEVALCALLERS
649 #endif
650 #endif // #ifndef DUNE_FEM_EVALUATECALLER_HH
#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
Definition: bindguard.hh:11
IteratorRange< typename DF::DofIteratorType > dofs(DF &df)
Iterates over all DOFs.
Definition: rangegenerators.hh:76
ThreadSafeValue realizes thread safety for a given variable by creating an instance of this variable ...
Definition: threadsafevalue.hh:17
DenseMatrix based on std::vector< std::vector< T > >
Definition: blockmatrix.hh:24
actual interface class for quadratures
Definition: quadrature.hh:405
Generic implementation of a Dune quadrature.
Definition: quadratureimp.hh:196
Definition: evaluatecaller.hh:508
static const int dimRange
Definition: evaluatecaller.hh:511
Traits ::BaseFunctionSetType BaseFunctionSetType
Definition: evaluatecaller.hh:510
EvaluateCallerInterface< typename Traits ::BaseTraits > InterfaceType
Definition: evaluatecaller.hh:513
static InterfaceType * create(const RangeVectorType &rangeStorage, const size_t quadnop, const size_t numbase)
Definition: evaluatecaller.hh:524
static InterfaceType * createObj(const RangeVectorType &rangeStorage, const size_t numbase)
Definition: evaluatecaller.hh:515
Traits ::RangeVectorType RangeVectorType
Definition: evaluatecaller.hh:512
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 ::FactorType FactorType
Definition: evaluatecaller.hh:92
Traits ::Geometry Geometry
Definition: evaluatecaller.hh:94
RangeVectorImp RangeVectorType
Definition: evaluatecaller.hh:97
Traits BaseTraits
Definition: evaluatecaller.hh:90
Traits ::QuadratureType QuadratureType
Definition: evaluatecaller.hh:91
Traits ::LocalDofVectorType LocalDofVectorType
Definition: evaluatecaller.hh:93
BaseFunctionSet BaseFunctionSetType
Definition: evaluatecaller.hh:96
Definition: evaluatecaller.hh:104
virtual void axpyJacobians(const QuadratureType &, const Geometry &, const FactorType &, LocalDofVectorType &) const =0
static const StoragePointerType & storage(const BaseFunctionSet &baseSet, const Storage &dataCache, const QuadratureType &quad)
Definition: evaluatecaller.hh:172
virtual ~EvaluateCallerInterface()
Definition: evaluatecaller.hh:148
virtual void * storageAddress() const =0
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:112
static const int maxNumBaseFunctions
Definition: evaluatecaller.hh:111
Traits ::Geometry Geometry
Definition: evaluatecaller.hh:146
static const int maxQuadNop
Definition: evaluatecaller.hh:114
Traits ::QuadratureType QuadratureType
Definition: evaluatecaller.hh:143
Traits ::FactorType FactorType
Definition: evaluatecaller.hh:144
static const int maxQuadratures
Definition: evaluatecaller.hh:118
Traits ::LocalDofVectorType LocalDofVectorType
Definition: evaluatecaller.hh:145
virtual void evaluateRanges(const QuadratureType &quad, const LocalDofVectorType &dofs, FactorType &factors) const =0
std::pair< bool, StoragePointerType > StorageItemType
Definition: evaluatecaller.hh:108
static const int minQuadNop
Definition: evaluatecaller.hh:115
EvaluateCallerInterface()
Definition: evaluatecaller.hh:140
std::unique_ptr< ThisType > StoragePointerType
Definition: evaluatecaller.hh:107
std::vector< StorageItemType > storage_
Definition: evaluatecaller.hh:123
StorageItemType & operator[](const int i)
Definition: evaluatecaller.hh:135
Definition: evaluatecaller.hh:227
Traits ::RangeVectorType RangeVectorType
Definition: evaluatecaller.hh:234
EvaluateRealImplementation(const RangeVectorType &rangeStorage)
Definition: evaluatecaller.hh:381
virtual void axpyJacobians(const QuadratureType &quad, const Geometry &geometry, const FactorType &jacFactors, LocalDofVectorType &dofs) const
Definition: evaluatecaller.hh:408
EvaluateRealImplementation< Traits, dimRange, quadNop, numBaseFct > ThisType
Definition: evaluatecaller.hh:237
std::vector< std::vector< FieldType > > rangeStorageTransposed_
Definition: evaluatecaller.hh:244
const std::vector< FieldType > & getTwistedStorage(const Quadrature &quad) const
Definition: evaluatecaller.hh:329
virtual size_t storageSize() const
Definition: evaluatecaller.hh:390
static InterfaceType * create(const RangeVectorType &rangeStorage)
Definition: evaluatecaller.hh:426
Traits ::FactorType FactorType
Definition: evaluatecaller.hh:231
virtual void axpyRanges(const QuadratureType &quad, const FactorType &rangeFactors, LocalDofVectorType &dofs) const
Definition: evaluatecaller.hh:392
std::vector< std::vector< std::vector< FieldType > > > rangeStorageTwisted_
Definition: evaluatecaller.hh:246
BaseType InterfaceType
Definition: evaluatecaller.hh:379
std::vector< std::vector< FieldType > > rangeStorageFlat_
Definition: evaluatecaller.hh:245
int getDim(const DenseVector< K > &vec) const
Definition: evaluatecaller.hh:249
virtual void * storageAddress() const
Definition: evaluatecaller.hh:389
Traits ::BaseFunctionSetType BaseFunctionSetType
Definition: evaluatecaller.hh:229
RangeVectorType ::value_type ::field_type FieldType
Definition: evaluatecaller.hh:235
RangeVectorType rangeStorage_
Definition: evaluatecaller.hh:242
Traits ::Geometry Geometry
Definition: evaluatecaller.hh:233
virtual void evaluateJacobians(const QuadratureType &quad, const Geometry &geometry, const LocalDofVectorType &dofs, FactorType &jacFactors) const
Definition: evaluatecaller.hh:417
Traits ::LocalDofVectorType LocalDofVectorType
Definition: evaluatecaller.hh:232
int getDim(const DenseMatrix< K > &mat) const
Definition: evaluatecaller.hh:255
virtual void evaluateRanges(const QuadratureType &quad, const LocalDofVectorType &dofs, FactorType &rangeFactors) const
Definition: evaluatecaller.hh:400
void initRangeStorageTransposed(const std::integral_constant< bool, false >)
Definition: evaluatecaller.hh:292
Traits ::QuadratureType QuadratureType
Definition: evaluatecaller.hh:230
EvaluateCallerInterface< typename Traits ::BaseTraits > BaseType
Definition: evaluatecaller.hh:238
void initRangeStorageTransposed(const std::integral_constant< bool, true >)
Definition: evaluatecaller.hh:262
Definition: evaluatecaller.hh:440
Traits ::LocalDofVectorType LocalDofVectorType
Definition: evaluatecaller.hh:445
Traits ::RangeVectorType RangeVectorType
Definition: evaluatecaller.hh:447
Traits ::QuadratureType QuadratureType
Definition: evaluatecaller.hh:443
Traits ::BaseFunctionSetType BaseFunctionSetType
Definition: evaluatecaller.hh:442
BaseType InterfaceType
Definition: evaluatecaller.hh:454
static InterfaceType * create(const RangeVectorType &)
Definition: evaluatecaller.hh:493
Traits ::FactorType FactorType
Definition: evaluatecaller.hh:444
virtual void axpyJacobians(const QuadratureType &quad, const Geometry &geometry, const FactorType &jacFactors, LocalDofVectorType &dofs) const
Definition: evaluatecaller.hh:467
EvaluateCallerInterface< typename Traits ::BaseTraits > BaseType
Definition: evaluatecaller.hh:451
EvaluateImplementation(const RangeVectorType &rangeStorage)
Definition: evaluatecaller.hh:456
virtual void evaluateRanges(const QuadratureType &quad, const LocalDofVectorType &dofs, FactorType &rangeFactors) const
Definition: evaluatecaller.hh:476
virtual void axpyRanges(const QuadratureType &quad, const FactorType &rangeFactors, LocalDofVectorType &dofs) const
Definition: evaluatecaller.hh:459
EvaluateImplementation< Traits, dimRange, quadNop, numBaseFct > ThisType
Definition: evaluatecaller.hh:449
Traits ::Geometry Geometry
Definition: evaluatecaller.hh:446
virtual void evaluateJacobians(const QuadratureType &quad, const Geometry &geometry, const LocalDofVectorType &dofs, FactorType &jacFactors) const
Definition: evaluatecaller.hh:484
EvaluateCallerInterface< typename Traits ::BaseTraits > InterfaceType
Definition: evaluatecaller.hh:543
static InterfaceType * create(const RangeVectorType &rangeStorage, const size_t quadnop, const size_t numbase)
Definition: evaluatecaller.hh:554
static InterfaceType * createObj(const RangeVectorType &rangeStorage, const size_t numbase)
Definition: evaluatecaller.hh:545
Traits ::RangeVectorType RangeVectorType
Definition: evaluatecaller.hh:542
Traits ::BaseFunctionSetType BaseFunctionSetType
Definition: evaluatecaller.hh:539
EvaluateCallerInterface< typename Traits ::BaseTraits > InterfaceType
Definition: evaluatecaller.hh:576
static InterfaceType * createObj(const RangeVectorType &rangeStorage, const size_t numbase)
Definition: evaluatecaller.hh:578
static InterfaceType * create(const RangeVectorType &rangeStorage, const size_t quadnop, const size_t numbase)
Definition: evaluatecaller.hh:590
Traits ::RangeVectorType RangeVectorType
Definition: evaluatecaller.hh:575
Traits ::BaseFunctionSetType BaseFunctionSetType
Definition: evaluatecaller.hh:572
static InterfaceType * create(const RangeVectorType &rangeStorage, const size_t quadnop, const size_t numbase)
Definition: evaluatecaller.hh:625
static InterfaceType * createObj(const RangeVectorType &rangeStorage, const size_t numbase)
Definition: evaluatecaller.hh:613
Traits ::BaseFunctionSetType BaseFunctionSetType
Definition: evaluatecaller.hh:606
EvaluateCallerInterface< typename Traits ::BaseTraits > InterfaceType
Definition: evaluatecaller.hh:611
static void eval(const QuadratureType &quad, const RangeVectorType &rangeStorage, const LocalDofVectorType &dofs, RangeFactorType &rangeFactors)
Definition: evaluatecallerdefaultimpl.hh:24
static void eval(const QuadratureType &quad, const Geometry &geometry, const JacobianRangeVectorType &jacobianStorage, const LocalDofVectorType &dofs, JacobianRangeFactorType &jacFactors)
Definition: evaluatecallerdefaultimpl.hh:66
static void axpy(const QuadratureType &quad, const RangeVectorType &rangeStorage, const RangeFactorType &rangeFactors, LocalDofVectorType &dofs)
Definition: evaluatecallerdefaultimpl.hh:111
static void axpy(const QuadratureType &quad, const Geometry &geometry, const JacobianRangeVectorType &jacobianStorage, const JacobianRangeFactorType &jacFactors, LocalDofVectorType &dofs)
Definition: evaluatecallerdefaultimpl.hh:153