CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Trouble declaring DimensionedField for triSurfaceGeoMesh (http://www.cfd-online.com/Forums/openfoam-programming-development/98078-trouble-declaring-dimensionedfield-trisurfacegeomesh.html)

bigphil March 2, 2012 10:27

Trouble declaring DimensionedField for triSurfaceGeoMesh
 
Hi,

I am trying to create a triSurfaceVectorField, but I can't get the code to compile.

I have tried:
Code:

//- create triSurface from stl file
triSurface stlSurf("test.stl");

//- create triSurfaceGeoMesh from triSurface
triSurfaceGeoMesh stlMesh(stlSurf);

//- try to create triSurfaceVectorField but it doesn't like this constructor
triSurfaceVectorField stlVecField
(
        IOobject
        (
          "stlVecField",
          runTime.timeName(),
          runTime,
          IOobject::NO_READ,
          IOobject::AUTO_WRITE
          ),
        stlMesh,
        dimensionedVector("zero", dimForce/dimArea, vector::zero)
);

The compiler complains that this constructor is not found even though it gives this constructor as a candidate.
Here is the compilation error:
Code:

hillSurfSolidFoam.C:89: error: no matching function for call to ‘Foam::DimensionedField<Foam::Vector<double>, Foam::triSurfaceGeoMesh>::DimensionedField(Foam::IOobject, Foam::triSurfaceGeoMesh&, Foam::dimensionedVector)’
/Users/philipc/OpenFOAM/OpenFOAM-1.6-ext/src/OpenFOAM/lnInclude/DimensionedField.C:238: note: candidates are: Foam::DimensionedField<Type, GeoMesh>::DimensionedField(const Foam::word&, const Foam::tmp<Foam::DimensionedField<Type, GeoMesh> >&) [with Type = Foam::Vector<double>, GeoMesh = Foam::triSurfaceGeoMesh]
/Users/philipc/OpenFOAM/OpenFOAM-1.6-ext/src/OpenFOAM/lnInclude/DimensionedField.C:223: note:                Foam::DimensionedField<Type, GeoMesh>::DimensionedField(const Foam::word&, const Foam::Xfer<Foam::DimensionedField<Type, GeoMesh> >&) [with Type = Foam::Vector<double>, GeoMesh = Foam::triSurfaceGeoMesh]
/Users/philipc/OpenFOAM/OpenFOAM-1.6-ext/src/OpenFOAM/lnInclude/DimensionedField.C:209: note:                Foam::DimensionedField<Type, GeoMesh>::DimensionedField(const Foam::word&, Foam::DimensionedField<Type, GeoMesh>&, bool) [with Type = Foam::Vector<double>, GeoMesh = Foam::triSurfaceGeoMesh]
/Users/philipc/OpenFOAM/OpenFOAM-1.6-ext/src/OpenFOAM/lnInclude/DimensionedField.C:194: note:                Foam::DimensionedField<Type, GeoMesh>::DimensionedField(const Foam::word&, const Foam::DimensionedField<Type, GeoMesh>&) [with Type = Foam::Vector<double>, GeoMesh = Foam::triSurfaceGeoMesh]
/Users/philipc/OpenFOAM/OpenFOAM-1.6-ext/src/OpenFOAM/lnInclude/DimensionedField.C:180: note:                Foam::DimensionedField<Type, GeoMesh>::DimensionedField(const Foam::IOobject&, const Foam::DimensionedField<Type, GeoMesh>&) [with Type = Foam::Vector<double>, GeoMesh = Foam::triSurfaceGeoMesh]
/Users/philipc/OpenFOAM/OpenFOAM-1.6-ext/src/OpenFOAM/lnInclude/DimensionedField.C:159: note:                Foam::DimensionedField<Type, GeoMesh>::DimensionedField(const Foam::tmp<Foam::DimensionedField<Type, GeoMesh> >&) [with Type = Foam::Vector<double>, GeoMesh = Foam::triSurfaceGeoMesh]
/Users/philipc/OpenFOAM/OpenFOAM-1.6-ext/src/OpenFOAM/lnInclude/DimensionedField.C:145: note:                Foam::DimensionedField<Type, GeoMesh>::DimensionedField(const Foam::Xfer<Foam::DimensionedField<Type, GeoMesh> >&) [with Type = Foam::Vector<double>, GeoMesh = Foam::triSurfaceGeoMesh]
/Users/philipc/OpenFOAM/OpenFOAM-1.6-ext/src/OpenFOAM/lnInclude/DimensionedField.C:132: note:                Foam::DimensionedField<Type, GeoMesh>::DimensionedField(Foam::DimensionedField<Type, GeoMesh>&, bool) [with Type = Foam::Vector<double>, GeoMesh = Foam::triSurfaceGeoMesh]
/Users/philipc/OpenFOAM/OpenFOAM-1.6-ext/src/OpenFOAM/lnInclude/DimensionedField.C:114: note:                Foam::DimensionedField<Type, GeoMesh>::DimensionedField(const Foam::DimensionedField<Type, GeoMesh>&) [with Type = Foam::Vector<double>, GeoMesh = Foam::triSurfaceGeoMesh]
/Users/philipc/OpenFOAM/OpenFOAM-1.6-ext/src/OpenFOAM/lnInclude/DimensionedFieldIO.C:59: note:                Foam::DimensionedField<Type, GeoMesh>::DimensionedField(const Foam::IOobject&, const typename GeoMesh::Mesh&, const Foam::word&) [with Type = Foam::Vector<double>, GeoMesh = Foam::triSurfaceGeoMesh]
/Users/philipc/OpenFOAM/OpenFOAM-1.6-ext/src/OpenFOAM/lnInclude/DimensionedField.C:101: note:                Foam::DimensionedField<Type, GeoMesh>::DimensionedField(const Foam::IOobject&, const typename GeoMesh::Mesh&, const Foam::dimensioned<Type>&) [with Type = Foam::Vector<double>, GeoMesh = Foam::triSurfaceGeoMesh]
/Users/philipc/OpenFOAM/OpenFOAM-1.6-ext/src/OpenFOAM/lnInclude/DimensionedField.C:86: note:                Foam::DimensionedField<Type, GeoMesh>::DimensionedField(const Foam::IOobject&, const typename GeoMesh::Mesh&, const Foam::dimensionSet&) [with Type = Foam::Vector<double>, GeoMesh = Foam::triSurfaceGeoMesh]
/Users/philipc/OpenFOAM/OpenFOAM-1.6-ext/src/OpenFOAM/lnInclude/DimensionedField.C:58: note:                Foam::DimensionedField<Type, GeoMesh>::DimensionedField(const Foam::IOobject&, const typename GeoMesh::Mesh&, const Foam::dimensionSet&, const Foam::Field<Type>&) [with Type = Foam::Vector<double>, GeoMesh = Foam::triSurfaceGeoMesh]
make: *** [Make/darwinIntel64GccDPOpt/hillSurfSolidFoam.o] Error 1

All suggestions are welcome,
Philip

bigphil March 2, 2012 10:54

OK,

It works if I use triSurfaceMesh instead of triSurfaceGeoMesh so this might be ok for me.

I am not sure what the difference between them is though.

Philip


All times are GMT -4. The time now is 14:10.