CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (https://www.cfd-online.com/Forums/openfoam-installation/)
-   -   Compilation error in FTRsurfaceFormatRunTime.C (https://www.cfd-online.com/Forums/openfoam-installation/71289-compilation-error-ftrsurfaceformatruntime-c.html)

begou December 23, 2009 10:11

Compilation error in FTRsurfaceFormatRunTime.C
 
Hi,

I'm trying to compile OpenFOAM 1.6.x retreived from the git server.

Platform: SGI Altix 450 (IA64)
Compiler: icpc (Intel C++) version 10.1.011

The compilation fails for FTRsurfaceFormatRunTime.C. I'm not familar with OpenFOAM (I'm system engineer). I've found that the error come from
the included file FTRsurfaceFormat.H witch declare a local ftrPatch class with minimal public interface.

Line 64 of included file FTRsurfaceFormat.H instantiate a list of ftrPatch:
List<ftrPatch> ftrPatches(is);
wich requires 2 additional services: "!=" operator and a "<<" operator between an Ostream and a const ftrpatch.

I've added these public methods but as I don't know a lot about OpenFOAM I'm not sure they will do the sight thing (specialy for the second one).

Here is my modified version for the ftrPatch Class. Thanks for your advices about it.

class ftrPatch
{
//- Name of patch
word name_;

//- Type of patch (ignored since it is usually "empty")
word type_;

public:

const word& name() const
{
return name_;
}

// added by Begou 23/12/2009
bool operator != (const ftrPatch & autre) const
{
return !(name_ == autre.name_ && type_ == autre.type_);
}

friend Istream& operator>>(Istream& is, ftrPatch& p)
{
is >> p.name_ >> p.type_;
return is;
}

// added by Begou 23/12/2009
friend Ostream& operator << (Ostream& os, const ftrPatch& p)
{
os<<p.name_ <<endl<< p.type_;
return os;
}
};

These modifications allow compilation of the FTRsurfaceFormatRunTime.C file.



All times are GMT -4. The time now is 03:53.