Table of Contents

Class DataArrayGridLess

Namespace
VirtualLabAPI.Core.Numerics
Assembly
VirtualLabAPI.dll

Class for objects that store data in C^N which are arbitrarily distributed (i.e. not on a grid) in ℝ^M.

[Serializable]
public class DataArrayGridLess : DataArrayBase, ISerializable, IDeserializationCallback, IDocument, IEquatable<IObjectBase>, ICloneable
Inheritance
ObjectBase
SerializableObjectBase
ManualSerialization
DocumentBase
DataArrayGridLess
Implements
IEquatable<IObjectBase>
Inherited Members
Extension Methods

Constructors

DataArrayGridLess(List<VectorD>, (PhysicalProperty propX, PhysicalProperty propY), (string descriptionX, string descriptionY), ComplexField1DArray, PhysicalProperty[], string[])

Special constructor for 2D gridless data arrays.

public DataArrayGridLess(List<VectorD> coordinates, (PhysicalProperty propX, PhysicalProperty propY) propertiesOfCoordinates, (string descriptionX, string descriptionY) commentsOfCoordinates, ComplexField1DArray data, PhysicalProperty[] propertiesOfdata, string[] commentsOfdata)

Parameters

coordinates List<VectorD>

2D coordinates.

propertiesOfCoordinates (PhysicalProperty propX, PhysicalProperty propY)

Physical property for the coordinates

commentsOfCoordinates (string descriptionX, string descriptionY)

Descriptions for the coordinates

data ComplexField1DArray

Array of data in C^N

propertiesOfdata PhysicalProperty[]

Physical properties of each data subset.

commentsOfdata string[]

Comments for each data subset.

DataArrayGridLess(ComplexField, MeasuredQuantity[], string[], ComplexField1DArray, MeasuredQuantity[], string[])

Constructor that uses arrays of coordinates and data values.

public DataArrayGridLess(ComplexField coordinates, MeasuredQuantity[] quantitiesOfCoordinates, string[] commentsOfCoordinates, ComplexField1DArray data, MeasuredQuantity[] quantitiesOfData, string[] commentsOfdata)

Parameters

coordinates ComplexField

Array of coordinates in ℝ^M

quantitiesOfCoordinates MeasuredQuantity[]

Measured quantities for the coordinates

commentsOfCoordinates string[]

Comment for the coordinates

data ComplexField1DArray

Array of data in C^N

quantitiesOfData MeasuredQuantity[]

Measured quantities of each data subset.

commentsOfdata string[]

Comments for each data subset.

DataArrayGridLess(ComplexField, MeasuredQuantity[], string[], ComplexField1DArray, MeasuredQuantity[], string[], ComplexField)

Constructor that uses arrays of coordinates and data values

public DataArrayGridLess(ComplexField coordinates, MeasuredQuantity[] propertiesOfCoordinates, string[] commentsOfCoordinates, ComplexField1DArray data, MeasuredQuantity[] quantitiesOfData, string[] commentsOfdata, ComplexField meshInformation)

Parameters

coordinates ComplexField

Array of coordinates in ℝ²

propertiesOfCoordinates MeasuredQuantity[]

Measured quantities for the coordinates

commentsOfCoordinates string[]

Comment for the coordinates

data ComplexField1DArray

Array of data in C^N

quantitiesOfData MeasuredQuantity[]

Measured quantities of each data subset.

commentsOfdata string[]

Comments for each data subset.

meshInformation ComplexField

the mesh information used within the object

DataArrayGridLess(ComplexField, PhysicalProperty[], string[], ComplexField1DArray, PhysicalProperty[], string[])

Constructor that uses arrays of coordinates and data values

public DataArrayGridLess(ComplexField coordinates, PhysicalProperty[] propertiesOfCoordinates, string[] commentsOfCoordinates, ComplexField1DArray data, PhysicalProperty[] propertiesOfdata, string[] commentsOfdata)

Parameters

coordinates ComplexField

