IGLib
1.7.2
The IGLib base library EXTENDED - with other lilbraries and applications.
|
Base class for simulation field DTOs (data transfer objects). More...
Public Member Functions | |
SimFieldBaseDto (string fieldName, int dimensionOfSpace, int[] dimensions) | |
Constructs a new field DTO that stores node values of a field. More... | |
SimFieldBaseDto (string fieldName, int dimensionOfSpace) | |
Constructs a new field DTO that stores node values of a scalar field. More... | |
SimFieldBaseDto (string fieldName, int dimensionOfSpace, int fieldDimension) | |
Constructs a new field DTO that stores node values of a vector field. More... | |
SimFieldBaseDto (string fieldName, int dimensionOfSpace, int fieldDimension1, int fieldDimension2) | |
Constructs a new field DTO that stores node values of a tensor field. More... | |
int | GetRank () |
Returns rank (number of dimensions) of the current field - 0 for scalars, 1 for vectors, 2 for tensors. More... | |
int | GetDimension (int whichDimension) |
Returns the specified dimension of the field. More... | |
override SimFieldBaseDto < FieldType > | CreateObject () |
Creates and returns a new object of the type whose data is represented by the current DTO (Data Transfer Object). WARNING: Implement thread locking in overriding functions! More... | |
override void | NulllifyCrossLinks () |
Sets all cross links in the internall structure of the current DTO (data transfer object) to null. Cross links facilitate traversing of teh internal structure. More... | |
override void | RestoreCrossLinks () |
Restore cross links in the internall structure of the current DTO. More... | |
![]() | |
virtual string | GetComponentType () |
Returns type of the current component. More... | |
![]() | |
SerializationDtoBase () | |
virtual bool | GetNull () |
Returns a flag indicating whether the object represented by the current DTO is null. More... | |
virtual void | SetNull (bool isNull) |
Sets a flag indicating whether the object represented by the current DTO is null. More... | |
virtual void | CopyFromBase (BaseType obj) |
Copies data to the current DTO from an object of type BaseType. More... | |
virtual void | CopyToBase (ref BaseType obj) |
Copies data from the current DTO to an object of the base type. Object is created anew if necessary by using the CreateObject() method. More... | |
virtual void | CopyFrom (Type obj) |
Copies data to the current DTO from an object of type Type. More... | |
virtual void | CopyTo (ref Type obj) |
Copies data from the current DTO to an object of type Type. Object is created anew if necessary by using the CreateObject() method. More... | |
virtual void | CopyFromObject (object obj) |
Copies data to the current DTO from an object of type object. The necessary casts are performed. More... | |
virtual void | CopyToObject (ref object obj) |
Copies data from the current DTO to an object of type object. Object is created anew if necessary by using the CreateObject() method. The necessary casts are performed. More... | |
override string | ToString () |
Creates and returns string representation of the current DTO (data transfer object). More... | |
![]() | |
string | GetComponentType () |
Returns type of the current component. More... | |
Static Public Member Functions | |
static void | SaveJson (SimFieldBaseDto< FieldType > simField, string filePath) |
Saves (serializes) the specified simulation field to the specified JSON file. File is owerwritten if it exists. More... | |
static void | SaveJson (SimFieldBaseDto< FieldType > simField, string filePath, bool append) |
Saves (serializes) the specified simulation field to the specified JSON file. If the file already exists, contents either overwrites the file or is appended at the end, dependent on the value of the append flag. More... | |
static void | LoadJson (string filePath, ref SimFieldBaseDto< FieldType > simFieldRestored) |
Restores (deserializes) a simulation field from the specified file in JSON format. More... | |
![]() | |
static ObjectType | CopyToObjectReturned< DtoType, ObjectType > (DtoType dto, ObjectType obj) |
Replacement for CopyToObject for cases where object can not be passed by reference. The returned object must be assigned to object (property, list element, etc.) to which object state is copied. More... | |
static void | CopyToObject< DtoType, ObjectType > (DtoType dto, ref ObjectType obj) |
Copies object state form the specified DTO (data transfer object) to the specified object. More... | |
static DtoType | CopyFromObjectReturned< DtoType, ObjectType > (ObjectType obj, DtoType dto) |
Replacement for CopyFromObject for cases where object can not be passed by reference. The returned object must be assigned to object (property, list element, etc.) to which object state is copied. More... | |
static void | CopyFromObject< DtoType, ObjectType > (ObjectType obj, ref DtoType dto) |
Copies object state form the specified object to the corresponding DTO (data transfer object). More... | |
static ObjectType[] | CopyArrayToObjectReturned< DtoType, ObjectType > (DtoType[] tabDto, ObjectType[] tabObj) |
Replacement for CopyArrayToObject for cases where object can not be passed by reference. The returned object must be assigned to object (property, list element, etc.) to which data is copied. More... | |
static void | CopyArrayToObject< DtoType, ObjectType > (DtoType[] tabDto, ref ObjectType[] tabObj) |
Copies array of DTOs (Data Transfer Objects) to an array of appropriate objects. More... | |
static DtoType[] | CopyArrayFromObjectReturned< DtoType, ObjectType > (ObjectType[] tabObj, DtoType[] tabDto) |
Replacement for CopyArrayFromObject for cases where object can not be passed by reference. The returned object must be assigned to object (property, list element, etc.) to which data is copied. More... | |
static void | CopyArrayFromObject< DtoType, ObjectType > (ObjectType[] tabObj, ref DtoType[] tabDto) |
Copies array of objects to an array of DTOs. More... | |
static List< ObjectType > | CopyListToObjectReturned< DtoType, ObjectType > (DtoType[] tabDto, List< ObjectType > listObj) |
Replacement for CopyListToObject for cases where object can not be passed by reference. The returned object must be assigned to object (property, list element, etc.) to which data is copied. More... | |
static void | CopyListToObject< DtoType, ObjectType > (DtoType[] tabDto, ref List< ObjectType > listObj) |
Copies array of DTOs (Data Transfer Objects) to a list of appropriate objects. More... | |
static DtoType[] | CopyListFromObjectReturned< DtoType, ObjectType > (List< ObjectType > tabObj, DtoType[] tabDto) |
Replacement for CopyArrayFromObject for cases where object can not be passed by reference. The returned object must be assigned to object (property, list element, etc.) to which data is copied. More... | |
static void | CopyListFromObject< DtoType, ObjectType > (List< ObjectType > tabObj, ref DtoType[] tabDto) |
Copies array of objects to a list of DTOs. More... | |
Public Attributes | |
string | FieldName |
Name of the field whose component is represented by the current object. More... | |
int | DimensionOfSpace |
Dimension of space in which the field represented by the current object is embedded. More... | |
int | Length |
Number of nodal values of the field (number of nodes on which field is defined). More... | |
int[] | Dimensions |
Dimensions of the field (null for scalar fields). More... | |
double[] | Values |
Node values of the current field elemet. More... | |
Protected Member Functions | |
override void | CopyFromPlain (SimFieldBaseDto< FieldType > obj) |
override void | CopyToPlain (ref SimFieldBaseDto< FieldType > obj) |
![]() | |
SimulationComponentDtoBase () | |
![]() | |
abstract void | CopyFromPlain (BaseType obj) |
Copies contents of the specified object to the current DTO (Data Transfer Object). More... | |
abstract void | CopyToPlain (ref BaseType obj) |
Copies contents of the current DTO (Data Transfer Object) to the specified object. More... | |
![]() | |
SerializationDto () | |
Private Member Functions | |
SimFieldBaseDto () | |
Additional Inherited Members | |
![]() | |
bool | _isNull = false |
![]() | |
object | Lock [get] |
This object's central lock object to be used by other object. Do not use this object for locking in class' methods, for this you should use InternalLock. More... | |
![]() | |
object | Lock [get] |
Base class for simulation field DTOs (data transfer objects).
Holds node values of all elements of the specified field.
$A Igor Aug11 Nov11;
FieldType | : | SimFieldBaseDto<FieldType> |
|
inlineprivate |
|
inline |
Constructs a new field DTO that stores node values of a field.
fieldName | Name of the field. |
dimensionOfSpace | Dimension of vector space in which field exists. |
dimensions | Dimensions of the field. Should be null for scalar fields, 1 element array for vector fields, 2 element array for tensor fields, etc. |
|
inline |
Constructs a new field DTO that stores node values of a scalar field.
fieldName | Name of the field. |
dimensionOfSpace | Dimension of vector space in which field exists. |
|
inline |
Constructs a new field DTO that stores node values of a vector field.
fieldName | Name of the field. |
dimensionOfSpace | Dimension of vector space in which field exists. |
fieldDimension | Dimension of vector field that is stored by the current DTO (number of elements - components per each point value). |
|
inline |
Constructs a new field DTO that stores node values of a tensor field.
fieldName | Name of the field. |
dimensionOfSpace | Dimension of vector space in which field exists. |
fieldDimension1 | First dimension of the tensor field (i.e. number of rows of its matrix representation). |
fieldDimension2 | Second dimension of the tensor field (i.e. number of columns of its matrix representation). |
|
inline |
Returns rank (number of dimensions) of the current field - 0 for scalars, 1 for vectors, 2 for tensors.
|
inline |
Returns the specified dimension of the field.
whichDimension | Specifies which dimension of the field should be returned (applies for fields of rank 1 or greater). |
|
inlinestatic |
Saves (serializes) the specified simulation field to the specified JSON file. File is owerwritten if it exists.
simField | Object that is saved to a file. |
filePath | Path to the file in which object is is saved. |
|
inlinestatic |
Saves (serializes) the specified simulation field to the specified JSON file. If the file already exists, contents either overwrites the file or is appended at the end, dependent on the value of the append flag.
simField | Object that is saved to a file. |
filePath | Path to the file in which object is is saved. |
append | Specifies whether serialized data is appended at the end of the file in the case that the file already exists. |
References IG.Sim.SimFieldBaseDto< FieldType >.NulllifyCrossLinks(), and IG.Sim.SimFieldBaseDto< FieldType >.RestoreCrossLinks().
|
inlinestatic |
Restores (deserializes) a simulation field from the specified file in JSON format.
filePath | File from which object is restored. |
simFieldRestored | Object that is restored by deserialization. |
The restored object is always created anew from scratch. Therefore, if simFieldRestored already contains some object, it is overwritten.
References IG.Sim.SimFieldBaseDto< FieldType >.RestoreCrossLinks().
|
inlineprotected |
|
inlineprotected |
|
inlinevirtual |
Creates and returns a new object of the type whose data is represented by the current DTO (Data Transfer Object). WARNING: Implement thread locking in overriding functions!
Therad locking should be performed in overriding functions!
Implements IG.Lib.SerializationDtoBase< Type, BaseType >.
|
inlinevirtual |
Sets all cross links in the internall structure of the current DTO (data transfer object) to null. Cross links facilitate traversing of teh internal structure.
Implements IG.Sim.SimulationComponentDtoBase< Type, BaseType >.
Referenced by IG.Sim.SimDomainDto.NulllifyCrossLinks(), and IG.Sim.SimFieldBaseDto< FieldType >.SaveJson().
|
inlinevirtual |
Restore cross links in the internall structure of the current DTO.
Implements IG.Sim.SimulationComponentDtoBase< Type, BaseType >.
Referenced by IG.Sim.SimFieldBaseDto< FieldType >.LoadJson(), IG.Sim.SimDomainDto.RestoreCrossLinks(), and IG.Sim.SimFieldBaseDto< FieldType >.SaveJson().
string IG.Sim.SimFieldBaseDto< FieldType >.FieldName |
Name of the field whose component is represented by the current object.
Referenced by IG.Sim.SimDomainDto.GetScalarFieldIndex(), IG.Sim.SimDomainDto.GetTensorFieldIndex(), and IG.Sim.SimDomainDto.GetVectorFieldIndex().
int IG.Sim.SimFieldBaseDto< FieldType >.DimensionOfSpace |
Dimension of space in which the field represented by the current object is embedded.
int IG.Sim.SimFieldBaseDto< FieldType >.Length |
Number of nodal values of the field (number of nodes on which field is defined).
Referenced by IG.Sim.SimDomainDto.AddScalarField(), IG.Sim.SimDomainDto.AddTensorField(), IG.Sim.SimDomainDto.AddVectorField(), IG.Sim.SimDomainDto.GetScalarFieldIndex(), IG.Sim.SimDomainDto.GetTensorFieldIndex(), IG.Sim.SimDomainDto.GetVectorFieldIndex(), IG.Sim.SimDomainDto.NulllifyCrossLinks(), IG.Sim.SimDomainDto.RemoveScalarfield(), IG.Sim.SimDomainDto.RemoveTensorfield(), IG.Sim.SimDomainDto.RemoveVectorfield(), and IG.Sim.SimDomainDto.RestoreCrossLinks().
int [] IG.Sim.SimFieldBaseDto< FieldType >.Dimensions |
Dimensions of the field (null for scalar fields).
For example, {2, 2} for tensors in 2D space, or {3} for vectors in 3D space.
double [] IG.Sim.SimFieldBaseDto< FieldType >.Values |
Node values of the current field elemet.