time dependent external force

Hi,

I would like to add a time dependent ExternalForce in the multicomponent code in palabos-0.6r2. (I know there is a new version, but I am sorry what I used is the old version.) I found an opption about set External Force in the core/dynamic.hh file. But I didnot used it successfully. Please give me a help. The command I used to set the time-dependent external force is as below


int main(int argc, char *argv[])
{
    plbInit(&argc, &argv);
    global::directories().setOutputDir("./tmp/");
.........

     // Main loop over time iterations.
    for (int iT=0; iT<maxIter; ++iT) {

     if (iT > 20){
       Array<T,2> externalforce (0.,0.001);
       setExternalField (insideFluid, Box2D(0, nx-1, 0, ny-1), 1, &externalforce[0]);
     }

the error message is
rayleighTaylor2D.cpp:322: error: `setExternalField’ undeclared (first use this function)

How to deal with this problem? I really appreciate for your help! By the way what is the meaning of size in


void Dynamics<T,Descriptor>::setExternalField (
        Cell<T,Descriptor>& cell, plint pos, plint size, const T* ext)

Thank you in advance.

Hi,

In the version 0.6 you are using, there exists unfortunately no convenient way of changing the external force in a given domain. The only solution in this version is to write your own data processor. This is not difficult, as you can take example on other data processors in the multi-component code, but it is definitely not convenient.

I much more recommend that you upgrade to version 0.7. While this upgrade may require a few minor adaptations in your end-user application, this should be quick, especially if you get inspiration from the example programs.

In version 0.7, you can change the exernal force at any time by calling something like


Array<T,2> externalForce(0.,0.001);
setExternalVector(lattice,lattice.getBoundingBox(),DESCRIPTOR<T>::ExternalField::forceBeginsAt,force);

Hi jlatt,

Thank you for your quick reply and advise. I will upgrade to the new version. If I find further questions in the new version, I will come back. Thank you very much for your help.