|
[Sponsors] |
Some macros definitions in the extended version |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 18, 2016, 09:01 |
Some macros definitions in the extended version
|
#1 |
New Member
Nelly El Achkar
Join Date: May 2016
Location: Germany
Posts: 10
Rep Power: 9 |
Hello,
I am currently doing my master thesis in CFD using OpenFoam and one of the tasks I have is to implement and test a new linear solver (called myDummy) for a modified verison of pUCoupledFoam (i.e. solve the Up matrix with myDummy instead of BiCStab, for instance) However, everytime I try to run a case I get the following fatal error: << --> FOAM FATAL IO ERROR: Unknown asymmetric matrix solver myDummy Valid asymmetric matrix solvers are : 4 ( AMG BiCGStab GMRES GaussSeidel ) file: /home/nelly/Desktop/pitzDaily/system/fvSolution::solvers::Up from line 21 to line 28. From function BlockLduSolver<Type>::New ( const word& solverName, const word& fieldName, BlockLduMatrix<Type>& matrix, const dictionary& dict ) in file /opt/foam/foam-extend-3.2/src/foam/lnInclude/BlockLduSolver.C at line 245. FOAM exiting >> This error appears because the linear solver myDummy is not being added to the hash table of asymmetric solvers. The Solver header file myDummys.H reads: << typedef BlockBiCGStabSolver<scalar> blockBiCGStabSolverScalar; typedef BlockBiCGStabSolver<vector> blockBiCGStabSolverVector; typedef BlockBiCGStabSolver<tensor> blockBiCGStabSolverTensor; >> And the souce file myDummys.C reads: << namespace Foam { // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // makeBlockSolvers(blockMyDummySolver); addSymSolverToBlockMatrix(blockMyDummySolver); addAsymSolverToBlockMatrix(blockMyDummySolver); } // End namespace Foam Both the solver and the linera solver compile. I just can't run the case. 1.Does anybody have an idea on what else I could do in order to add the linear solver myDummy to the hash table of solvers of asymmetric matrices? 2. Am I using the right macros here? Thank you!! Noisemaker |
|
August 18, 2016, 09:33 |
|
#2 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51 |
Hi,
I made a test with a normal solver (that is very easy): Code:
--> FOAM FATAL IO ERROR: Unknown asymmetric matrix solver PBiC Valid asymmetric matrix solvers are : 13 ( BICCG BiCG BiCGStab FPEAMG GAMG GMRES MPEAMG PBiCG RREAMG Shorty amgSolver deflation smoothSolver ) Code:
cp -r foam/matrices/blockLduMatrix/BlockLduSolvers/BlockBiCGStab/ cp foam/matrices/blockLduMatrix/BlockLduSolvers/myNewGuy cd foam/matrices/blockLduMatrix/BlockLduSolvers/myNewGuy manipulate everything and compile Code:
--> FOAM FATAL IO ERROR: Unknown asymmetric matrix solver iCGStab Valid asymmetric matrix solvers are : 5 ( AMG BiCGStab MyNewGuy GMRES GaussSeidel )
__________________
Keep foaming, Tobias Holzmann |
|
August 18, 2016, 10:50 |
|
#3 |
New Member
Nelly El Achkar
Join Date: May 2016
Location: Germany
Posts: 10
Rep Power: 9 |
So, you're saying that I am suppose to copy myDummy folder in the solvers folders and compile it there?
|
|
August 18, 2016, 11:13 |
|
#4 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51 |
No, i am saying that the solvers that are available in the hash table for the coupled solvers are based on the matrix solvers. So you should copy one of them and build your own one based on that stuff.
I just made a test. So you have to check the hierarchy of the libraries yourself.
__________________
Keep foaming, Tobias Holzmann |
|
August 19, 2016, 08:49 |
|
#5 |
New Member
Nelly El Achkar
Join Date: May 2016
Location: Germany
Posts: 10
Rep Power: 9 |
Dear Tobi,
In order to understand what is going wrong I ran the test you showed me in the hope of obtaining similar results. So I did the following: 1- Copy BlockBiCGStabSolver to Desktop 2- Change the name from BlockbiCGStabSolver to BlockNewGuySolver without changing the core of the code 3- Compile and test The problem didn't go away. So I am thinking that maybe copying the Folder of the solver into foam-extend and compiling the whole thing might be the solution (the reason I didn't do that is because I don't have root access at the institute, where I am doing my Master thesis). Could it be? Sorry to bother you with something as trivial as this. And thank you so much for your help. Best Regards, Nelly |
|
August 19, 2016, 14:09 |
|
#6 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51 |
Hi,
you (do not) have to compile in the foam-extend folder because you have to modify the Make/files file and add your new library (solver). Otherwise foam will not find it. If you make a standalone lib, then you have to include that in the controlDict like Code:
libs ( BlockNewGuySolver.so );
PS: I think in the user guide there is a section about "How to include own libraries".
__________________
Keep foaming, Tobias Holzmann |
|
August 22, 2016, 06:24 |
|
#7 |
New Member
Nelly El Achkar
Join Date: May 2016
Location: Germany
Posts: 10
Rep Power: 9 |
Yes Yes Yes. I did exactly that. Still not working
|
|
August 22, 2016, 10:41 |
|
#9 |
New Member
Nelly El Achkar
Join Date: May 2016
Location: Germany
Posts: 10
Rep Power: 9 |
Important update
there is a source file called blockVectorNSolvers.C. It contains macros for the definition and inclusion of linear solvers into the hash table. I think this is the one I need to manipulate in order to get myDummy added to the list at runtime. But I can't do it today. I am compiling and OF extended version that I can manipulate and modify whichever way I want without root access. Seemed like the easiest option. Let me know how it goes Tobi, Liebe Grüße , Noisemaker |
|
August 23, 2016, 03:57 |
|
#10 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51 |
Okay, if you use a local compilation, then do it first. If you have still problems, I will check it out (always busy and the best things are, if people solve their problems themselves )
Good luck.
__________________
Keep foaming, Tobias Holzmann |
|
August 24, 2016, 04:49 |
|
#11 |
New Member
Nelly El Achkar
Join Date: May 2016
Location: Germany
Posts: 10
Rep Power: 9 |
it's like that:
1- copy/paste/changeName of solver 2- manipulate blockVectorNSolvers.C (add one #include and one typedef) 3- In the files file: - blockVectorNSolvers.C - BlockMyNewGuySolvers.C 4- wmake 5- wmake libso Result Code:
--> FOAM FATAL IO ERROR: Unknown asymmetric matrix solver DDD Valid asymmetric matrix solvers are : 5 ( AMG BiCGStab GMRES GaussSeidel MyNewGuy ) |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Rotation in extended version 3.0 | filjas | OpenFOAM Programming & Development | 2 | November 5, 2014 12:54 |
[Matlab] - Add toolbox to version R2012b. | darkluix88 | Lounge | 2 | October 23, 2014 10:23 |
Extended version: Dynamic mesh | fusij | OpenFOAM | 2 | February 18, 2011 02:12 |
OpenCFD release OpenFOAM® version 1.7.1 | opencfd | OpenFOAM Announcements from ESI-OpenCFD | 0 | August 26, 2010 11:40 |
OpenFOAM Patched Version 1.5 via git Repository | OpenFOAM discussion board administrator | OpenFOAM Announcements from ESI-OpenCFD | 0 | August 26, 2008 05:06 |