6 import org.apache.commons.math.complex.Complex;
17 private float[] imaginary;
18 private float[] norms;
26 return Math.abs(rmin -
rmax) < 1e-8 && Math.abs(
imin -
imax) < 1e-8;
31 real =
new float[size];
32 rmin = Float.MAX_VALUE;
33 rmax = Float.MIN_VALUE;
39 setComplexValue(index, (
float) value.getReal(), (float) value.getImaginary());
43 setComplexValue(index, real[index] + (
float) value.getReal(), imaginary[index] + (float) value.getImaginary());
51 if (imaginary == null) {
52 imaginary =
new float[real.length];
53 norms =
new float[real.length];
65 norms[index] = (float) Math.sqrt(r * r + i * i);
74 return new float[][] { real, imaginary };
float[] getImaginaryDoFs()
boolean isConstant()
Convenience method to determine if the solution field is constant in value.
void setComplexValue(int index, Complex value)
float[][] getComplexValues()
Returns an two times field size-dimensional float array.
void setComplexValue(int index, float r, float i)
ComplexSolutionField(FieldDescriptor f, int size)
Represents a logical solution field of a simulation.
float[] getNorms()
Returns the norms of each entry.
FieldDescriptor descriptor
void addComplexValue(int index, Complex value)
void addComplexValue(int index, float r, float i)
Simple class for feature that can be visualized.
float[] computeColors(float[] fieldValues)
Computes a 4-tuple color array with values R, G, B, Alpha for the given field values.
VisualFeature[] getVisualFeatures(ColorGenerator cg)
Abstract method that returns all available visual features for a logical solution field...
A solution field with complex values.
The color generator is used to produce RGBA (RGB+Alpha) values from a given array of floats...
Contains information about the logical solution fields.
int getSize()
Returns the number of graphical elements (nodes/vertices or elements/faces) that this field contains ...