Array of coordinates in ℝ^M

propertiesOfCoordinates PhysicalProperty[]

Physical property for the coordinates

commentsOfCoordinates string[]

Comment for the coordinates

data ComplexField1DArray

Array of data in C^N

propertiesOfdata PhysicalProperty[]

Physical properties of each data subset.

commentsOfdata string[]

Comments for each data subset.

DataArrayGridLess(ComplexField, PhysicalProperty[], string[], ComplexField1DArray, PhysicalProperty[], string[], ComplexField)

Constructor that uses arrays of coordinates and data values.

public DataArrayGridLess(ComplexField coordinates, PhysicalProperty[] propertiesOfCoordinates, string[] commentsOfCoordinates, ComplexField1DArray data, PhysicalProperty[] propertiesOfdata, string[] commentsOfdata, ComplexField meshInformation)

Parameters

coordinates ComplexField

Array of coordinates in R^2.

propertiesOfCoordinates PhysicalProperty[]

Physical property for the coordinates.

commentsOfCoordinates string[]

Comment for the coordinates.

data ComplexField1DArray

Array of data in C^N.

propertiesOfdata PhysicalProperty[]

Physical properties of each data subset.

commentsOfdata string[]

Comments for each data subset.

meshInformation ComplexField

the mesh information used within the object.

DataArrayGridLess(DataArrayGridLess)

Copy constructor.

public DataArrayGridLess(DataArrayGridLess dataArray)

Parameters

dataArray DataArrayGridLess

The data array to copy.

Properties

CommentsOfCoordinates

Gets and sets the comment for each dimension in R^M.

public string[] CommentsOfCoordinates { get; set; }

Property Value

string[]

CommentsOfDataEntries

Gets and sets the comment for each dimension in C^N.

public override string[] CommentsOfDataEntries { get; set; }

Property Value

string[]

Coordinates

Get and set the coordinates for the data in R^M. The coordinates for each dimension k (zero based!) are stored in the columns of this ComplexField: [k, *].

public ComplexField Coordinates { get; set; }

Property Value

ComplexField

Data

Gets and sets the data in C^N. Each 1D complexField holds the data for one dimension.

public ComplexField1DArray Data { get; set; }

Property Value

ComplexField1DArray

DataArrayType

Gets the data array type of this data array.

public override DataArrayType DataArrayType { get; }

Property Value

DataArrayType

DescriptionOfDataPointLabels

Gets and sets the caption of the index / label column.

public string DescriptionOfDataPointLabels { get; set; }

Property Value

string

DimensionalityOfCoordinates

Dimensionality M of the space of independent variables R^M.

public override int DimensionalityOfCoordinates { get; }

Property Value

int

DimensionalityOfData

Dimensionality N of the space of data values C^N.

public override int DimensionalityOfData { get; }

Property Value

int

IsComplex

Are the values defined in C^N (true) or in the subset of real numbers R^N (false).

public override bool IsComplex { get; }

Property Value

bool

MeasuredQuantitiesOfCoordinates

Gets and sets the measured quantity for each dimension in R^M.

public MeasuredQuantity[] MeasuredQuantitiesOfCoordinates { get; set; }

Property Value

MeasuredQuantity[]

MeshInformation

Sets and gets the mesh information of the DataArrayGridLess. If no mesh information is given null will be returned. The ComplexField holds the point indices for each triangle's vertices. So [0,i], [1,i], [2,i] hold the indices of the points which represent the vertices of the i'th triangle.

public ComplexField MeshInformation { get; set; }

Property Value

ComplexField

MeshInformationAvailable

Gets whether mesh information is available.

public bool MeshInformationAvailable { get; }

Property Value

bool

NoOfDataPoints

Gets the number of data values stored.

public int NoOfDataPoints { get; }

Property Value

int

NoSmoothingInterpolationMethod

Gets a flag indicating whether or not none of the interpolation methods is smoothing (like nearest neighbor or constant interval) -> TRUE But if one of the methods does (like all other methods) -> the flag is set to FALSE

