|
[Sponsors] | |||||
Grabbing value of a dimensioned quantity / Problem creating a dimensioned tensor |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|
|
#1 | |
|
Member
Thomas Vossel
Join Date: Aug 2013
Posts: 45
Rep Power: 14 ![]() |
Hi!
I'm starting to write my first solver and when testing some simple measure that might come in handy for bughunting I encountered a problem concerning dimensioned values: I wanted to print a component of the gravitational acceleration in the terminal when running the solver. I would have thought that this has to look like this: Code:
Info << g.z(); Code:
Info << g; Quote:
In addition to that I tried using the following code to create a dimensioned tensor which I took right out of the programmer's guide (as I thought maybe the way g is integrated via the readGravitationalAcceleration.H file might be the reason why g.z() won't work): Code:
dimensionedTensor sigma ( "sigma", dimensionSet(1, -1, -2, 0, 0, 0, 0), tensor(1e6,0,0,0,1e6,0,0,0,1e6), ); |
||
|
|
|
||
|
|
|
#2 |
|
New Member
Andreas Groß
Join Date: Sep 2013
Posts: 8
Rep Power: 14 ![]() |
Hey ThomasV,
first of all, showing compiler errors helps helping... ;-) Didn't try, but Code:
g.value().z() |
|
|
|
|
|
|
|
|
#3 | |
|
Member
Thomas Vossel
Join Date: Aug 2013
Posts: 45
Rep Power: 14 ![]() |
Hey!
Thanks for your help - g.value().z() worked... ![]() Concerning the compiler messages: Those unfortunately said pretty much nothing as the compiling process simply was aborted with a Quote:
|
||
|
|
|
||
|
|
|
#4 |
|
New Member
Andreas Groß
Join Date: Sep 2013
Posts: 8
Rep Power: 14 ![]() |
The compiler tells us more (at least g++ (GCC) 4.7.2 20121109 (Red Hat 4.7.2-8) does):
Code:
(...) minimalTestFoam.C: In Funktion »int main(int, char**)«: minimalTestFoam.C:55:5: Fehler: expected primary-expression before »)« token make: *** [Make/linux64GccDPOpt/minimalTestFoam.o] Error 1 Code:
50 dimensionedTensor sigma
51 (
52 "sigma",
53 dimensionSet(1, -1, -2, 0, 0, 0, 0),
54 tensor(1e6,0,0,0,1e6,0,0,0,1e6),
55 );
//EDIT: fixed bracket... |
|
|
|
|
|
|
|
|
#5 |
|
Member
Thomas Vossel
Join Date: Aug 2013
Posts: 45
Rep Power: 14 ![]() |
Well that's interesting. So your compiler writes those notifications right into the terminal? I'll have to check then if this is suppressed over here or something like that as currently I only get this make: *** message which then aborts the compilation process without further comments as to what caused this...
I'll also try to report this issue so this gets corrected in the programmer's guide...
|
|
|
|
|
|
|
|
|
#6 | |
|
Senior Member
Deep
Join Date: Oct 2017
Posts: 180
Rep Power: 10 ![]() |
Quote:
This doesn't seem to output the set of dimensions, at least in OF6. I am particularly interested in the dimensions of fields calculated at a given point in solver. These may or may not be defined fields e.g. U and p are defined but say I want to find out calculated dimensions of a quantity "U/p". Is there any way to do that in OF6? |
||
|
|
|
||
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| F_YI(f,t,i) is creating a problem | techy | Fluent UDF and Scheme Programming | 7 | April 2, 2015 06:36 |
| Problem in creating .gtm & .pre file | HMR | CFX | 0 | January 14, 2011 22:17 |
| Problem in defining and using the deformation rate tensor | titio | OpenFOAM Running, Solving & CFD | 0 | November 19, 2009 13:50 |
| Having problem in creating a volume mech in GAMBIT | Jake | FLUENT | 1 | April 25, 2008 06:01 |
| [Other] Problem when trying to generate a new mesh | gaottino | OpenFOAM Meshing & Mesh Conversion | 0 | June 30, 2006 08:51 |