Dear Community,
I would like to store the densities computed at a timestep and pass this to coupling object in the next time step.
Essentially the densities at a given timestep is a scalar field at each lattice node.
I tried to store it as
`
struct PREV_PHI: public FIELD_BASE<1,0,0> { };
using T = FLOATING_POINT_TYPE;
using DESCRIPTOR = D3Q19<PREV_PHI>;
`
Then using a post processor I store it after each time-step
`
class StorePrevPhi {
public:
static constexpr OperatorScope scope = OperatorScope::PerCell;
int getPriority() const {
// Ensure that the post processor is executed after any boundary processing
// Alternatively it may be nicer to add it to a custom stage and call it only when necessary in the main loop
return std::numeric_limits<int>::max();
}
template <typename CELL>
void apply(CELL& cell) any_platform {
using V = typename CELL::value_t;
using DESCRIPTOR = typename CELL::descriptor_t;
V rho { };
rho=cell.computeRho();
cell.template setField<PREV_PHI>(rho);
}
};
I add the post-processor
`
sLattice.addPostProcessor(bulkIndicatorHE, meta::id<StorePrevPhi>{});
`
However in the coupling, when I try to access the FIELD PREV_PHI using
`
auto prevphi = cellPFE.template getFieldPointer <DESCRIPTOR::PREV_PHI>();
`
I get the error,
olb-1.6r0/src/dynamics/navierStokesAdvectionDiffusionCoupling.h:179:66: error: no member named ‘PREV_PHI’ in ‘olb::descriptors::D3Q19<>’
How do I set a field associated with a cell and access it elsewhere ?