I have just started using palabos, and I’m thoroughly confused with the multiblock structure and multitensorfield class.
Specifically, I have 2 vector fields stored as MultiTensorField <float, 2> objects, and I wanted to subtract them: calling them u and v, conceptually I would like to do "w(x)=u(x)-v(x) " for every x on the lattice, and store w as a new MultiTensorField <float, 2> type object.
The function reference appendix at palabos user’s guide (http://www.palabos.org/documentation/userguide/appendix-functions.html#appendix-in-place-operations) has the following method in its description:
subtract(A, B, domain)
Return C=A-B, applied to every element of the domain.
Which is precisely what I need. However if I try to compile this piece of code: [code=“cpp”]
MultiTensorField2D<T,2> analyticalVelocity(lattice); //Define U
setToFunction( analyticalVelocity, analyticalVelocity.getBoundingBox(),
PoiseuilleVelocity(parameters) );
MultiTensorField2D<T,2> numericalVelocity(lattice); //Define V
computeVelocity(lattice, numericalVelocity, lattice.getBoundingBox());
std::auto_ptr<MultiTensorField2D<T,2> > subtract(analyticalVelocity, numericalVelocity, lattice); //Subtract!
The code won't compile. What would be the correct synthax for this case?
Do I need to write a data processor for this operation? If so, how would write that? Would I need to call [code="cpp"]
subtract(A, B, domain)
inside the process method?
Thanks in advance