Question in java
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 |
You can cast it to a double. Try:
double myValue_3 = (double) genericAbsoluteSize_0.getValue() ; |
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 |
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); |
Quote:
That Work now ,Thank you for your help . |
All times are GMT -4. The time now is 17:50. |