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

New.C

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   July 26, 2013, 09:04
Default New.C
  #1
New Member
 
klemen
Join Date: Aug 2012
Location: Slovenia
Posts: 21
Rep Power: 4
fogl is on a distinguished road
Hello everybody,

I am looking at source code of the engineMesh class utility, and i noticed that there is also the engineMeshNew.C - I am not sure what is its purpose.

I would like to undestand how the moveEngineMesh utility works. I ran it in debug mode and i noticesd it calls some functions within engineMeshNew.C. But when i checked the source, i could not find any #include "engineMeshNew.C" instruction.

Can someone please explain to me how did this engineMeshNew.C get into the compiled code?
What is this "Foam::autoPtr<Foam::engineMesh > New"?

Regards
Klemen
fogl is offline   Reply With Quote

Old   July 26, 2013, 17:53
Default
  #2
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 725
Rep Power: 18
mturcios777 will become famous soon enough
Have a look at the Make/files for the engine library, and you see that enginypeyMeshNew.C is compiled. engineMeshNew.C contains the run time construction mechanism, which allows the the engine mesh type to be specified at run time rather than at compilation of the library/solver. In the engineFoam solver, you will see that createEngineMesh.C is included, which is in the lnInclude folder. There, it calls the constructor defined in engineMeshNew.C. Hope this clears it up.
mturcios777 is offline   Reply With Quote

Old   July 29, 2013, 08:29
Default
  #3
New Member
 
klemen
Join Date: Aug 2012
Location: Slovenia
Posts: 21
Rep Power: 4
fogl is on a distinguished road
Ok, i see, thank you.

Now i tried to compile the source inside the engine folder, to test how it goes, because this is what i will also have to do when i will try to compile my own code. I ran wclan and wmake, but it does not compile the code. Some files are missing (see below). BTW, I already successfully compiled the whole source using Allwmake. Why can't i compile just one part of the code. Should i look for all the missing files and include them in Make/options?


klemen@klemen-VirtualBox:~/OpenFOAM/OpenFOAM-2.2.0/src/engine$ wclean
klemen@klemen-VirtualBox:~/OpenFOAM/OpenFOAM-2.2.0/src/engine$ wmake
Making dependency list for source file engineTime/engineTime.C
Making dependency list for source file ignition/ignition.C
Making dependency list for source file ignition/ignitionIO.C
could not open file engineTime.H for source file ignition/ignitionIO.C
Making dependency list for source file ignition/ignitionSite.C
Making dependency list for source file ignition/ignitionSiteIO.C
could not open file engineTime.H for source file ignition/ignitionSiteIO.C
Making dependency list for source file engineValve/engineValve.C
could not open file engineTime.H for source file engineValve/engineValve.C
Making dependency list for source file enginePiston/enginePiston.C
could not open file engineTime.H for source file enginePiston/enginePiston.C
Making dependency list for source file engineMesh/engineMesh/engineMesh.C
could not open file engineTime.H for source file engineMesh/engineMesh/engineMesh.C
Making dependency list for source file engineMesh/engineMesh/engineMeshNew.C
could not open file engineTime.H for source file engineMesh/engineMesh/engineMeshNew.C
Making dependency list for source file engineMesh/staticEngineMesh/staticEngineMesh.C
could not open file engineMesh.H for source file engineMesh/staticEngineMesh/staticEngineMesh.C
Making dependency list for source file engineMesh/layeredEngineMesh/layeredEngineMesh.C
could not open file engineMesh.H for source file engineMesh/layeredEngineMesh/layeredEngineMesh.C
Making dependency list for source file engineMesh/fvMotionSolverEngineMesh/fvMotionSolverEngineMesh.C
could not open file engineMesh.H for source file engineMesh/fvMotionSolverEngineMesh/fvMotionSolverEngineMesh.C
SOURCE=engineTime/engineTime.C ; g++ -m32 -Dlinux -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -O0 -fdefault-inline -ggdb3 -DFULLDEBUG -DNoRepository -ftemplate-depth-100 -I/home/klemen/OpenFOAM/OpenFOAM-2.2.0/src/finiteVolume/lnInclude -I/home/klemen/OpenFOAM/OpenFOAM-2.2.0/src/meshTools/lnInclude -I/home/klemen/OpenFOAM/OpenFOAM-2.2.0/src/dynamicMesh/lnInclude -I/home/klemen/OpenFOAM/OpenFOAM-2.2.0/src/fvMotionSolver/lnInclude -IlnInclude -I. -I/home/klemen/OpenFOAM/OpenFOAM-2.2.0/src/OpenFOAM/lnInclude -I/home/klemen/OpenFOAM/OpenFOAM-2.2.0/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linuxGccDPDebug/engineTime.o
SOURCE=ignition/ignition.C ; g++ -m32 -Dlinux -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -O0 -fdefault-inline -ggdb3 -DFULLDEBUG -DNoRepository -ftemplate-depth-100 -I/home/klemen/OpenFOAM/OpenFOAM-2.2.0/src/finiteVolume/lnInclude -I/home/klemen/OpenFOAM/OpenFOAM-2.2.0/src/meshTools/lnInclude -I/home/klemen/OpenFOAM/OpenFOAM-2.2.0/src/dynamicMesh/lnInclude -I/home/klemen/OpenFOAM/OpenFOAM-2.2.0/src/fvMotionSolver/lnInclude -IlnInclude -I. -I/home/klemen/OpenFOAM/OpenFOAM-2.2.0/src/OpenFOAM/lnInclude -I/home/klemen/OpenFOAM/OpenFOAM-2.2.0/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linuxGccDPDebug/ignition.o
SOURCE=ignition/ignitionIO.C ; g++ -m32 -Dlinux -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -O0 -fdefault-inline -ggdb3 -DFULLDEBUG -DNoRepository -ftemplate-depth-100 -I/home/klemen/OpenFOAM/OpenFOAM-2.2.0/src/finiteVolume/lnInclude -I/home/klemen/OpenFOAM/OpenFOAM-2.2.0/src/meshTools/lnInclude -I/home/klemen/OpenFOAM/OpenFOAM-2.2.0/src/dynamicMesh/lnInclude -I/home/klemen/OpenFOAM/OpenFOAM-2.2.0/src/fvMotionSolver/lnInclude -IlnInclude -I. -I/home/klemen/OpenFOAM/OpenFOAM-2.2.0/src/OpenFOAM/lnInclude -I/home/klemen/OpenFOAM/OpenFOAM-2.2.0/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linuxGccDPDebug/ignitionIO.o
ignition/ignitionIO.C:26:24: fatal error: engineTime.H: No such file or directory
compilation terminated.
make: *** [Make/linuxGccDPDebug/ignitionIO.o] Error 1
fogl is offline   Reply With Quote

Old   July 29, 2013, 13:13
Default
  #4
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 725
Rep Power: 18
mturcios777 will become famous soon enough
engine is a library, so you need to run wmake libso for it to compile.
mturcios777 is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 02:09.