Hi, everyone
I’m trying to calculate the local curvature in palabos based on the BBS model which needs to get the solid fraction of the neighboring nodes with the vicinity of 2. I do not know whether it is possible to setup a multiscalarfield of vicinity 2.
You can for example create the 100x100x100 MultiScalarField "a" with vicinity of 2 as follows:
[code="cpp"]
MultiScalarField3D<double>* a = generateMultiScalarField(Box3D(0,99, 0,99, 0,99), 0., 2);
There’s a minor inconvenience: “a” is a pointer and is then a bit more clumsy to handle than a static variable, but all in all, this remains the most convenient approach.
solidfraction_dis is an "auto-pointer", which has the same syntax as a normal pointer, but is automatically de-allocated when the program gets out of the current scope.
Cheers,
Jonas
Hi,
I set up the scalar field successfully by using “std::auto_ptr<MultiScalarField2D >”. Thanks a lot.
But now, new problem comes up:
If I want to use the BoxProcessingFunctional2D to define a process for the scalar field, I need firstly define an argument to include all the involved data field, for example:
vector <MultiBlock2D*> get_curvature_arg;
get_curvature_arg.push_back (phase);
get_curvature_arg.push_back (curvature_dis);
get_curvature_arg.push_back (solidfraction_dis);
and then we can use
applyProcessingFunctional (new get_curvature (nx, ny), phase->getBoundingBox (), get_curvature_arg);
to carry out the calculation in the data field.
But the when I compile for this code, I get the error:
error: no matching function for call to ‘std::vector<plb::MultiBlock2D*, std::allocatorplb::MultiBlock2D* >::push_back(std::auto_ptr<plb::MultiScalarField2D >&)’
note: candidates are: void std::vector<_Tp, _Alloc>::push_back(const _Tp&) [with _Tp = plb::MultiBlock2D*, _Alloc = std::allocatorplb::MultiBlock2D*
It seems that the “std::auto_ptr<MultiScalarField2D >” will conflict with the " MultiScalarField3D* " type.
What can I do about this?