24#ifndef SET_BOUNDARY_2D_H
25#define SET_BOUNDARY_2D_H
30template<
typename T,
typename DESCRIPTOR>
36 block.defineDynamics({iX, iY}, dynamics);
37 auto cell = block.get(iX,iY);
40 if (postProcessor && !block.isPadding({iX,iY})) {
41 block.addPostProcessor(*postProcessor);
45template<
typename T,
typename DESCRIPTOR>
50 block.defineDynamics({iX, iY}, dynamics);
51 auto cell = block.get(iX,iY);
57template<
typename T,
typename DESCRIPTOR>
72 communicator.template requestField<descriptors::POPULATION>();
75 for (
int iCloc = 0; iCloc < sLattice.
getLoadBalancer().size(); ++iCloc) {
79 for (
int iX = -_overlap; iX < nX+_overlap; ++iX) {
80 for (
int iY = -_overlap; iY < nY+_overlap; ++iY) {
81 if (iX < 0 || iX > nX - 1 ||
82 iY < 0 || iY > nY - 1 ) {
85 for (
int iXo = -_overlap; iXo <= _overlap && !found; ++iXo) {
86 for (
int iYo = -_overlap; iYo <= _overlap && !found; ++iYo) {
87 const int nextX = iXo + iX;
88 const int nextY = iYo + iY;
89 if (indicator->getBlockIndicatorF(iCloc)(nextX, nextY)) {
90 communicator.requestCell({iCloc, iX, iY});
101 communicator.exchangeRequests();
105namespace boundaryhelper {
109 typename T,
typename DESCRIPTOR,
110 template<
int...>
typename DYNAMICS
127 throw std::runtime_error(
"Could not set Boundary.");
133 typename T,
typename DESCRIPTOR,
134 template<
int...>
typename DYNAMICS
141 else if (n[0] == -1) {
144 else if (n[1] == 1) {
147 else if (n[1] == -1) {
151 throw std::runtime_error(
"Could not set Boundary.");
157 typename T,
typename DESCRIPTOR,
158 template <
typename,
typename,
typename>
typename DYNAMICS,
159 template <
int,
int>
typename MOMENTA
162 template <
int x,
int y>
172 typename T,
typename DESCRIPTOR,
173 template <
typename,
typename,
typename>
typename DYNAMICS,
174 template <
int,
int>
typename MOMENTA
177 template <
int x,
int y>
187 typename T,
typename DESCRIPTOR,
188 template <
typename,
typename,
typename,
int,
int>
typename DYNAMICS,
189 template <
int,
int>
typename MOMENTA
192 template <
int x,
int y>
202 typename T,
typename DESCRIPTOR,
203 template <
typename,
typename,
typename,
typename,
int,
int>
typename DYNAMICS,
205 template <
int,
int>
typename MOMENTA
208 template <
int x,
int y>
219 typename RESULT,
typename T,
typename DESCRIPTOR,
220 template <
typename,
typename,
int,
int>
typename TYPE,
226 return new TYPE<T,DESCRIPTOR,1,1>(std::forward<
decltype(args)>(args)...);
229 return new TYPE<T,DESCRIPTOR,1,-1>(std::forward<decltype(args)>(args)...);
232 return new TYPE<T,DESCRIPTOR,-1,1>(std::forward<decltype(args)>(args)...);
235 return new TYPE<T,DESCRIPTOR,-1,-1>(std::forward<decltype(args)>(args)...);
238 throw std::runtime_error(
"Could not set Boundary.");
243 typename RESULT,
typename T,
typename DESCRIPTOR,
244 template <
int,
int>
typename TYPE
273 throw std::runtime_error(
"Invalid normal");
278 typename RESULT,
typename T,
typename DESCRIPTOR,
279 template <
typename,
typename,
int,
int>
typename TYPE
284 return meta::id<TYPE<T,DESCRIPTOR,1,1>>();
287 return meta::id<TYPE<T,DESCRIPTOR,1,-1>>();
290 return meta::id<TYPE<T,DESCRIPTOR,-1,1>>();
293 return meta::id<TYPE<T,DESCRIPTOR,-1,-1>>();
296 return meta::id<TYPE<T,DESCRIPTOR,-1,0>>();
299 return meta::id<TYPE<T,DESCRIPTOR,1,0>>();
302 return meta::id<TYPE<T,DESCRIPTOR,0,-1>>();
305 return meta::id<TYPE<T,DESCRIPTOR,0,1>>();
308 throw std::runtime_error(
"Invalid normal");
314 typename T,
typename DESCRIPTOR,
315 template <
typename,
typename,
int,
int>
typename TYPE,
324 typename T,
typename DESCRIPTOR,
325 template<
int...>
typename TYPE
333 typename T,
typename DESCRIPTOR,
334 template<
typename,
typename,
int,
int>
typename TYPE
344 typename RESULT,
typename T,
typename DESCRIPTOR,
345 template <
typename,
typename,
int,
int>
typename TYPE,
351 return new TYPE<T,DESCRIPTOR,0,1>(std::forward<
decltype(args)>(args)...);
353 else if (n[0] == -1) {
354 return new TYPE<T,DESCRIPTOR,0,-1>(std::forward<decltype(args)>(args)...);
356 else if (n[1] == 1) {
357 return new TYPE<T,DESCRIPTOR,1,1>(std::forward<
decltype(args)>(args)...);
359 else if (n[1] == -1) {
360 return new TYPE<T,DESCRIPTOR,1,-1>(std::forward<decltype(args)>(args)...);
363 throw std::runtime_error(
"Could not set Boundary.");
369 typename T,
typename DESCRIPTOR,
370 template <
typename,
typename,
int,
int>
typename TYPE
377 else if (n[0] == -1) {
378 return meta::id<TYPE<T,DESCRIPTOR,0,-1>>();
380 else if (n[1] == 1) {
383 else if (n[1] == -1) {
384 return meta::id<TYPE<T,DESCRIPTOR,1,-1>>();
387 throw std::runtime_error(
"Invalid normal");
393 typename T,
typename DESCRIPTOR,
394 template <
typename,
typename,
int,
int>
typename TYPE,
403 typename T,
typename DESCRIPTOR,
404 template <
typename,
typename,
int,
int>
typename TYPE
Factory for instances of a specific Dynamics type.
Smart pointer for managing the various ways of passing functors around.
Factory for instances of a specific OPERATOR type.
Representation of a statistic for a parallel 2D geometry.
BlockGeometry< T, D > & getBlockGeometry(int locIC)
Read and write access to a single block geometry.
Super class maintaining block lattices for a cuboid decomposition.
SuperCommunicator< T, SuperLattice > & getCommunicator(STAGE stage=STAGE())
Return communicator for given communication stage.
LoadBalancer< T > & getLoadBalancer()
Read and write access to the load balancer.
DynamicsPromise< T, DESCRIPTOR > constructConcreteDynamicsForDirectionOrientation(Vector< int, 2 > n)
PostProcessorGenerator2D< T, DESCRIPTOR > * constructPostProcessorForNormal(Vector< int, 2 > n, ARGS &&... args)
PROMISE promiseForDirectionOrientation(Vector< int, 2 > n)
RESULT * constructForNormal(Vector< int, 2 > n, ARGS &&... args)
PostProcessorPromise< T, DESCRIPTOR > promisePostProcessorForNormal(Vector< int, 2 > n)
RESULT * constructForDirectionOrientation(Vector< int, 2 > n, ARGS &&... args)
RESULT promiseForNormal(Vector< int, 2 > n)
DynamicsPromise< T, DESCRIPTOR > constructConcreteDynamicsForNormal(Vector< int, 2 > n)
PostProcessorGenerator2D< T, DESCRIPTOR > * constructPostProcessorForDirectionOrientation(Vector< int, 2 > n, ARGS &&... args)
PostProcessorPromise< T, DESCRIPTOR > promisePostProcessorForDirectionOrientation(Vector< int, 2 > n)
Top level namespace for all of OpenLB.
void addPoints2CommBC(SuperLattice< T, DESCRIPTOR > &sLattice, FunctorPtr< SuperIndicatorF2D< T > > &&indicator, int _overlap)
Adds needed Cells to the Communicator _commBC in SuperLattice.
Vector(T &&t, Ts &&... ts) -> Vector< std::remove_cvref_t< T >, 1+sizeof...(Ts)>
DynamicsPromise(meta::id< DYNAMICS >) -> DynamicsPromise< typename DYNAMICS::value_t, typename DYNAMICS::descriptor_t >
void setBoundary(BlockLattice< T, DESCRIPTOR > &block, int iX, int iY, Dynamics< T, DESCRIPTOR > *dynamics, PostProcessorGenerator2D< T, DESCRIPTOR > *postProcessor)
Interface for per-cell dynamics.
virtual void initialize(Cell< T, DESCRIPTOR > &cell)
Initialize dynamics-specific data for cell.
DYNAMICS< T, DESCRIPTOR, MOMENTA< x, y >, x, y > ConcreteDynamics
static auto construct(Vector< int, 2 > n)
DYNAMICS< T, DESCRIPTOR, MIXIN, MOMENTA< x, y >, x, y > ConcreteDynamics
static auto construct(Vector< int, 2 > n)
DYNAMICS< T, DESCRIPTOR, MOMENTA< x, y > > ConcreteDynamics
static auto construct(Vector< int, 2 > n)
static auto construct(Vector< int, 2 > n)
DYNAMICS< T, DESCRIPTOR, MOMENTA< x, y > > ConcreteDynamics
Communication after propagation.