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/)
-   -   Problem compiling custom boundary condition as a library (https://www.cfd-online.com/Forums/openfoam-programming-development/128789-problem-compiling-custom-boundary-condition-library.html)

leroyv January 21, 2014 10:12

Problem compiling custom boundary condition as a library
 
1 Attachment(s)
Dear OpenFOAM programmers,

I am learning how to write my own boundary conditions. This BC represents a mass source term at a reacting boundary. The velocity on the patch is non zero, orthogonal to the patch, and depends on the local density of the fluid and solid phase. I designed it after the oscillatingFixedValue and surfaceNormalFixedValue patches. The header and implementation files are attached.

When I try to compile the llibrary using the wmake libso command, wmake and GCC throw the following error messages (we have some French in there, sorry for that):
Code:

In file included from pyrolysisVelocityFvPatchField.C:26:0:
pyrolysisVelocityFvPatchField.H:243:1: erreur: ‘patch’ has not been declared
pyrolysisVelocityFvPatchField.H:243:1: erreur: expected constructor, destructor, or type conversion before ‘;’ token
pyrolysisVelocityFvPatchField.H:243:1: erreur: ‘patchMapper’ has not been declared
pyrolysisVelocityFvPatchField.H:243:1: erreur: expected constructor, destructor, or type conversion before ‘;’ token
pyrolysisVelocityFvPatchField.H:243:1: erreur: expected constructor, destructor, or type conversion before ‘;’ token
make: *** [Make/linux64GccDPOpt/pyrolysisVelocityFvPatchField.o] Erreur 1

Line 243 of pyrolysisVelocityFvPatchField.H is where we find the makePatchField macro. I double checked with other non templated BCs using this macro, and it seems to me like I'm using it correctly. I honestly don't have an idea of what is missing there, does anyone know what is wrong with my code? Any missing constructors or something? I had to remove a few things when I wrote the code, like the mapper methods; are they required?

Vincent

alexeym January 21, 2014 10:39

Hi,

It seems that you forgot

Code:

#include "addToRunTimeSelectionTable.H"
And AFAIR usually makePatchTypeFIield macro is in implementation file (C).

leroyv January 21, 2014 10:44

Solved
 
Quote:

Originally Posted by alexeym (Post 471087)
Hi,

It seems that you forgot

Code:

#include "addToRunTimeSelectionTable.H"
And AFAIR usually makePatchTypeFIield macro is in implementation file (C).

Dear Alexey,

Thank you for your answer, it solved the compilation errors.


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