public override bool NoSmoothingInterpolationMethod { get; }

Property Value

bool

Methods

Clone()

Deep copy

public override object Clone()

Returns

object

Copy of data array

CoordinatesByDataPointIndex(int)

Gets the coordinates for a given data point index.

public PhysicalValue[] CoordinatesByDataPointIndex(int index)

Parameters

index int

Index to get the located data for.

Returns

PhysicalValue[]

Coordinate vector for the index.

CreateDataArrayGridless2D_fromComplexArray(Complex[,], bool, bool, MeasuredQuantity[], string[], MeasuredQuantity, string, MeasuredQuantity, string)

Method which converts complex data (double precision, usually read from a text file) into a gridless 2D data array.

public static DataArrayGridLess CreateDataArrayGridless2D_fromComplexArray(Complex[,] dataMatrix, bool createRealValuedResult, bool dataInColumns, MeasuredQuantity[] quantitiesOfData, string[] commentsOfData, MeasuredQuantity quantityOfXCoordinates, string commentOfXCoordinates, MeasuredQuantity quantityOfYCoordinates, string commentOfYCoordinates)

Parameters

dataMatrix Complex[,]

An array of data which holds the raw values, usually read from a text file.

createRealValuedResult bool

If true, the result will be real-valued, no matter if there are imaginary parts given or not.

dataInColumns bool

If true, the first and second column (first running index in dataMatrix) will be read as coordinates while the third (, fourth, fifth, ...) column will be interpreted as subset(s). Otherwise, the rows (second running index in dataMatrix) will be interpreted the same way.

quantitiesOfData MeasuredQuantity[]

The measured quantities to be set to the subsets which are read from the file.

commentsOfData string[]

The comments to be set to the subsets which are read from the file.

quantityOfXCoordinates MeasuredQuantity

The measured quantity to be set to the x-coordinates.

commentOfXCoordinates string

The comment to be set to the x-coordinates.

quantityOfYCoordinates MeasuredQuantity

The measured quantity to be set to the y-coordinates.

commentOfYCoordinates string

The comment to be set to the y-coordinates.

Returns

DataArrayGridLess

A gridless 2D data array, imported from text file.

Equals(object, EqualityIntent)

Determines whether the specified object is equal to this instance.

public override bool Equals(object otherObject, EqualityIntent equalityIntent)

Parameters

otherObject object

The object to compare with this instance.

equalityIntent EqualityIntent

Defines what kind of equality you want to check when comparing two objects, for example all values or just physical equality.

Returns

bool

true if the specified object is equal to this instance; otherwise, false.

Extract1DDataAlongLine(Line_forGUI_physicalUnits, double, double, out string, out bool)

Method which extracts a non-equidistant 1D data array along a given line.

public DataArray1D Extract1DDataAlongLine(Line_forGUI_physicalUnits extractionLine, double relativeEpsilon, double startCoordinate, out string errorMessage, out bool invertedOrder)

Parameters

extractionLine Line_forGUI_physicalUnits

Line to extract along.

relativeEpsilon double

Epsilon for identifying coordinates as lying "on" the line.

startCoordinate double

The coordinate the 1D data array shall start with.

errorMessage string

Error message string.

invertedOrder bool

If true, the order of the points in the data array is inverted to the order of the points on the line selection.

Returns

DataArray1D

1D data along the given line.

FindGrid2D(out double[], out double[])

Finds a 2D grid for gridless 2D data. Two data points get into the same cell only if AreEqual(double, double) gives true for the coordinates of these data points.

public List<int>[,] FindGrid2D(out double[] xCellsCoords, out double[] yCellsCoords)

Parameters

xCellsCoords double[]

Sorted array of unique x-coordinates for all grid cells.

yCellsCoords double[]

Sorted array of unique y coordinates for all grid cells.

Returns

List<int>[,]

A 2D array of int lists, where the not empty cells hold a list of indices. These indices refer to the indices the data got in this DataArrayGridLess object.

