1#ifndef __DUNE_ACFEM_LOCALOBJECTSTORAGE_HH__
2#define __DUNE_ACFEM_LOCALOBJECTSTORAGE_HH__
4#include <dune/fem/storage/objectstack.hh>
19 template<
class GlobalObject,
class LocalObject>
23 typedef GlobalObject GlobalObjectType;
24 typedef LocalObject ObjectType;
28 : globalObject_(global)
31 ObjectType *newObject()
const
33 return new ObjectType(globalObject_);
37 GlobalObjectType& globalObject_;
47 template<
class Factory,
template<
class>
class Wrapper>
49 :
public Fem::ObjectStack<Factory>
52 typedef Fem::ObjectStack<Factory> BaseType;
54 typedef Factory LocalObjectFactoryType;
55 typedef typename LocalObjectFactoryType::ObjectType LocalObjectType;
56 typedef typename LocalObjectFactoryType::GlobalObjectType GlobalObjectType;
57 typedef Wrapper<ThisType> LocalWrapperType;
69 LocalWrapperType localObject()
71 return LocalWrapperType(*
this);
74 template<
class Entity>
75 LocalWrapperType localObject(Entity& entity)
77 return LocalWrapperType(entity, *
this);
80 template<
class Entity>
81 const LocalWrapperType localObject(Entity& entity)
const
83 return LocalWrappertType(entity, *
this);
88 template<
class Storage>
91 typedef Storage StorageType;
92 typedef typename StorageType::LocalObjectFactoryType FactoryType;
93 typedef typename StorageType::GlobalObjectType GlobalObjectType;
104 StorageType& storage()
const
110 FactoryType factory_;
111 mutable StorageType storage_;
119 template<
class Global>
122 typedef Global StorageType;
123 typedef Global GlobalObjectType;
129 GlobalObjectType& storage()
const
135 GlobalObjectType& global_;
Define a factory for a "local object" which has a constructor which accepts a single argument,...
Definition: localobjectstorage.hh:21
Local object stack which (hopefully) efficiently caches local objects.
Definition: localobjectstorage.hh:50
Provide a writable object stack for technical reasons.
Definition: localobjectstorage.hh:90
Provide a writable pseudo object stack which is only a reference to the global object.
Definition: localobjectstorage.hh:121