CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Copy the data vector from a reference cell (https://www.cfd-online.com/Forums/openfoam-programming-development/180899-copy-data-vector-reference-cell.html)

heksel8i December 2, 2016 16:51

Copy the data vector from a reference cell
 
Hey!

I would like to create a reference cell in my domain and then would like to copy a data vector, which values change in time, from the reference cell to large number of cells elsewhere in the domain.

Now I'm just wondering how this should be implemented in parallel domain decomposed case. Can all the processors efficiently access the data if I just inquire the data vector from the reference cell when looping through cells in my solver?

So I would like to do something like this and be sure it works in parallel efficiently?

Code:

forAll(cells,i)
{
    if(condition=true)
    {
        dataVectors[i]=dataVectors[refCell];
    }
    else computeNewDataVector;
}



All times are GMT -4. The time now is 02:33.