GetCoordinateRangeForDimension(int)

Support method to get the coordinate range for a specific dimension the user need to specify the dimension which shall be evaluated.

public virtual PhysicalValueRange GetCoordinateRangeForDimension(int dimension)

Parameters

dimension int

The dimension to investigate. Important: It is zero-based.

Returns

PhysicalValueRange

The min/max value range.

GetDataForSubset(int)

Gets the data for the given subset index.

public override ComplexField GetDataForSubset(int subsetIndex)

Parameters

subsetIndex int

The index of the subset.

Returns

ComplexField

The ComplexField with the data for the given subset.

GetMinMaxRangeForValues(int, FieldQuantity, bool, out double, out double)

Method to get the min max value range for the selected values within the data array.

public void GetMinMaxRangeForValues(int indexSubsetToCheck, FieldQuantity quantityToCheck, bool evaluateForTriangles, out double minValue, out double maxValue)

Parameters

indexSubsetToCheck int

The subset index which shall be evaluated.

quantityToCheck FieldQuantity

The field quantity to evaluate.

evaluateForTriangles bool

Flag whether to evaluate for triangles.

minValue double

Out parameter for minimum value.

maxValue double

Out parameter for maximum value.

GetNewDocumentWindow(Form, string)

Gets a new document window containing this document.

public override FormDocument GetNewDocumentWindow(Form formMain, string fileName)

Parameters

formMain Form

Reference to the main form (= MDI parent). Can be null if this form will not be shown (e.g. if it is generated just to get the view settings.

fileName string

File name from which the document was opened for inserting into window caption. If this string is empty, the default document name is used.

Returns

FormDocument

A VirtualLabAPI.UI.BasicUI.FormDocument containing this document.

HeaderInformation(int, TextExportImportSettings, FieldQuantity?)

Public method to get the export header (data meaning and sampling parameters) for a specific data array.

public override string HeaderInformation(int subSetID, TextExportImportSettings exportSettings, FieldQuantity? quantityForInformation = null)

Parameters

subSetID int

The ID of the subset for which the header information shall be extracted.

exportSettings TextExportImportSettings

The text export settings (header indicator, decimal separator and so on).

quantityForInformation FieldQuantity?

Optional FieldQuantity for which the header information shall be generated.

Returns

string

The export header string for the subset within the DataArray which has the subSetID.

Load(string)

Loads the specified file name. Works independently from whether the document has been saved without view settings (as prior to VirtualLab 6.0) or with view settings.

public static DataArrayGridLess Load(string fileName)

Parameters

fileName string

Name of the file.

Returns

DataArrayGridLess

The specified document.

SetDataWithPropertiesAndCommentsAtOnce(ComplexField1DArray, MeasuredQuantity[], string[])

Sets the members Data, MeasuredQuantitiesOfCoordinates, and CommentsOfDataEntries at once to ensure consistency.

public void SetDataWithPropertiesAndCommentsAtOnce(ComplexField1DArray data, MeasuredQuantity[] quantities, string[] comments)

Parameters

data ComplexField1DArray

Data to set.

quantities MeasuredQuantity[]

MeasuredQuantitiesOfDataEntries to set.

comments string[]

CommentsOfDataEntries to set.

SetDataWithPropertiesAndCommentsAtOnce(ComplexField[], MeasuredQuantity[], string[])

Sets the members Data, MeasuredQuantitiesOfDataEntries and CommentsOfDataEntries at once to ensure consistency.

public override void SetDataWithPropertiesAndCommentsAtOnce(ComplexField[] data, MeasuredQuantity[] measuredQuantitiesOfDataEntries, string[] commentsOfDataEntries)

Parameters

data ComplexField[]

Data to set.

measuredQuantitiesOfDataEntries MeasuredQuantity[]

MeasuredQuantitiesOfDataEntries to set.

commentsOfDataEntries string[]

CommentsOfDataEntries to set.