CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Post-Processing

Time selection in FoamToEnsight utility

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

Reply
 
LinkBack Thread Tools Display Modes
Old   October 21, 2009, 02:29
Default
  #21
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: http://olesenm.github.io/
Posts: 777
Rep Power: 18
olesen will become famous soon enough
Quote:
Originally Posted by melanie View Post
Ok, I should have written
Code:
autoPtr<myProcessorMeshes> procMeshes;
The class is named myProcessorMeshes, the variable is procMeshes.
But still I do not understand the details of the implementation you suggested with the autoPtr, I did not find documentation about this. And I don't know either if there is a subclass in all this. And it still does not work ! Please excuse my mistakes that may seem trivial to you, I am just learning C++ and OF programming...
Sorry, you should trust the documentation before you trust the coding quality of posts. And I obviously didn't check the docs before posting my suggestion (sorry for the confusion).

This might work better,
Code:
autoPtr<myProcessorMeshes> procMeshes;
if (USE_DECOMP_CONDITION)
{
   procMeshes.set(new myProcessorMeshes( ...));
}
but please be safe and read the documentation (http://foam.sourceforge.net/doc/Doxy..._1autoPtr.html) or the header files before believing me (or anyone).
olesen is offline   Reply With Quote

Old   October 21, 2009, 10:23
Default
  #22
Member
 
Mélanie Piellard
Join Date: Mar 2009
Posts: 86
Rep Power: 8
melanie is on a distinguished road
Thanks again and again Mark, now it is working fine!
Actually I also had to modify the lines where functions of procMeshes are called; since procMeshes is now a pointer and no more a variable,
Code:
procMeshes.readUpdate()
for instance does not work. I have written instead
Code:
procMeshes->readUpdate()
It is good programming?

Is anyone interested in this utility, either to test and/or to use it?

Anyway, many thanks for your patience Mark, I know I got much to learn left on C++ and OF-programming! I think that on the same model, I will modify foamToTecplot utility to include this reconstruction option.

melanie
melanie is offline   Reply With Quote

Old   October 22, 2009, 02:38
Default
  #23
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: http://olesenm.github.io/
Posts: 777
Rep Power: 18
olesen will become famous soon enough
Quote:
Originally Posted by melanie View Post
I have written instead
Code:
procMeshes->readUpdate()
It is good programming?
There is nothing wrong or dangerous about it, but I would normally prefer to write it like this:
Code:
autoPtr<myProcessorMeshes> procMeshesPtr;
// ... some logic here

myProcessorMeshes& procMeshes = procMeshesPtr();

// or with const-only access
 const myProcessorMeshes& procMeshes = procMeshesPtr();

// .. later
procMeshes.readUpdate();
This would let you reuse most of the existing code needing to change the '.' to '->' everywhere. It also provides a *slightly* better measure against passing about invalid pointers.

Check the autoPtr docs again for information about the autoPtr:perator() methods.
olesen is offline   Reply With Quote

Old   November 20, 2009, 05:36
Default
  #24
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: http://olesenm.github.io/
Posts: 777
Rep Power: 18
olesen will become famous soon enough
Hi Melanie,
Any more progress to report?
/mark
olesen is offline   Reply With Quote

Old   November 20, 2009, 07:47
Default
  #25
Member
 
Mélanie Piellard
Join Date: Mar 2009
Posts: 86
Rep Power: 8
melanie is on a distinguished road
Hello Mark,

Actually I was able to successfuly correct my code with your latest suggestions. However, about one week after that, the machine on which I used to compile crashed. And on the other machines, I always have a compilation error, even with code written by others (like foamToTecplot utility). I did not post a bug description since I am not sure of where is the problem, OF paths or Linux Suse version, or something else.

The real problem is that I am also unable to use the code compiled previously; the same error as on compilation is issued, saying
Code:
~/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libfiniteVolume.so: file not recognized: File format not recognized
It is looking for libraries without finding them; everything is at its correct place, since the bug nothing else changed; OF is installed on my home directory so I really don't understand what's going on...

mélanie
melanie is offline   Reply With Quote

Old   November 20, 2009, 08:10
Default
  #26
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: http://olesenm.github.io/
Posts: 777
Rep Power: 18
olesen will become famous soon enough
Quote:
Originally Posted by melanie View Post
The real problem is that I am also unable to use the code compiled previously; the same error as on compilation is issued, saying
Code:
~/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libfiniteVolume.so: file not recognized: File format not recognized
It is looking for libraries without finding them; everything is at its correct place, since the bug nothing else changed; OF is installed on my home directory so I really don't understand what's going on...
This sound really ugly. Perhaps a filesystem error?
What does the 'file' command report?
eg,
Code:
$ file ~/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libfiniteVolume.so
Mine reports
"ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, not stripped"

If that reports okay, but you still have problems, see if the symbol table looks intact (eg, objdump -t ~/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/libfiniteVolume.so).

Beyond that it's hard to say what's wrong.
olesen is offline   Reply With Quote

Old   November 20, 2009, 08:16
Default
  #27
Member
 
Mélanie Piellard
Join Date: Mar 2009
Posts: 86
Rep Power: 8
melanie is on a distinguished road
The answer to the "file" command is:
Code:
ELF 64-bit LSB shared object, AMD x86-64, version 1 (SYSV), not stripped
I do not have the "dynamically linked" attribute, and the answer to the "objdump -t" command is
Code:
File format not recognized
Do you know what it means?
melanie is offline   Reply With Quote

Old   November 20, 2009, 08:27
Default
  #28
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: http://olesenm.github.io/
Posts: 777
Rep Power: 18
olesen will become famous soon enough
Quote:
Originally Posted by melanie View Post
the answer to the "objdump -t" command is
Code:
File format not recognized
Do you know what it means?
Whatever it means, it doesn't sound good.
Have you tried recompiling finiteVolume recently? It would probably help (and can't hurt).
olesen is offline   Reply With Quote

Old   November 20, 2009, 08:40
Default
  #29
Member
 
Mélanie Piellard
Join Date: Mar 2009
Posts: 86
Rep Power: 8
melanie is on a distinguished road
Actually on another machine the reply to the last command is a bit different, and the compilation error is also different. It seems similar to what is reported in this thread so I will firstly try to compile GCC on one of my machines and see if this helps...
melanie 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
SimpleFoam k and epsilon bounded nedved OpenFOAM Running, Solving & CFD 13 November 4, 2013 15:13
SimpleFoam k and epsilon bounded nedved OpenFOAM Running, Solving & CFD 1 November 25, 2008 21:21
IcoFoam parallel woes msrinath80 OpenFOAM Running, Solving & CFD 9 July 22, 2007 02:58
time step selection Jackie Main CFD Forum 5 January 12, 2004 13:26
Physical Reason for stability of Implicit Schemes? radhakrishnan Main CFD Forum 25 December 7, 2000 16:25


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