|
[Sponsors] |
April 1, 2014, 17:50 |
Question in java
|
#1 |
Member
hayder
Join Date: Jan 2012
Posts: 32
Rep Power: 14 |
Hi
I wonder If any one found a way to change the scalar physical quantity to value (double). For example if I need to change the the base size for mesh, the following command will used to read the base size (from volumetric control), GenericAbsoluteSize genericAbsoluteSize_0 = ((GenericAbsoluteSize) volumeSourceSize_0.getAbsoluteSize()); here (generic Absolute Size) is (ScalarPhysicalQuantity) so the following command will not work , double myValue_3 = genericAbsoluteSize_0.getValue() ; So My question Is there other way to read the base size and set it to variable? Thanks in advance |
|
April 1, 2014, 18:57 |
|
#2 |
Senior Member
Join Date: Nov 2010
Location: USA
Posts: 1,232
Rep Power: 24 |
You can cast it to a double. Try:
double myValue_3 = (double) genericAbsoluteSize_0.getValue() ; |
|
April 2, 2014, 04:55 |
|
#3 | |
Member
hayder
Join Date: Jan 2012
Posts: 32
Rep Power: 14 |
Quote:
Hi me3840 Thank you for your prompt reply, but still shows the same error which is (incompatible types: ScalarPhysicalQuantity cannot be converted to double) Is there any other ideas ? Thank you |
||
April 7, 2014, 14:37 |
|
#4 |
Senior Member
Join Date: Nov 2010
Location: USA
Posts: 1,232
Rep Power: 24 |
Ah, a little more complicated.
Just make a ScalarPhysicalQuantity and set the value, then call your double and get the value: double size = 0.0; ScalarPhysicalQuantity scal = ((ScalarPhysicalQuantity) genericAbsoluteSize_0.getValue()); size = scal.getValue(); simulation_0.println(size); |
|
April 8, 2014, 05:12 |
|
#5 | |
Member
hayder
Join Date: Jan 2012
Posts: 32
Rep Power: 14 |
Quote:
That Work now ,Thank you for your help . |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Simple Java question - close & save simulation | eRzBeNgEl | STAR-CCM+ | 8 | September 5, 2013 09:45 |
Quick Java problem. Please help! | Pleb | STAR-CCM+ | 3 | September 8, 2012 16:07 |
Question Re Engineering Data Source | imnull | ANSYS | 0 | March 5, 2012 13:51 |
internal field question - PitzDaily Case | atareen64 | OpenFOAM Running, Solving & CFD | 2 | January 26, 2011 15:26 |
Poisson Solver question | Suresh | Main CFD Forum | 3 | August 12, 2005 04:37 |