CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Adding new solver (http://www.cfd-online.com/Forums/openfoam-programming-development/101464-adding-new-solver.html)

linch May 4, 2012 11:46

Adding new solver
 
Hi,

I made some modifications to src/finiteVolume/fvMatrices/solvers/MULES/ For that I copied MULES to ~/OpenFOAM/shevchuk-2.1.x/src/finiteVolume/fvMatrices/solvers/ and renamed it to MyMULES.

As I don't want to copy the whole finiteVolume library to WM_PROJECT_USER_DIR I just added this line to src/finiteVolume/Make/files:
Quote:

~/OpenFOAM/shevchuk-2.1.x/src/finiteVolume/fvMatrices/solvers/MyMULES/MyMULES.C
after the original line:
Quote:

fvMatrices/solvers/MULES/MULES.C
After the successful compilation are still no MyMULES.C, MyMULES.H & MyMULESTemplates.C in (LIB_SRC)/finiteVolume/lnInclude (MyMULES was definitely compiled)

What didn't I do?

marupio May 4, 2012 12:00

Sometimes lnIncludes don't update. To force it, you can go to src/finiteVolume and execute:
Code:

wmakeLnIncludeAll .
or better yet, just delete src/finiteVolume/lnInclude, and it will automatically rebuild it on compile.

You might also want to do rmdepall so that each object remaps its dependencies.

linch May 7, 2012 07:16

Thanks David,

unfortunately it doens't help. I must have forgotten something. Or to be honest, I just don't know how to do it properly.

If I remove dependencies, remove lnInclude and start the compilation over new by executing
Code:

wclean; wmake libso
from src/finiteVolume and look to the output carefully, I see no "MyMULES" at the beginning, where dependencies are established:
Quote:

...
Making dependency list for source file fvMatrices/fvScalarMatrix/fvScalarMatrix.C
Making dependency list for source file fvMatrices/solvers/MULES/MULES.C
Making dependency list for source file fvMatrices/solvers/GAMGSymSolver/GAMGAgglomerations/faceAreaPairGAMGAgglomeration/faceAreaPairGAMGAgglomeration.C
...
But later there are both of them:
Quote:

...
SOURCE=fvMatrices/solvers/MULES/MULES.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/home/shevchuk/OpenFOAM/OpenFOAM-2.1.x/src/triSurface/lnInclude -I/home/shevchuk/OpenFOAM/OpenFOAM-2.1.x/src/meshTools/lnInclude -IlnInclude -I. -I/home/shevchuk/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude -I/home/shevchuk/OpenFOAM/OpenFOAM-2.1.x/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/MULES.o

SOURCE=/home/shevchuk/OpenFOAM/shevchuk-2.1.x/src/finiteVolume/fvMatrices/solvers/MyMULES/MyMULES.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/home/shevchuk/OpenFOAM/OpenFOAM-2.1.x/src/triSurface/lnInclude -I/home/shevchuk/OpenFOAM/OpenFOAM-2.1.x/src/meshTools/lnInclude -IlnInclude -I. -I/home/shevchuk/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude -I/home/shevchuk/OpenFOAM/OpenFOAM-2.1.x/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/MyMULES.o
...
May be it can help diagnosing the problem.

linch May 7, 2012 07:27

Now I have made a dummy modification of MyMULES (just added a space character somewhere, where it doesn't matter) and executed "wmake libso" again. Here is the output:
Quote:

Making dependency list for source file /home/shevchuk/OpenFOAM/shevchuk-2.1.x/src/finiteVolume/fvMatrices/solvers/MyMULES/MyMULES.C
SOURCE=/home/shevchuk/OpenFOAM/shevchuk-2.1.x/src/finiteVolume/fvMatrices/solvers/MyMULES/MyMULES.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/home/shevchuk/OpenFOAM/OpenFOAM-2.1.x/src/triSurface/lnInclude -I/home/shevchuk/OpenFOAM/OpenFOAM-2.1.x/src/meshTools/lnInclude -IlnInclude -I. -I/home/shevchuk/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude -I/home/shevchuk/OpenFOAM/OpenFOAM-2.1.x/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/MyMULES.o
'/home/shevchuk/OpenFOAM/OpenFOAM-2.1.x/platforms/linux64GccDPOpt/lib/libfiniteVolume.so' is up to date.
Now, the "Making dependency list ..." line is there. But there is still nothing in lnInclude.


All times are GMT -4. The time now is 10:42.