CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Some macros definitions in the extended version

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By noiseMaker

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 18, 2016, 09:01
Unhappy Some macros definitions in the extended version
  #1
New Member
 
Nelly El Achkar
Join Date: May 2016
Location: Germany
Posts: 10
Rep Power: 9
noiseMaker is on a distinguished road
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
noiseMaker is offline   Reply With Quote

Old   August 18, 2016, 09:33
Default
  #2
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
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
)
Then I tried with a blockCoupled one and had to figure out the place to manipulate / insert the new one. For the coupled stuff you need to make new matrix solver here:

Code:
cp -r foam/matrices/blockLduMatrix/BlockLduSolvers/BlockBiCGStab/ cp foam/matrices/blockLduMatrix/BlockLduSolvers/myNewGuy
cd foam/matrices/blockLduMatrix/BlockLduSolvers/myNewGuy

manipulate everything and compile
The result for the pUCoupledFoam is then:
Code:
--> FOAM FATAL IO ERROR: 
Unknown asymmetric matrix solver iCGStab

Valid asymmetric matrix solvers are :

5
(
AMG
BiCGStab
MyNewGuy
GMRES
GaussSeidel
)
Hope this is the answer to your question. If you manipulate and insert the solver in coupledMatrix, it will not find the stuff. You have to figure out yourself how they are connected but that was not your question
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   August 18, 2016, 10:50
Default
  #3
New Member
 
Nelly El Achkar
Join Date: May 2016
Location: Germany
Posts: 10
Rep Power: 9
noiseMaker is on a distinguished road
So, you're saying that I am suppose to copy myDummy folder in the solvers folders and compile it there?
noiseMaker is offline   Reply With Quote

Old   August 18, 2016, 11:13
Default
  #4
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
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
Tobi is offline   Reply With Quote

Old   August 19, 2016, 08:49
Default
  #5
New Member
 
Nelly El Achkar
Join Date: May 2016
Location: Germany
Posts: 10
Rep Power: 9
noiseMaker is on a distinguished road
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
noiseMaker is offline   Reply With Quote

Old   August 19, 2016, 14:09
Default
  #6
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
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
);
I do not know out of the box how you should do it but it will also work (I think).

  • If I understand you correct, you compile your new solver on the desctop because of root access.
  • For that you made a new Make folder and files + options (or)?
  • The name of the library should be included in your controlDict
  • and of course, wmake libso (:
Hope it is clear and it will help you.


PS: I think in the user guide there is a section about "How to include own libraries".
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   August 22, 2016, 06:24
Default
  #7
New Member
 
Nelly El Achkar
Join Date: May 2016
Location: Germany
Posts: 10
Rep Power: 9
noiseMaker is on a distinguished road
Yes Yes Yes. I did exactly that. Still not working
noiseMaker is offline   Reply With Quote

Old   August 22, 2016, 09:31
Default
  #8
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Will try it
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   August 22, 2016, 10:41
Default
  #9
New Member
 
Nelly El Achkar
Join Date: May 2016
Location: Germany
Posts: 10
Rep Power: 9
noiseMaker is on a distinguished road
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
noiseMaker is offline   Reply With Quote

Old   August 23, 2016, 03:57
Default
  #10
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
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
Tobi is offline   Reply With Quote

Old   August 24, 2016, 04:49
Default
  #11
New Member
 
Nelly El Achkar
Join Date: May 2016
Location: Germany
Posts: 10
Rep Power: 9
noiseMaker is on a distinguished road
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
)
Tobi likes this.
noiseMaker is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 08:32.