dune-fem 2.8.0
Loading...
Searching...
No Matches
const.hh
Go to the documentation of this file.
1#ifndef DUNE_FEM_FUNCTION_LOCALFUNCTION_CONST_HH
2#define DUNE_FEM_FUNCTION_LOCALFUNCTION_CONST_HH
3
4#include <algorithm>
5#include <type_traits>
6#include <utility>
7
8#include <dune/common/dynvector.hh>
9
14
15namespace Dune
16{
17
18 namespace Fem
19 {
20
21 // External Forward Declerations
22 // -----------------------------
23
24 template< class >
25 struct DiscreteFunctionTraits;
26
27 class HasLocalFunction;
28 class IsDiscreteFunction;
29 struct BindableFunction;
30
31 // BasicConstLocalFunction
32 // -----------------------
33
34 template < class BasisFunctionSet, class LocalDofVector >
36 : public LocalFunction< BasisFunctionSet, LocalDofVector >
37 {
40
41 public:
43 typedef typename BaseType::DofType DofType;
44
46 typedef typename BaseType :: EntityType EntityType;
47
49 typedef typename BaseType :: BasisFunctionSetType BasisFunctionSetType;
50
52 typedef typename BaseType :: LocalDofVectorType LocalDofVectorType;
53
55 typedef typename BaseType::SizeType SizeType;
56
59
61
63
66 {}
67
69
72 {}
73
74 BasicConstLocalFunction ( const BaseType &other ) : BaseType( other ) {}
75
76 BasicConstLocalFunction ( const ThisType &other ) : BaseType( static_cast<const BaseType &>( other ) ) {}
77 BasicConstLocalFunction ( ThisType && other ) : BaseType( static_cast<BaseType&&>(other) ) {}
78
79 const DofType &operator[] ( SizeType i ) const { return static_cast< const BaseType & >( *this )[ i ]; }
80 const DofType &operator[] ( SizeType i ) { return static_cast< const BaseType & >( *this )[ i ]; }
81
83
84 protected:
85 using BaseType::clear;
86 using BaseType::assign;
87 using BaseType::operator +=;
88 using BaseType::operator -=;
89 using BaseType::axpy;
90 };
91
109 template< class DiscreteFunction >
112 typename DiscreteFunctionTraits< std::remove_const_t< DiscreteFunction > >::DiscreteFunctionSpaceType::BasisFunctionSetType,
113 Dune::DynamicVector< typename DiscreteFunctionTraits< std::remove_const_t< DiscreteFunction > >::DofType,
114 typename DiscreteFunctionTraits< std::remove_const_t< DiscreteFunction > >::LocalDofVectorAllocatorType
115 :: template rebind< typename DiscreteFunctionTraits< std::remove_const_t< DiscreteFunction > > ::DofType > ::other > >
116 {
118 typedef BasicConstLocalFunction< typename DiscreteFunctionTraits< std::remove_const_t< DiscreteFunction > >::DiscreteFunctionSpaceType::BasisFunctionSetType,
119 Dune::DynamicVector< typename DiscreteFunctionTraits< std::remove_const_t< DiscreteFunction > >::DofType,
120 typename DiscreteFunctionTraits< std::remove_const_t< DiscreteFunction > > :: LocalDofVectorAllocatorType
121 :: template rebind< typename DiscreteFunctionTraits< std::remove_const_t< DiscreteFunction > >::DofType >::other > >
122 BaseType;
123
124 public:
125 typedef std::remove_const_t< DiscreteFunction > DiscreteFunctionType;
126 typedef typename DiscreteFunctionType::DiscreteFunctionSpaceType DiscreteFunctionSpaceType;
127 typedef typename DiscreteFunctionSpaceType::GridPartType GridPartType;
128 typedef typename DiscreteFunctionSpaceType::FunctionSpaceType FunctionSpaceType;
129
131
132 typedef typename BaseType::DofType DofType;
134 typedef typename GridPartType::IntersectionType IntersectionType;
141
156 : BaseType( LocalDofVectorType( df.localDofVectorAllocator() ) )
157 , discreteFunction_( &df )
158#ifdef TESTTHREADING
159 , thread_(-1)
160#endif
161 {}
162
164 ConstLocalDiscreteFunction ( const typename DiscreteFunctionType::LocalFunctionType &localFunction )
167#ifdef TESTTHREADING
168 , thread_(-1)
169#endif
170 {
171 std::copy( localFunction.localDofVector().begin(), localFunction.localDofVector().end(), localDofVector().begin() );
172 }
173
188 : BaseType( df.space().basisFunctionSet( entity ), LocalDofVectorType( df.localDofVectorAllocator() ) )
189 , discreteFunction_( &df )
190#ifdef TESTTHREADING
191 , thread_(-1)
192#endif
193 {
194 discreteFunction().getLocalDofs( entity, localDofVector() );
195 }
197 : BaseType( df.space().basisFunctionSet( entity ), LocalDofVectorType( df.localDofVectorAllocator() ) )
198 , discreteFunction_( &df )
199#ifdef TESTTHREADING
200 , thread_(-1)
201#endif
202 {
203 discreteFunction().getLocalDofs( entity, localDofVector() );
204 }
205
208 : BaseType( static_cast<const BaseType &>( other ) )
210#ifdef TESTTHREADING
211 , thread_(-1)
212#endif
213 {}
214
217 : BaseType( static_cast< BaseType &&>( other ) )
219#ifdef TESTTHREADING
220 , thread_(-1)
221#endif
222 {}
223
225
226 using BaseType::evaluate;
227 using BaseType::jacobian;
228 using BaseType::hessian;
229
235 template< class Point >
236 RangeType evaluate ( const Point &p ) const
237 {
238 RangeType val;
239 evaluate( p, val );
240 return val;
241 }
242
251 template< class Point >
252 JacobianRangeType jacobian ( const Point &p ) const
253 {
255 jacobian( p, jac );
256 return jac;
257 }
258
267 template< class Point >
268 HessianRangeType hessian ( const Point &p ) const
269 {
271 hessian( p, h );
272 return h;
273 }
274
276 void init ( const EntityType &entity )
277 {
278#ifdef TESTTHREADING
279 if (thread_ == -1) thread_ = MPIManager::thread();
280 if (thread_ != MPIManager::thread())
281 {
282 std::cout << "wrong thread number\n";
283 assert(0);
284 std::abort();
285 }
286#endif
288 discreteFunction().getLocalDofs( entity, localDofVector() );
289 }
290
291 void bind ( const EntityType &entity ) { init( entity ); }
292 void unbind ()
293 {
294#ifdef TESTTHREADING
295 if (thread_ != MPIManager::thread())
296 {
297 std::cout << "wrong thread number\n";
298 assert(0);
299 std::abort();
300 }
301#endif
302 }
303 void bind(const IntersectionType &intersection, IntersectionSide side)
304 {
306 intersection.inside(): intersection.outside() );
307 }
308
310 const GridFunctionType &gridFunction() const { return discreteFunction(); }
311
312 protected:
314#ifdef TESTTHREADING
315 int thread_;
316#endif
317 };
318
319
320
321 // ConstLocalFunction
322 // ------------------
323
324 namespace Impl
325 {
326
327 template< class GF, class = void >
328 struct ConstLocalFunction;
329
330 template< class GF >
331 struct ConstLocalFunction< GF, std::enable_if_t< std::is_base_of< Fem::HasLocalFunction, GF >::value && std::is_base_of< Fem::IsDiscreteFunction, GF >::value > >
332 {
334 };
335
336 template< class GF >
337 struct ConstLocalFunction< GF, std::enable_if_t< std::is_base_of< Fem::HasLocalFunction, GF >::value && !std::is_base_of< Fem::IsDiscreteFunction, GF >::value && std::is_class< typename GF::LocalFunctionType >::value > >
338 {
339 struct Type
340 : public GF::LocalFunctionType
341 {
342 typedef GF GridFunctionType;
343 typedef typename GridFunctionType::LocalFunctionType::EntityType EntityType;
344
345 typedef typename GF::LocalFunctionType::DomainType DomainType;
346 typedef typename GF::LocalFunctionType::RangeType RangeType;
347 typedef typename GF::LocalFunctionType::JacobianRangeType JacobianRangeType;
348 typedef typename GF::LocalFunctionType::HessianRangeType HessianRangeType;
349
350 explicit Type ( const GridFunctionType &gridFunction )
351 : GridFunctionType::LocalFunctionType( gridFunction ),
352 gridFunction_( gridFunction ) {}
353 explicit Type ( const EntityType &entity, const GridFunctionType &gridFunction )
354 : GridFunctionType::LocalFunctionType( gridFunction ),
355 gridFunction_( gridFunction )
356 { bind(entity); }
357
358 using GF::LocalFunctionType::evaluate;
359 using GF::LocalFunctionType::jacobian;
360 using GF::LocalFunctionType::hessian;
361 using GF::LocalFunctionType::init;
362 using GF::LocalFunctionType::entity;
363
365 template< class Point >
366 RangeType evaluate ( const Point &p ) const
367 {
368 RangeType val;
369 evaluate( p, val );
370 return val;
371 }
372
374 template< class Point >
375 JacobianRangeType jacobian ( const Point &p ) const
376 {
377 JacobianRangeType jac;
378 jacobian( p, jac );
379 return jac;
380 }
381
383 template< class Point >
384 HessianRangeType hessian ( const Point &p ) const
385 {
386 HessianRangeType h;
387 hessian( p, h );
388 return h;
389 }
390
391 void bind ( const EntityType &entity ) { init( entity ); }
392 void unbind () {}
393 template <class IntersectionType>
394 void bind(const IntersectionType &intersection, IntersectionSide side)
395 {
396 bind( side==IntersectionSide::in?
397 intersection.inside(): intersection.outside() );
398 }
399
400 const GridFunctionType &gridFunction () const { return gridFunction_; }
401
402 private:
403 const GridFunctionType &gridFunction_;
404 };
405 };
406
407 template< class GF >
408 struct ConstLocalFunction< GF, std::enable_if_t< std::is_base_of< Fem::BindableFunction, std::decay_t<GF> >::value && !std::is_base_of< Fem::IsDiscreteFunction, std::decay_t<GF> >::value > >
409 {
410 static_assert( !std::is_reference<GF>::value );
411 struct Type
412 {
413 typedef GF GridFunctionType;
414 typedef std::decay_t<GF> GridFunctionDecayType;
415 typedef typename GridFunctionDecayType::GridPartType GridPartType;
416 typedef typename GridFunctionDecayType::EntityType EntityType;
417 typedef typename GridFunctionDecayType::RangeFieldType RangeFieldType;
418 typedef typename GridFunctionDecayType::DomainType DomainType;
419 typedef typename GridFunctionDecayType::RangeType RangeType;
420 typedef typename GridFunctionDecayType::JacobianRangeType JacobianRangeType;
421 typedef typename GridFunctionDecayType::HessianRangeType HessianRangeType;
422 typedef typename GridFunctionDecayType::FunctionSpaceType FunctionSpaceType;
423
424 template<class Arg, std::enable_if_t<std::is_constructible<GF, Arg>::value, int> = 0>
425 explicit Type ( Arg&& gridFunction )
426 : gridFunction_( std::forward<Arg>(gridFunction) )
427#ifdef TESTTHREADING
428 , thread_(-1)
429#endif
430 {
431 // if (MPIManager::thread()==0 || MPIManager::thread()==1) std::cout << "[" << MPIManager::thread() << "]: CLF " << &gridFunction_ << std::endl;
432 }
433 template<class Arg, std::enable_if_t<std::is_constructible<GF, Arg>::value, int> = 0>
434 explicit Type ( const EntityType &entity, Arg&& gridFunction )
435 : gridFunction_( std::forward<Arg>(gridFunction) )
436#ifdef TESTTHREADING
437 , thread_(-1)
438#endif
439 {
440 bind(entity);
441 }
442
443 template <class Point>
444 void evaluate(const Point &x, RangeType &ret) const
445 {
446 gridFunction().evaluate(x,ret);
447 }
448 template <class Point>
449 void jacobian(const Point &x, JacobianRangeType &ret) const
450 {
451 gridFunction().jacobian(x,ret);
452 }
453 template <class Point>
454 void hessian(const Point &x, HessianRangeType &ret) const
455 {
456 gridFunction().hessian(x,ret);
457 }
458 unsigned int order() const { return gridFunction().order(); }
459
461 template< class Point >
462 RangeType evaluate ( const Point &p ) const
463 {
464 RangeType val;
465 evaluate( p, val );
466 return val;
467 }
468
470 template< class Point >
471 JacobianRangeType jacobian ( const Point &p ) const
472 {
473 JacobianRangeType jac;
474 jacobian( p, jac );
475 return jac;
476 }
477
479 template< class Point >
480 HessianRangeType hessian ( const Point &p ) const
481 {
482 HessianRangeType h;
483 hessian( p, h );
484 return h;
485 }
486
487 template< class Quadrature, class ... Vectors >
488 void evaluateQuadrature ( const Quadrature &quad, Vectors & ... values ) const
489 {
490 static_assert( sizeof...( Vectors ) > 0, "evaluateQuadrature needs to be called with at least one vector." );
491 evaluateFullQuadrature( PriorityTag<42>(), quad, values... );
492 }
493 template< class Quadrature, class Jacobians >
494 void jacobianQuadrature ( const Quadrature &quadrature, Jacobians &jacobians ) const
495 { jacobianQuadrature(quadrature,jacobians, PriorityTag<42>() ); }
496 template< class Quadrature, class Hessians >
497 void hessianQuadrature ( const Quadrature &quadrature, Hessians &hessians ) const
498 { hessianQuadrature(quadrature,hessians, PriorityTag<42>() ); }
499
500 void bind ( const EntityType &entity )
501 {
502#ifdef TESTTHREADING
503 if (thread_ == -1) thread_ = MPIManager::thread();
504 if (thread_ != MPIManager::thread())
505 {
506 std::cout << "wrong thread number\n";
507 assert(0);
508 std::abort();
509 }
510#endif
511 gridFunction_.bind( entity );
512 }
513 void unbind ()
514 {
515#ifdef TESTTHREADING
516 if (thread_ != MPIManager::thread())
517 {
518 std::cout << "wrong thread number\n";
519 assert(0);
520 std::abort();
521 }
522#endif
523 gridFunction_.unbind();
524 }
525 template <class IntersectionType>
526 void bind(const IntersectionType &intersection, IntersectionSide side)
527 {
528#ifdef TESTTHREADING
529 if (thread_ == -1) thread_ = MPIManager::thread();
530 if (thread_ != MPIManager::thread())
531 {
532 std::cout << "wrong thread number\n";
533 assert(0);
534 std::abort();
535 }
536#endif
537 defaultIntersectionBind(gridFunction_,intersection, side);
538 }
539
540 const EntityType& entity() const
541 {
542 return gridFunction_.entity();
543 }
544
545 const GridFunctionDecayType &gridFunction () const { return gridFunction_; }
546
547 private:
548 template< class Quadrature, class ... Vectors, class GF_=GridFunctionDecayType >
549 auto evaluateFullQuadrature ( PriorityTag<1>, const Quadrature &quad, Vectors & ... values ) const
550 -> std::enable_if_t< std::is_void< decltype( std::declval< const GF_& >().evaluateQuadrature(quad,values...))>::value >
551 { gridFunction().evaluateQuadrature(quad,values...); }
552 template< class Quadrature, class ... Vectors >
553 void evaluateFullQuadrature ( PriorityTag<0>, const Quadrature &quad, Vectors & ... values ) const
554 { std::ignore = std::make_tuple( ( evaluateSingleQuadrature( quad, values ), 1 ) ... ); }
555
556 template< class Quadrature, class Jacobians, class GF_=GridFunctionDecayType>
557 auto jacobianQuadrature ( const Quadrature &quadrature, Jacobians &jacobians, PriorityTag<1> ) const
558 -> std::enable_if_t< std::is_void< decltype( std::declval< const GF_& >().jacobianQuadrature(quadrature,jacobians))>::value >
559 { gridFunction().jacobianQuadrature(quadrature,jacobians); }
560 template< class Quadrature, class Jacobians >
561 void jacobianQuadrature ( const Quadrature &quadrature, Jacobians &jacobians, PriorityTag<0> ) const
562 {
563 for( const auto qp : quadrature )
564 jacobians[ qp.index() ] = jacobian( qp );
565 }
566
567 template< class Quadrature, class Hessians, class GF_=GridFunctionDecayType >
568 auto hessianQuadrature ( const Quadrature &quadrature, Hessians &hessians, PriorityTag<1> ) const
569 -> std::enable_if_t< std::is_void< decltype( std::declval< const GF_& >().hessianQuadrature(quadrature,hessians))>::value >
570 { gridFunction().hessianQuadrature(quadrature,hessians); }
571 template< class Quadrature, class Hessians >
572 void hessianQuadrature ( const Quadrature &quadrature, Hessians &hessians, PriorityTag<0> ) const
573 {
574 for( const auto qp : quadrature )
575 hessians[ qp.index() ] = hessian( qp );
576 }
577
578 template< class Quadrature, class Vector >
579 auto evaluateSingleQuadrature ( const Quadrature &quad, Vector &v ) const
580 -> std::enable_if_t< std::is_same< std::decay_t< decltype(v[ 0 ]) >, RangeType >::value >
581 {
582 for( const auto qp : quad )
583 v[ qp.index() ] = evaluate( qp );
584 }
585 template< class Quadrature, class Vector >
586 auto evaluateSingleQuadrature ( const Quadrature &quad, Vector &v ) const
587 -> std::enable_if_t< std::is_same< std::decay_t< decltype(v[ 0 ]) >, JacobianRangeType >::value >
588 { jacobianQuadrature(quad,v); }
589 template< class Quadrature, class Vector >
590 auto evaluateSingleQuadrature ( const Quadrature &quad, Vector &v ) const
591 -> std::enable_if_t< std::is_same< std::decay_t< decltype(v[ 0 ]) >, HessianRangeType >::value >
592 { hessianQuadrature(quad,v); }
593
594 GridFunctionType gridFunction_;
595#ifdef TESTTHREADING
596 int thread_;
597#endif
598 };
599 };
600 } // namespace Impl
601
602
603 template< class GridFunction >
604 using ConstLocalFunction = typename Impl::ConstLocalFunction< GridFunction >::Type;
606 template<class T, class SFINAE = void>
608 : std::false_type
609 {};
610
612 template<class T>
613 struct IsConstLocalFunction<T, std::enable_if_t<!std::is_same<T, std::decay_t<T> >{}> >
614 : IsConstLocalFunction<std::decay_t<T> >
615 {};
616
618 template<class T>
620 T,
621 std::enable_if_t<(std::is_same<T, std::decay_t<T> >{}
622 && std::is_same<T, Fem::ConstLocalFunction<typename T::GridFunctionType> >{}
623 )> >
624 : std::true_type
625 {};
626
627
631 template<class F, std::enable_if_t<!IsConstLocalFunction<F>::value, int> = 0>
632 constexpr auto constLocalFunction(F&& f)
633 {
634 return Fem::ConstLocalFunction<std::decay_t<F> >(std::forward<F>(f));
635 }
636
638 template<class F, std::enable_if_t<IsConstLocalFunction<F>::value, int> = 0>
639 constexpr decltype(auto) constLocalFunction(F&& f)
640 {
641 return std::forward<F>(f);
642 }
643
644 template<class F, class Entity>
645 constexpr auto constLocalFunction(F&& f, const Entity &entity)
646 {
647 return Dune::Fem::ConstLocalFunction<std::decay_t<F> >(entity,std::forward<F>(f));
648 }
649
650 } // namespace Fem
651
652} // namespace Dune
653
654#endif // #ifndef DUNE_FEM_FUNCTION_LOCALFUNCTION_CONST_HH
STL namespace.
Definition: bindguard.hh:11
static GridFunctionView< GF > localFunction(const GF &gf)
Definition: gridfunctionview.hh:118
constexpr auto constLocalFunction(F &&f)
Definition: const.hh:632
void defaultIntersectionBind(GF &gf, const Intersection &intersection, IntersectionSide side)
Definition: intersectionside.hh:25
typename Impl::ConstLocalFunction< GridFunction >::Type ConstLocalFunction
Definition: const.hh:604
IntersectionSide
Definition: intersectionside.hh:10
Definition: explicitfieldvector.hh:75
Traits class for a DiscreteFunction.
Definition: common/discretefunction.hh:61
Definition: const.hh:37
const LocalDofVectorType & localDofVector() const
return const reference to local Dof Vector
Definition: localfunction.hh:415
BasicConstLocalFunction(const BasisFunctionSetType &basisFunctionSet, LocalDofVectorType &&localDofVector)
Definition: const.hh:70
BaseType::BasisFunctionSetType BasisFunctionSetType
type of BasisFunctionSet
Definition: const.hh:49
BasicConstLocalFunction(const BasisFunctionSetType &basisFunctionSet, const LocalDofVectorType &localDofVector)
Definition: const.hh:64
BasicConstLocalFunction(const BaseType &other)
Definition: const.hh:74
BasicConstLocalFunction(ThisType &&other)
Definition: const.hh:77
BaseType::SizeType SizeType
type of SizeType
Definition: const.hh:55
const DofType & operator[](SizeType i) const
Definition: const.hh:79
BaseType::EntityType EntityType
type of Entity
Definition: const.hh:46
BasicConstLocalFunction(const BasisFunctionSetType &basisFunctionSet)
Definition: const.hh:60
BaseType::LocalDofVectorType LocalDofVectorType
type of LocalDofVector
Definition: const.hh:52
BasicConstLocalFunction(LocalDofVectorType &&localDofVector)
Definition: const.hh:68
BasicConstLocalFunction(const ThisType &other)
Definition: const.hh:76
BasicConstLocalFunction(const LocalDofVectorType &localDofVector)
Definition: const.hh:62
BaseType::DofType DofType
type of Dof
Definition: const.hh:43
BasicConstLocalFunction()
default ctor
Definition: const.hh:58
A constant local function carrying values for one entity.
Definition: const.hh:116
const LocalDofVectorType & localDofVector() const
return const reference to local Dof Vector
Definition: localfunction.hh:415
BaseType::HessianRangeType HessianRangeType
Definition: const.hh:140
BaseType::RangeType RangeType
Definition: const.hh:138
const DiscreteFunctionType & discreteFunction() const
Definition: const.hh:309
ConstLocalDiscreteFunction(ThisType &&other)
move constructor
Definition: const.hh:216
ConstLocalDiscreteFunction(const DiscreteFunctionType &df)
constructor creating a local function without binding it to an entity
Definition: const.hh:155
RangeType evaluate(const Point &p) const
evaluate the local function
Definition: const.hh:236
DiscreteFunctionSpaceType::FunctionSpaceType FunctionSpaceType
Definition: const.hh:128
const DiscreteFunctionType * discreteFunction_
Definition: const.hh:313
std::remove_const_t< DiscreteFunction > DiscreteFunctionType
Definition: const.hh:125
void init(const EntityType &entity)
interface for local functions :: init
Definition: const.hh:276
ConstLocalDiscreteFunction(const ThisType &other)
copy constructor
Definition: const.hh:207
BaseType::LocalDofVectorType LocalDofVectorType
Definition: const.hh:136
ConstLocalDiscreteFunction(const DiscreteFunctionType &df, const EntityType &entity)
constructor creating a local function and binding it to an entity
Definition: const.hh:187
DiscreteFunctionType GridFunctionType
Definition: const.hh:130
const GridFunctionType & gridFunction() const
Definition: const.hh:310
BaseType::DofType DofType
Definition: const.hh:132
DiscreteFunctionType::DiscreteFunctionSpaceType DiscreteFunctionSpaceType
Definition: const.hh:126
ConstLocalDiscreteFunction(const typename DiscreteFunctionType::LocalFunctionType &localFunction)
cast a MutableLocalFunction into this one !!! expensive !!!
Definition: const.hh:164
BaseType::BasisFunctionSetType BasisFunctionSetType
Definition: const.hh:135
DiscreteFunctionSpaceType::GridPartType GridPartType
Definition: const.hh:127
BaseType::JacobianRangeType JacobianRangeType
Definition: const.hh:139
void bind(const EntityType &entity)
Definition: const.hh:291
HessianRangeType hessian(const Point &p) const
evaluate Hessian of the local function
Definition: const.hh:268
ConstLocalDiscreteFunction(const EntityType &entity, const DiscreteFunctionType &df)
Definition: const.hh:196
void bind(const IntersectionType &intersection, IntersectionSide side)
Definition: const.hh:303
BaseType::DomainType DomainType
Definition: const.hh:137
BaseType::EntityType EntityType
Definition: const.hh:133
JacobianRangeType jacobian(const Point &p) const
evaluate Jacobian of the local function
Definition: const.hh:252
GridPartType::IntersectionType IntersectionType
Definition: const.hh:134
void unbind()
Definition: const.hh:292
Definition: const.hh:609
interface for local functions
Definition: localfunction.hh:77
const LocalDofVectorType & localDofVector() const
return const reference to local Dof Vector
Definition: localfunction.hh:415
void evaluate(const PointType &x, RangeType &ret) const
evaluate the local function
Definition: localfunction.hh:311
void init(const EntityType &entity)
initialize the local function for an entity
Definition: localfunction.hh:437
FunctionSpaceType::DomainType DomainType
type of domain vectors, i.e., type of coordinates
Definition: localfunction.hh:105
void hessian(const PointType &x, HessianRangeType &ret) const
evaluate Hessian of the local function
Definition: localfunction.hh:339
const EntityType & entity() const
obtain the entity, this local function lives on
Definition: localfunction.hh:302
LocalDofVectorType::value_type DofType
type of DoF use with the discrete function
Definition: localfunction.hh:89
FunctionSpaceType::RangeType RangeType
type of range vectors, i.e., type of function values
Definition: localfunction.hh:107
void axpy(const PointType &x, const RangeType &factor)
axpy operation for local function
Definition: localfunction.hh:233
void jacobian(const PointType &x, JacobianRangeType &ret) const
evaluate Jacobian of the local function
Definition: localfunction.hh:325
FunctionSpaceType::JacobianRangeType JacobianRangeType
type of the Jacobian, i.e., type of evaluated Jacobian matrix
Definition: localfunction.hh:109
LocalDofVectorType::size_type SizeType
type of index
Definition: localfunction.hh:92
void clear()
set all DoFs to zero
Definition: localfunction.hh:195
void assign(const LocalFunction< BasisFunctionSet, T > &other)
assign all DoFs of this local function
Definition: localfunction.hh:189
const BasisFunctionSetType & basisFunctionSet() const
obtain the basis function set for this local function
Definition: localfunction.hh:296
SizeType size() const
obtain the number of local DoFs
Definition: localfunction.hh:360
static int thread()
return thread number
Definition: mpimanager.hh:424
Interface class for basis function sets.
Definition: basisfunctionset/basisfunctionset.hh:31