dune-fem  2.4.1-rc
localfunctionadapter.hh
Go to the documentation of this file.
1 #ifndef DUNE_FEM_LOCALFUNCTIONADAPTER_HH
2 #define DUNE_FEM_LOCALFUNCTIONADAPTER_HH
3 
4 #include <set>
5 #include <functional>
7 
8 namespace Dune
9 {
10 
11  namespace Fem
12  {
13 
24  template< class LocalFunctionImpl >
26 
27  template< class LocalFunctionImpl >
29 
32 
33 
34 
36  template< class LocalFunctionImpl >
38  {
39  typedef typename LocalFunctionImpl::FunctionSpaceType FunctionSpaceType;
40  typedef typename LocalFunctionImpl::GridPartType GridPartType;
41 
42  static const bool localFunctionHasInitialize = Conversion< LocalFunctionImpl, LocalFunctionAdapterHasInitialize >::exists;
43 
44  typedef typename FunctionSpaceType::RangeFieldType RangeFieldType;
45  typedef typename FunctionSpaceType::DomainFieldType DomainFieldType;
46  typedef typename FunctionSpaceType::RangeType RangeType;
47  typedef typename FunctionSpaceType::DomainType DomainType;
48  typedef typename FunctionSpaceType::JacobianRangeType JacobianRangeType;
49  typedef typename FunctionSpaceType::HessianRangeType HessianRangeType;
50 
51  typedef typename GridPartType :: GridType GridType;
52  typedef typename GridPartType::template Codim< 0 >::EntityType EntityType;
54  typedef typename GridPartType::template Codim< 0 >::IteratorType IteratorType;
56  typedef typename GridPartType :: IndexSetType IndexSetType;
57 
59 
62  };
63 
64 
65 
115  template< class LocalFunctionImpl >
117  : public Function< typename LocalFunctionImpl::FunctionSpaceType, LocalFunctionAdapter< LocalFunctionImpl > >,
118  public HasLocalFunction
119  {
122 
123  friend class LocalFunctionAdapterLocalFunction< LocalFunctionImpl >;
124 
125  public:
126  typedef ThisType DiscreteFunctionType;
127 
129  typedef LocalFunctionImpl LocalFunctionImplType;
130 
132  typedef typename BaseType::FunctionType FunctionType;
133 
136 
139 
142 
144  typedef typename Traits::GridType GridType;
150  typedef typename Traits::DomainType DomainType;
152  typedef typename Traits::RangeType RangeType;
156  typedef typename Traits::EntityType EntityType;
157 
160 
161  protected:
163  typedef std::set< LocalFunctionType * > LocalFunctionListType;
164 
165  template <class ArgumentType, bool hasInit >
167  {
168  static void init( const ArgumentType& , LocalFunctionListType& )
169  {}
170  };
171 
172  template <class ArgumentType>
173  struct LocalFunctionInitializer< ArgumentType, true >
174  {
175  static void init( const ArgumentType& arg, LocalFunctionListType& lfList)
176  {
177  for( auto& localFunctionPtr : lfList )
178  arg.initialize( localFunctionPtr );
179  }
180  };
181 
182  // interface class for local function init
183  struct ArgumentIF
184  {
185  virtual void initialize( LocalFunctionType* lf ) const = 0;
186 
187  virtual ~ArgumentIF () {}
188  };
189 
190  // storage of argument reference to init local functions
191  template <class ArgType>
193  {
194  // store arg here, this is a tuple of discrete functions
195  // that has to be copied
196  const ArgType arg_;
197  const double time_;
198 
199  // constructor storing argument
200  ArgumentInitializer( const ArgType& arg, const double time )
201  : arg_( arg ),
202  time_( time )
203  {}
204 
206 
207  virtual void initialize( LocalFunctionType* lf ) const
208  {
209  lf->initialize( arg_, time_ );
210  }
211  };
212 
213  public:
215  LocalFunctionAdapter ( const std::string &name,
216  LocalFunctionImplType &localFunctionImpl,
217  const GridPartType &gridPart,
218  unsigned int order = DiscreteFunctionSpaceType::polynomialOrder )
219  : space_( gridPart, order ),
220  localFunctionImpl_( localFunctionImpl ),
221  lfList_(),
222  argInitializer_( 0 ),
223  name_( name ),
224  order_( order )
225  {}
226 
227  // reference to function this local belongs to
228  LocalFunctionAdapter( const ThisType &other )
229  : space_( other.space_ ),
230  localFunctionImpl_( other.localFunctionImpl_ ),
231  lfList_(),
232  argInitializer_( 0 ),
233  name_( other.name_ ),
234  order_( other.order_ )
235  {}
236 
238  {
239  delete argInitializer_ ;
240  }
241 
243  inline unsigned int order() const
244  {
245  return order_;
246  }
247 
249  inline const LocalFunctionImplType& localFunctionImpl() const
250  {
251  return localFunctionImpl_;
252  }
253 
255  inline LocalFunctionImplType& localFunctionImpl()
256  {
257  return localFunctionImpl_;
258  }
259 
261  void evaluate(const DomainType& global, RangeType& result) const
262  {
263  DUNE_THROW( NotImplemented, "LocalFunctionAdapter::evaluate is not implemented." );
264  }
265 
267  LocalFunctionType localFunction( const EntityType &entity )
268  {
269  return LocalFunctionType( entity, *this );
270  }
271 
273  const LocalFunctionType localFunction( const EntityType &entity ) const
274  {
275  return LocalFunctionType( entity, *this );
276  }
277 
279  const std::string &name() const
280  {
281  return name_;
282  }
283 
284  const DiscreteFunctionSpaceType &space () const
285  {
286  return space_;
287  }
288 
289  const GridPartType &gridPart () const
290  {
291  return space().gridPart();
292  }
293 
295  template <class DFType>
296  DiscreteFunctionType &operator+= ( const DFType &g )
297  {
298  DUNE_THROW( NotImplemented, "LocalFunctionAdapter::operator += is not implemented." );
299  return *this;
300  }
301 
306  template <class DFType>
307  DiscreteFunctionType& operator -= (const DFType& g)
308  {
309  DUNE_THROW( NotImplemented, "LocalFunctionAdapter::operator -= is not implemented." );
310  return *this;
311  }
312 
319  inline DiscreteFunctionType &operator*= ( const RangeFieldType &scalar )
320  {
321  DUNE_THROW( NotImplemented, "LocalFunctionAdapter::operator *= is not implemented." );
322  return *this;
323  }
324 
331  inline DiscreteFunctionType &operator/= ( const RangeFieldType &scalar )
332  {
333  DUNE_THROW( NotImplemented, "LocalFunctionAdapter::operator /= is not implemented." );
334  return *this;
335  }
336 
338  template< class ArgumentType >
339  void initialize( const ArgumentType &arg, const double time )
340  {
341  if( Traits::localFunctionHasInitialize )
342  {
343  delete argInitializer_ ;
344  // makes a copy of arg, which is a tuple of discrete functions
345  argInitializer_ = new ArgumentInitializer< ArgumentType >( arg, time );
346  LocalFunctionInitializer< ArgumentIF, Traits::localFunctionHasInitialize > :: init( *argInitializer_, lfList_ );
347  }
348  else
349  {
350  DUNE_THROW(NotImplemented,"LocalFunctionAdapter::initialize is not implemented");
351  }
352  }
353 
355  void registerLocalFunction( LocalFunctionType* lf ) const
356  {
357  if( Traits::localFunctionHasInitialize )
358  {
359  if( argInitializer_ )
360  argInitializer_->initialize( lf );
361  lfList_.insert( lf );
362  }
363  }
364 
366  void deleteLocalFunction( LocalFunctionType* lf ) const
367  {
368  if( Traits::localFunctionHasInitialize )
369  {
370  lfList_.erase( lf );
371  }
372  }
373 
374  protected:
375  DiscreteFunctionSpaceType space_;
376  LocalFunctionImplType &localFunctionImpl_;
377  mutable LocalFunctionListType lfList_;
378  const ArgumentIF* argInitializer_ ;
379  const std::string name_;
380  const unsigned int order_;
381  };
382 
383 
384 
385  template< class LocalFunctionImpl >
387  {
389 
390  public:
392  typedef LocalFunctionImpl LocalFunctionImplType;
393 
396 
402  typedef typename Traits::DomainType DomainType;
404  typedef typename Traits::RangeType RangeType;
409 
411  typedef typename Traits::EntityType EntityType;
412 
413  // default is reference
414  template <int, bool hasInit >
416  {
417  typedef LocalFunctionImplType& Type;
418  };
419 
420  // non default is object
421  template <int dummy >
422  struct LocalFuncType<dummy, true>
423  {
424  typedef LocalFunctionImplType Type;
425  };
426 
428  LocalFunctionAdapterLocalFunction ( const EntityType &entity, const DiscreteFunctionType &adapter )
429  : adapter_( adapter ),
430  localFunctionImpl_( adapter.localFunctionImpl_ )
431  {
432  // add local function to list
433  adapter_.registerLocalFunction( this );
434  localFunctionImpl_.init( entity );
435  }
436 
438  explicit LocalFunctionAdapterLocalFunction ( const DiscreteFunctionType &adapter )
439  : adapter_( adapter ),
440  localFunctionImpl_( adapter.localFunctionImpl_ )
441  {
442  // add local function to list
443  adapter_.registerLocalFunction( this );
444  }
445 
447  LocalFunctionAdapterLocalFunction ( const ThisType &other )
448  : adapter_( other.adapter_ ),
449  localFunctionImpl_( other.localFunctionImpl_ )
450  {
451  // add local function to list
452  adapter_.registerLocalFunction( this );
453  }
454 
457  {
458  // remove local function from list
459  adapter_.deleteLocalFunction( this );
460  }
461 
463  inline unsigned int order() const
464  {
465  return adapter_.order();
466  }
467 
469  template< class PointType >
470  void evaluate ( const PointType &x, RangeType &ret ) const
471  {
472  localFunctionImpl_.evaluate(x,ret);
473  }
474 
476  template< class PointType >
477  void jacobian ( const PointType &x, JacobianRangeType &ret ) const
478  {
479  localFunctionImpl_.jacobian( x, ret );
480  }
481 
482  // hessian of local function
483  template< class PointType >
484  void hessian ( const PointType &x, HessianRangeType &ret ) const
485  {
486  localFunctionImpl_.hessian( x, ret );
487  }
488 
489  template< class QuadratureType, class VectorType >
490  void evaluateQuadrature( const QuadratureType &quad,
491  VectorType &result ) const
492  {
493  evaluateQuadrature( quad, result, result[ 0 ] );
494  }
495 
497  void init(const EntityType& en)
498  {
499  entity_=&en;
500  localFunctionImpl_.init(en);
501  }
502 
503  template <class ArgumentType>
504  void initialize ( const ArgumentType& arg, const double time )
505  {
506  localFunctionImpl_.initialize( arg, time );
507  }
508 
510  inline const EntityType& entity() const
511  {
512  assert( entity_ );
513  return *entity_;
514  }
515 
516  protected:
517  template< class QuadratureType, class VectorType >
518  void evaluateQuadrature( const QuadratureType &quad,
519  VectorType &result, const RangeType& ) const
520  {
521  const size_t quadNop = quad.nop();
522  for(size_t i = 0; i<quadNop; ++i)
523  evaluate( quad[ i ], result[ i ] );
524  }
525 
526  template< class QuadratureType, class VectorType >
527  void evaluateQuadrature( const QuadratureType &quad,
528  VectorType &result, const JacobianRangeType& ) const
529  {
530  const size_t quadNop = quad.nop();
531  for(size_t i = 0; i<quadNop; ++i)
532  jacobian( quad[ i ], result[ i ] );
533  }
534 
535  protected:
536  EntityType const* entity_;
537  const DiscreteFunctionType &adapter_;
539  LocalFuncStorageType localFunctionImpl_;
540  };
541 
542 
543 
565  template<class DiscreteFunctionSpaceImpl,class AnalyticalFunctionImpl=std::function<
566  typename DiscreteFunctionSpaceImpl::FunctionSpaceType::RangeType(
567  const typename DiscreteFunctionSpaceImpl::FunctionSpaceType::DomainType&,
568  const double&,const typename DiscreteFunctionSpaceImpl::EntityType&)> >
570  {
571  public:
572  typedef DiscreteFunctionSpaceImpl DiscreteFunctionSpaceType;
573  typedef AnalyticalFunctionImpl AnalyticalFunctionType;
575 
576  typedef typename DiscreteFunctionSpaceType::FunctionSpaceType FunctionSpaceType;
577  typedef typename DiscreteFunctionSpaceType::GridPartType GridPartType;
578  typedef typename DiscreteFunctionSpaceType::EntityType EntityType;
579 
580  typedef typename FunctionSpaceType::DomainType DomainType;
581  typedef typename FunctionSpaceType::RangeType RangeType;
582  typedef typename FunctionSpaceType::JacobianRangeType JacobianRangeType;
583  typedef typename FunctionSpaceType::HessianRangeType HessianRangeType;
584 
586  LocalAnalyticalFunctionBinder(const AnalyticalFunctionType& f):
587  f_(f),j_(),h_(),t_(0.0)
588  {}
589 
591  LocalAnalyticalFunctionBinder(const AnalyticalFunctionType& f, const AnalyticalFunctionType &j):
592  f_(f),j_(j),h_(),t_(0.0)
593  {}
594 
596  LocalAnalyticalFunctionBinder(const AnalyticalFunctionType& f,const AnalyticalFunctionType& j,
597  const AnalyticalFunctionType& h):
598  f_(f),j_(j),h_(h),t_(0.0)
599  {}
600 
602  template<class PointType>
603  inline void evaluate(const PointType& x,RangeType& ret) const
604  {
605  ret=f_(entity().geometry().global(coordinate(x)),t_,entity());
606  }
607 
609  template<class PointType>
610  inline void jacobian(const PointType &x,JacobianRangeType &ret) const
611  {
612  ret=j_(entity().geometry().global(coordinate(x)),t_,entity());
613  }
614 
616  template<class PointType>
617  inline void hessian(const PointType &x,HessianRangeType &ret ) const
618  {
619  ret=h_(entity().geometry().global(coordinate(x)),t_,entity());
620  }
621 
623  inline void init(const EntityType& entity)
624  {
625  entity_=&entity;
626  }
627 
629  inline void init(const EntityType& entity, double time)
630  {
631  entity_=&entity;
632  t_=time;
633  }
634 
636  template<typename... Args>
637  inline void initialize(const Args&... ,double time)
638  {
639  t_=time;
640  }
641 
643  inline const EntityType& entity() const
644  {
645  assert( entity_ );
646  return *entity_;
647  }
648 
649  private:
650  EntityType const* entity_;
651  AnalyticalFunctionType f_;
652  AnalyticalFunctionType j_;
653  AnalyticalFunctionType h_;
654  double t_;
655  };
656 
657  } // namespace Fem
658 
659 } // namespace Dune
660 
662 
663 #endif // #ifndef DUNE_FEM_LOCALFUNCTIONADAPTER_HH
void init(const EntityType &entity, double time)
initialize to new entity and to new time
Definition: localfunctionadapter.hh:629
~LocalFunctionAdapterLocalFunction()
destructor
Definition: localfunctionadapter.hh:456
const std::string & name() const
obtain the name of the discrete function
Definition: localfunctionadapter.hh:279
LocalAnalyticalFunctionBinder< DiscreteFunctionSpaceType, AnalyticalFunctionType > ThisType
Definition: localfunctionadapter.hh:574
void hessian(const PointType &x, HessianRangeType &ret) const
evaluate hessian local function
Definition: localfunctionadapter.hh:617
void evaluate(const DomainType &global, RangeType &result) const
evaluate function on local coordinate local
Definition: localfunctionadapter.hh:261
~ArgumentInitializer()
Definition: localfunctionadapter.hh:205
Definition: localfunctionadapter.hh:166
void evaluateQuadrature(const QuadratureType &quad, VectorType &result) const
Definition: localfunctionadapter.hh:490
Traits::EntityType EntityType
Definition: localfunctionadapter.hh:411
Traits::GridPartType GridPartType
type of grid part
Definition: localfunctionadapter.hh:138
const EntityType & entity() const
get entity
Definition: localfunctionadapter.hh:510
void registerLocalFunction(LocalFunctionType *lf) const
add LocalFunction to list of local functions
Definition: localfunctionadapter.hh:355
const ArgType arg_
Definition: localfunctionadapter.hh:196
LocalFunctionImpl LocalFunctionImplType
Evaluate class.
Definition: localfunctionadapter.hh:129
Traits::HessianRangeType HessianRangeType
hessian type
Definition: localfunctionadapter.hh:408
Traits::DiscreteFunctionSpaceType DiscreteFunctionSpaceType
type of discrete function space
Definition: localfunctionadapter.hh:141
void evaluateQuadrature(const QuadratureType &quad, VectorType &result, const JacobianRangeType &) const
Definition: localfunctionadapter.hh:527
const double time_
Definition: localfunctionadapter.hh:197
LocalFunctionImplType Type
Definition: localfunctionadapter.hh:424
std::set< LocalFunctionType * > LocalFunctionListType
set of created local functions
Definition: localfunctionadapter.hh:163
void init(const EntityType &entity)
initialize to new entity
Definition: localfunctionadapter.hh:623
LocalFunctionAdapter wrapped a class with a local evaluate method into a grid function.
Definition: localfunctionadapter.hh:25
const EntityType & entity() const
get entity
Definition: localfunctionadapter.hh:643
Traits::DiscreteFunctionType DiscreteFunctionType
Definition: localfunctionadapter.hh:410
Traits::RangeType RangeType
range type
Definition: localfunctionadapter.hh:404
ArgumentInitializer(const ArgType &arg, const double time)
Definition: localfunctionadapter.hh:200
LocalAnalyticalFunctionBinder(const AnalyticalFunctionType &f)
constructor (without jacobian and without hessian)
Definition: localfunctionadapter.hh:586
Traits::JacobianRangeType JacobianRangeType
jacobian type
Definition: localfunctionadapter.hh:406
LocalFunctionImpl LocalFunctionImplType
type of local function implementation
Definition: localfunctionadapter.hh:392
FunctionSpaceType::JacobianRangeType JacobianRangeType
Definition: localfunctionadapter.hh:582
LocalFuncStorageType localFunctionImpl_
Definition: localfunctionadapter.hh:539
virtual ~ArgumentIF()
Definition: localfunctionadapter.hh:187
LocalFunctionImplType & localFunctionImpl_
Definition: localfunctionadapter.hh:376
DiscreteFunctionSpaceAdapter< FunctionSpaceType, GridPartType > DiscreteFunctionSpaceType
Definition: localfunctionadapter.hh:58
Traits::JacobianRangeType JacobianRangeType
jacobian type
Definition: localfunctionadapter.hh:154
LocalFunctionAdapterTraits< LocalFunctionImplType > Traits
traits class
Definition: localfunctionadapter.hh:135
BaseType::FunctionType FunctionType
type of function
Definition: localfunctionadapter.hh:132
LocalAnalyticalFunctionBinder(const AnalyticalFunctionType &f, const AnalyticalFunctionType &j)
constructor (without hessian)
Definition: localfunctionadapter.hh:591
LocalFunctionImpl::GridPartType GridPartType
Definition: localfunctionadapter.hh:40
~LocalFunctionAdapter()
Definition: localfunctionadapter.hh:237
LocalFunctionAdapterLocalFunction< LocalFunctionImpl > LocalFunctionType
Definition: localfunctionadapter.hh:61
Traits::DomainType DomainType
domain type
Definition: localfunctionadapter.hh:402
FunctionSpaceType::JacobianRangeType JacobianRangeType
Definition: localfunctionadapter.hh:48
LocalFunctionAdapterLocalFunction(const ThisType &other)
copy constructor
Definition: localfunctionadapter.hh:447
void evaluate(const PointType &x, RangeType &ret) const
evaluate local function
Definition: localfunctionadapter.hh:603
Traits::RangeFieldType RangeFieldType
range type
Definition: localfunctionadapter.hh:148
const LocalFunctionImplType & localFunctionImpl() const
return local function implementation
Definition: localfunctionadapter.hh:249
const std::string name_
Definition: localfunctionadapter.hh:379
GridPartType::template Codim< 0 >::IteratorType IteratorType
type of iterator
Definition: localfunctionadapter.hh:54
Traits::DomainType DomainType
domain type
Definition: localfunctionadapter.hh:150
void deleteLocalFunction(LocalFunctionType *lf) const
remove LocalFunction to list of local functions
Definition: localfunctionadapter.hh:366
EntityType const * entity_
Definition: localfunctionadapter.hh:536
LocalFunctionImpl::FunctionSpaceType FunctionSpaceType
Definition: localfunctionadapter.hh:39
DiscreteFunctionSpaceType space_
Definition: localfunctionadapter.hh:375
LocalFunctionListType lfList_
Definition: localfunctionadapter.hh:377
void evaluateQuadrature(const QuadratureType &quad, VectorType &result, const RangeType &) const
Definition: localfunctionadapter.hh:518
unsigned int order() const
return order of the space
Definition: localfunctionadapter.hh:463
Traits::GridType GridType
type of grid
Definition: localfunctionadapter.hh:144
DiscreteFunctionSpaceType::EntityType EntityType
Definition: localfunctionadapter.hh:578
DiscreteFunctionSpaceType::FunctionSpaceType FunctionSpaceType
Definition: localfunctionadapter.hh:576
LocalFunctionImplType & Type
Definition: localfunctionadapter.hh:417
Traits::DomainFieldType DomainFieldType
domain type
Definition: localfunctionadapter.hh:146
Definition: coordinate.hh:4
Traits::DomainFieldType DomainFieldType
domain type
Definition: localfunctionadapter.hh:398
Definition: localfunctionadapter.hh:192
FunctionSpaceType::HessianRangeType HessianRangeType
Definition: localfunctionadapter.hh:583
Traits::LocalFunctionType LocalFunctionType
type of local function to export
Definition: localfunctionadapter.hh:159
unsigned int order() const
return the order of the space
Definition: localfunctionadapter.hh:243
Traits::RangeFieldType RangeFieldType
range type
Definition: localfunctionadapter.hh:400
FunctionSpaceType::RangeType RangeType
Definition: localfunctionadapter.hh:581
FunctionSpaceType::DomainFieldType DomainFieldType
Definition: localfunctionadapter.hh:45
static void init(const ArgumentType &arg, LocalFunctionListType &lfList)
Definition: localfunctionadapter.hh:175
const unsigned int order_
Definition: localfunctionadapter.hh:380
FunctionSpaceType::HessianRangeType HessianRangeType
Definition: localfunctionadapter.hh:49
LocalFunctionAdapter< LocalFunctionImpl > DiscreteFunctionType
Definition: localfunctionadapter.hh:60
DiscreteFunctionSpaceImpl DiscreteFunctionSpaceType
Definition: localfunctionadapter.hh:572
const ArgumentIF * argInitializer_
Definition: localfunctionadapter.hh:378
void jacobian(const PointType &x, JacobianRangeType &ret) const
jacobian of local function
Definition: localfunctionadapter.hh:477
Definition: localfunctionadapter.hh:28
DiscreteFunctionSpaceType::GridPartType GridPartType
Definition: localfunctionadapter.hh:577
void jacobian(const PointType &x, JacobianRangeType &ret) const
evaluate jacobian local function
Definition: localfunctionadapter.hh:610
void evaluate(const PointType &x, RangeType &ret) const
evaluate local function
Definition: localfunctionadapter.hh:470
static void init(const ArgumentType &, LocalFunctionListType &)
Definition: localfunctionadapter.hh:168
LocalFunctionAdapterLocalFunction(const EntityType &entity, const DiscreteFunctionType &adapter)
constructor initializing local function
Definition: localfunctionadapter.hh:428
LocalFunctionAdapter(const ThisType &other)
Definition: localfunctionadapter.hh:228
Definition: localfunctionadapter.hh:183
LocalFuncType< 0, Traits::localFunctionHasInitialize >::Type LocalFuncStorageType
Definition: localfunctionadapter.hh:538
void initialize(const ArgumentType &arg, const double time)
initialize local function with argument (see insertfunctionpass.hh)
Definition: localfunctionadapter.hh:339
GridPartType::template Codim< 0 >::EntityType EntityType
Definition: localfunctionadapter.hh:52
LocalFunctionImplType & localFunctionImpl()
return local function implementation
Definition: localfunctionadapter.hh:255
FunctionSpaceType::RangeType RangeType
Definition: localfunctionadapter.hh:46
Traits::RangeType RangeType
range type
Definition: localfunctionadapter.hh:152
ThisType DiscreteFunctionType
Definition: localfunctionadapter.hh:126
LocalFunctionAdapter(const std::string &name, LocalFunctionImplType &localFunctionImpl, const GridPartType &gridPart, unsigned int order=DiscreteFunctionSpaceType::polynomialOrder)
constructer taking instance of EvalImp class
Definition: localfunctionadapter.hh:215
LocalAnalyticalFunctionBinder binds a C++ local analytical function (and also its Jacobian and Hessia...
Definition: localfunctionadapter.hh:569
virtual void initialize(LocalFunctionType *lf) const
Definition: localfunctionadapter.hh:207
const LocalFunctionType localFunction(const EntityType &entity) const
obtain a local function for an entity (read-write)
Definition: localfunctionadapter.hh:273
Abstract class representing a function.
Definition: function.hh:43
AnalyticalFunctionImpl AnalyticalFunctionType
Definition: localfunctionadapter.hh:573
Traits::EntityType EntityType
type of codim 0 entity
Definition: localfunctionadapter.hh:156
const GridPartType & gridPart() const
Definition: localfunctionadapter.hh:289
FunctionSpaceType::DomainType DomainType
Definition: localfunctionadapter.hh:580
void initialize(const Args &..., double time)
set time
Definition: localfunctionadapter.hh:637
Definition: discretefunction.hh:55
void init(const EntityType &en)
init local function
Definition: localfunctionadapter.hh:497
const DiscreteFunctionSpaceType & space() const
Definition: localfunctionadapter.hh:284
GridPartType::IndexSetType IndexSetType
type of IndexSet
Definition: localfunctionadapter.hh:56
traits of DiscreteFunctionAdapter
Definition: localfunctionadapter.hh:37
LocalAnalyticalFunctionBinder(const AnalyticalFunctionType &f, const AnalyticalFunctionType &j, const AnalyticalFunctionType &h)
constructor
Definition: localfunctionadapter.hh:596
identifier to local function has initialize feature
Definition: localfunctionadapter.hh:31
LocalFunctionAdapterTraits< LocalFunctionImplType > Traits
type of the traits class
Definition: localfunctionadapter.hh:395
void hessian(const PointType &x, HessianRangeType &ret) const
Definition: localfunctionadapter.hh:484
void initialize(const ArgumentType &arg, const double time)
Definition: localfunctionadapter.hh:504
LocalFunctionType localFunction(const EntityType &entity)
obtain a local function for an entity (read-write)
Definition: localfunctionadapter.hh:267
static const Point & coordinate(const Point &x)
Definition: coordinate.hh:11
FunctionSpaceType::DomainType DomainType
Definition: localfunctionadapter.hh:47
Create Obejct that behaves like a discrete function space without to provide functions with the itera...
Definition: discretefunctionspace.hh:892
FunctionSpaceType::RangeFieldType RangeFieldType
Definition: localfunctionadapter.hh:44
GridPartType::GridType GridType
Definition: localfunctionadapter.hh:51
const DiscreteFunctionType & adapter_
Definition: localfunctionadapter.hh:537
LocalFunctionAdapterLocalFunction(const DiscreteFunctionType &adapter)
constructor
Definition: localfunctionadapter.hh:438