24#ifndef GROUPED_FIELD_F_HH
25#define GROUPED_FIELD_F_HH
32template <
typename T,
typename DESCRIPTOR,
typename FIELD_ARRAY_TYPE,
typename W>
35 :
GenericF<W,int>( targetDim, 1), _container(container)
40template <
typename T,
typename DESCRIPTOR,
typename FIELD_ARRAY_TYPE,
typename W>
47template <
typename T,
typename DESCRIPTOR,
typename FIELD_ARRAY_TYPE,
typename W>
51 "cast from std::size_t to int unsafe");
52 return _container.size();
55template <
typename T,
typename DESCRIPTOR,
typename FIELD_ARRAY_TYPE,
typename W>
62template <
typename T,
typename DESCRIPTOR,
typename GROUP,
typename FIELD>
66 DESCRIPTOR::template size<typename meta::derived_type_in_nested<DESCRIPTOR,GROUP,FIELD>::type>() )
68 this->
getName() = std::string(
typeid(FIELD).name());
71template <
typename T,
typename DESCRIPTOR,
typename GROUP,
typename FIELD>
75 using GROUP_EVAL =
typename DESCRIPTOR::template derivedField<GROUP>;
76 using FIELD_EVAL =
typename GROUP_EVAL::template derivedField<FIELD>;
77 auto fieldValue = this->getContainer().
data().template get<GROUP_EVAL>()
78 .template getFieldPointer<FIELD_EVAL>(input[0]);
80 for (
int iDim=0; iDim<this->getTargetDim(); ++iDim){
81 output[iDim] = fieldValue[iDim];
92template <
typename T,
typename DESCRIPTOR,
typename FIELD_ARRAY_TYPE,
typename W>
94 :
GenericF<W,int>(targetDim,1), _loadBalancer(loadBalancer)
97template <
typename T,
typename DESCRIPTOR,
typename FIELD_ARRAY_TYPE,
typename W>
100 return _loadBalancer;
103template <
typename T,
typename DESCRIPTOR,
typename FIELD_ARRAY_TYPE,
typename W>
107 "cast from std::size_t to int unsafe");
108 return _containerF.size();
111template <
typename T,
typename DESCRIPTOR,
typename FIELD_ARRAY_TYPE,
typename W>
114 OLB_ASSERT(iCloc <
int(_containerF.size()) && iCloc >= 0,
115 "block functor index outside bounds");
116 return *(_containerF[iCloc]);
119template <
typename T,
typename DESCRIPTOR,
typename FIELD_ARRAY_TYPE,
typename W>
122 if (_loadBalancer.isLocal(input[0])) {
123 const int loc = _loadBalancer.loc(input[0]);
124 return this->getContainerF(loc)(output, &input[1]);
132template <
typename T,
typename DESCRIPTOR,
typename GROUP,
typename FIELD,
typename W>
136 sParticleSystem.getSuperStructure().getLoadBalancer(),
137 DESCRIPTOR::template size<typename meta::derived_type_in_nested<DESCRIPTOR,GROUP,FIELD>::type>() ),
138 _sParticleSystem(sParticleSystem)
140 this->
getName() = std::string(
typeid(FIELD).name());
144 for (
int iC = 0; iC < maxC; iC++) {
147 auto& particleSystem = *bParticleSystems[iC];
148 auto& container = particleSystem.get();
ContainerF is a NON-PARALLELIZED (no block/super differentiation) functor intended to extract data fr...
bool operator()(W output[], const int input[])
int getContainerSize() const
Container< T, DESCRIPTOR, FIELD_ARRAY_TYPE > & getContainer()
ContainerF(Container< T, DESCRIPTOR, FIELD_ARRAY_TYPE > &container, int targetDim)
Container is a std::vector inspired data wrapper that allows for simple content manipulation of its o...
Storage for dynamic field groups (Prototype for ParticleSystem)
GenericF is a base class, that can represent continuous as well as discrete functions.
std::string & getName()
read and write access to name
GroupedFieldF is a NON-PARALLELIZED (no block/super differentiation) functor.
GroupedFieldF(Container< T, DESCRIPTOR, DynamicFieldGroupsD< T, typename DESCRIPTOR::fields_t > > &container)
bool operator()(T output[], const int input[])
Base class for all LoadBalancer.
ContainerF< T, DESCRIPTOR, FIELD_ARRAY_TYPE > & getContainerF(int iCloc)
LoadBalancer< T > & getLoadBalancer()
SuperContainerF(LoadBalancer< T > &loadBalancer, int targetDim)
int getContainerSize() const
std::vector< std::unique_ptr< ContainerF< T, DESCRIPTOR, FIELD_ARRAY_TYPE > > > _containerF
bool operator()(W output[], const int input[])
SuperParticleGroupedFieldF(particles::SuperParticleSystem< T, DESCRIPTOR > &sParticleSystem)
LoadBalancer< T > & getLoadBalancer()
Read and write access to the load balancer.
SuperStructure< T, PARTICLETYPE::d > & getSuperStructure()
std::vector< ParticleSystem< T, PARTICLETYPE > * > & getBlockParticleSystems()
Descriptors for the 2D and 3D lattices.
Top level namespace for all of OpenLB.
#define OLB_ASSERT(COND, MESSAGE)