CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   gather parallelized fields (https://www.cfd-online.com/Forums/openfoam/95118-gather-parallelized-fields.html)

MichiB December 6, 2011 11:27

gather parallelized fields
 
Hi,
I'm trying to gather fields of boundary patches, which are distributed on multiple processors. I want to due this to generate specialised output using function objects.

I found a function that seems to do exactly what I need ( combineFields(...) ).
I included an adapted version of this function and included it into my functionObject.

Everything compiles smoothly but when the function is called I get an error.

The function looks like this:
Code:

template<class Type>
const tmp<Foam::Field<Type> > turboMonitorPool::combineFields
(
    const Field<Type>& field
) const
{
    List<Field<Type> > allValues(Pstream::nProcs());

    allValues[Pstream::myProcNo()] = field;

    Pstream::gatherList(allValues);

    if (Pstream::master())
    {
        return tmp<Field<Type> >
        (
            new Field<Type>
            (
                ListListOps::combine<Field<Type> >
                (
                    allValues,
                    accessOp<Field<Type> >()
                )
            )
        );
    }
    else
    {
        return tmp<Field<Type> >
        (
            new Field<Type>
            (
                field
            )
        );
        //return field;
    }
}

This is the call:
Code:

       
const fvMesh& mes = refCast<const fvMesh>(obr_);
const tmp< Field<vector> > myCf = combineFields(mes.Cf().boundaryField()[0] );

and this is the error message:
Code:

symbol lookup error: /graz/home/openfoam/OpenFOAM/openfoam-1.6-ext/lib/linux64GccDPOpt/libturboMonitor.so: undefined symbol: _ZNK4Foam16turboMonitorPool13combineFieldsINS_6VectorIdEEEEKNS_3tmpINS_5FieldIT_EEEERKS7_
So the argument that I'm passing is wrong, although I'm passing a field of Type (A special field of type).

Hope someone knows the answer to this one...

Cheers,
Michi


All times are GMT -4. The time now is 04:30.