OF-2.2.x: Derived class from cellZone and "undefined symbol error"
I derived a class from the cellZone class. The most important things of the .H file are:
Code:
namespace Foam Code:
... Code:
const cellZoneMesh& czm(mesh.cellZones()); Code:
interPhaseChangeFoam: symbol lookup error: /home/OpenFOAM/user-2.2.x/platforms/linux64GccDPOpt/lib/libspecial.so: undefined symbol: _ZN4Foam8cellZoneC2ERKS0_ Has anybody an idea what I could be doing wrong in this code? Thank you very much. |
Greetings A_Pete,
Knowing the contents of "Make/files" and "Make/options" for your custom library would help. It would also help to know how exactly you've built it (i.e., the commands used). Because without that information, my guess from that error message is that the problem is one of the following:
Bruno |
Hi Bruno,
first of all thank you very much for your answer. To complete my post, my "Make/files" looks like this: Code:
cavEroNew/cavEroNew.C And my "Make/options" looks like this: Code:
EXE_INC = \ I also had in mind that "-lOpenFOAM" needs to be added, but this didn't help as I had it already in my "Make/options". The error was still the same. To 2): I just have OpenFOAM 2.2.x installed right now. I didn't have any other version on my computer installed. To 3): Thanks for your hint. I think that this is where the problem lies! But I am not sure how to solve it. When I derive a class "erosionVolume" from a base class "cellZone", am I able to call the private constructor of the cellZone class? What I want is this: I want a new class "erosionVolume", that can be constructed by: a) just a cellZone or b) a cellZone and a name/label to identify it. For now, I would like to realize just option a): I want to construct my erosionVolume, by initializing it with a cellZone. The problem is, that in my erosionVolume.C a constructor of the cellZone class has to be called in order to be able to use all its properties in my derived class, right? This is what I have shown in the .C file in my first post: Code:
... Any further help would be appreciated. Thank you very much. Best regards, Andreas |
How to assign a cellZone to derived class?
I have now edited my code so that I am able to use a constructor of the cellZone class. The header and source file got modified in the following way:
Header: Code:
... Code:
namespace Foam The question is now, how I can assign a cellZone to my derived class? Just like erosionVolume = cellZone. |
Hi Andreas,
Sorry, I'm a bit short on time for the past and coming weeks, so could you please provide an example test case + source code to make it easier for me to test this and to to try and to figure out the issue? Because OpenFOAM uses C++ in such a way, that only looking at the source code is not enough to figure out the issue, unless one has a lot of experience with the code... and I'm not that good yet with it :( Best regards, Bruno |
For future readers, here's small report on the information exchanged on this topic, from private messages exchanged with Andreas, just in case someone in the future want to ask about this as well.
The objective was/is to have a class that can manage a keep track of a "cellZone" and do additional operations to that "cellZone", such as calculate equations, do averages, keep a history and so on. On my first iteration of looking into this, the hypothesis was to perhaps use an "fvOption", but: Quote:
Quote:
But then again, as I mentioned before, multi-region capabilities for this case might be overkill and possibly will need more RAM then it should be necessary. Best regards, Bruno |
Thanks for the update, Bruno.
I will also update this thread given my last message to Bruno. Quote:
Andreas |
All times are GMT -4. The time now is 01:32. |