IGLib  1.7.2
The IGLib base library EXTENDED - with other lilbraries and applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
IG.Sim.SimDomainDto Class Reference

Base class for simulation domains. More...

+ Inheritance diagram for IG.Sim.SimDomainDto:
+ Collaboration diagram for IG.Sim.SimDomainDto:

Public Member Functions

 SimDomainDto (string domainName, int domainIndex, int dimensionOfSpace)
 Constructs a new domain DTO (data transfer object) that holds all domain data after a specific time step. More...
 
 SimDomainDto (string domainName, int domainIndex, int dimensionOfSpace, int timeStep, double time)
 Constructs a new domain DTO (data transfer object) that holds all domain data after a specific time step. More...
 
void AddScalarField (SimScalarFieldDto field)
 Adds the specified field DTO to the array of scalar fields. More...
 
int GetScalarFieldIndex (string fieldName)
 Returns index of the scalar field with the specified name within the array of scalar fields, or -1 if the specified field has not been bound. More...
 
SimScalarFieldDto GetScalarField (string fieldName)
 Returns the scalar field DTO of the specified name that is installed on the current simulation domain DTO, or null if there is no such scalar field. More...
 
SimScalarFieldDto RemoveScalarfield (string fieldName)
 Removes the scalar field of hte specified name from the current domain DTO. Nothing happens if a field with the specified name does not exist on the current domain DTO. More...
 
void AddVectorField (SimVectorFieldDto field)
 Adds the specified field DTO to the array of vector fields. More...
 
int GetVectorFieldIndex (string fieldName)
 Returns index of the vector field with the specified name within the array of vector fields, or -1 if the specified field has not been bound. More...
 
SimVectorFieldDto GetVectorField (string fieldName)
 Returns the vector field DTO of the specified name that is installed on the current simulation domain DTO, or null if there is no such vector field. More...
 
SimVectorFieldDto RemoveVectorfield (string fieldName)
 Removes the vector field of hte specified name from the current domain DTO. Nothing happens if a field with the specified name does not exist on the current domain DTO. More...
 
void AddTensorField (SimTensorFieldDto field)
 Adds the specified field DTO to the array of tensor fields. More...
 
int GetTensorFieldIndex (string fieldName)
 Returns index of the tensor field with the specified name within the array of tensor fields, or -1 if the specified field has not been bound. More...
 
SimTensorFieldDto GetTensorField (string fieldName)
 Returns the tensor field DTO of the specified name that is installed on the current simulation domain DTO, or null if there is no such tensor field. More...
 
SimTensorFieldDto RemoveTensorfield (string fieldName)
 Removes the tensor field of hte specified name from the current domain DTO. Nothing happens if a field with the specified name does not exist on the current domain DTO. More...
 
override SimDomainDto 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...
 
- Public Member Functions inherited from IG.Sim.SimulationComponentDtoBase< Type, BaseType >
virtual string GetComponentType ()
 Returns type of the current component. More...
 
- Public Member Functions inherited from IG.Lib.SerializationDtoBase< Type, BaseType >
 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...
 
- Public Member Functions inherited from IG.Sim.ISimulationComponentDto
string GetComponentType ()
 Returns type of the current component. More...
 

Static Public Member Functions

static void SaveJson (SimDomainDto simDomain, string filePath)
 Saves (serializes) the specified simulation domain DTO to the specified JSON file. File is owerwritten if it exists. More...
 
static void SaveJson (SimDomainDto simDomain, string filePath, bool append)
 Saves (serializes) the specified simulation domain 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 SimDomainDto simDomain)
 Restores (deserializes) a simulation domain DTO from the specified file in JSON format. More...
 
- Static Public Member Functions inherited from IG.Lib.SerializationDto
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

int DimensionOfSpace
 Dimension of space in which the field represented by the current object is embedded. More...
 
int DomainTimeStep
 Time step number. More...
 
double DomainTime
 Time. More...
 
string DomainName
 Name of the simulation domain represented by the current DTO. More...
 
int DomainIndex
 Index of the simulation domain represented by the current DTO, as indexed in simulator. More...
 

Protected Member Functions

override void CopyFromPlain (SimDomainDto obj)
 
override void CopyToPlain (ref SimDomainDto obj)
 
- Protected Member Functions inherited from IG.Sim.SimulationComponentDtoBase< Type, BaseType >
 SimulationComponentDtoBase ()
 
- Protected Member Functions inherited from IG.Lib.SerializationDtoBase< Type, BaseType >
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...
 
- Protected Member Functions inherited from IG.Lib.SerializationDto
 SerializationDto ()
 

Private Attributes

SimScalarFieldDto[] ScalarFields
 Values of scalar fields that are defined on the current domain. More...
 
SimVectorFieldDto[] VectorFields
 Values of vector fields that are defined on the current domain. More...
 
SimTensorFieldDto[] TensorFields
 Values of tensor fields that are defined on the current domain. More...
 

Additional Inherited Members

- Protected Attributes inherited from IG.Lib.SerializationDtoBase< Type, BaseType >
bool _isNull = false
 
- Properties inherited from IG.Lib.SerializationDtoBase< Type, BaseType >
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...
 
- Properties inherited from IG.Lib.ILockable
object Lock [get]
 

Detailed Description

Base class for simulation domains.

$A Igor Nov11;

Constructor & Destructor Documentation

IG.Sim.SimDomainDto.SimDomainDto ( string  domainName,
int  domainIndex,
int  dimensionOfSpace 
)
inline

Constructs a new domain DTO (data transfer object) that holds all domain data after a specific time step.

Parameters
domainNameName of domain.
domainIndexIndex of domain.
dimensionOfSpaceSpace dimension.
IG.Sim.SimDomainDto.SimDomainDto ( string  domainName,
int  domainIndex,
int  dimensionOfSpace,
int  timeStep,
double  time 
)
inline

Constructs a new domain DTO (data transfer object) that holds all domain data after a specific time step.

Parameters
domainNameName of domain.
domainIndexIndex of domain.
dimensionOfSpaceSpace dimension.
timeStepTime step for which domain data is written.
timeTime or pseudo time for which domain data is contained in the current DTO.

Member Function Documentation

void IG.Sim.SimDomainDto.AddScalarField ( SimScalarFieldDto  field)
inline

Adds the specified field DTO to the array of scalar fields.

Exception is thrown if the field to be added is null.

Parameters
fieldField DTO to be added.

References IG.Sim.SimFieldBaseDto< FieldType >.Length.

int IG.Sim.SimDomainDto.GetScalarFieldIndex ( string  fieldName)
inline

Returns index of the scalar field with the specified name within the array of scalar fields, or -1 if the specified field has not been bound.

Exception is thrown if the specified field name is null or empty string.

Parameters
fieldNameName of the field whose index should be returned.

References IG.Sim.SimFieldBaseDto< FieldType >.FieldName, and IG.Sim.SimFieldBaseDto< FieldType >.Length.

SimScalarFieldDto IG.Sim.SimDomainDto.GetScalarField ( string  fieldName)
inline

Returns the scalar field DTO of the specified name that is installed on the current simulation domain DTO, or null if there is no such scalar field.

Exception is thrown if the specified field name is null or empty string.

Parameters
fieldNameName of the field that is returned.
SimScalarFieldDto IG.Sim.SimDomainDto.RemoveScalarfield ( string  fieldName)
inline

Removes the scalar field of hte specified name from the current domain DTO. Nothing happens if a field with the specified name does not exist on the current domain DTO.

Parameters
fieldNameName of the scalar field to be removed.
Returns
The removed scalar field, or null if there was no such field.

References IG.Sim.SimFieldBaseDto< FieldType >.Length.

void IG.Sim.SimDomainDto.AddVectorField ( SimVectorFieldDto  field)
inline

Adds the specified field DTO to the array of vector fields.

Exception is thrown if the field to be added is null.

Parameters
fieldField DTO to be added.

References IG.Sim.SimFieldBaseDto< FieldType >.Length.

int IG.Sim.SimDomainDto.GetVectorFieldIndex ( string  fieldName)
inline

Returns index of the vector field with the specified name within the array of vector fields, or -1 if the specified field has not been bound.

Exception is thrown if the specified field name is null or empty string.

Parameters
fieldNameName of the field whose index should be returned.

References IG.Sim.SimFieldBaseDto< FieldType >.FieldName, and IG.Sim.SimFieldBaseDto< FieldType >.Length.

SimVectorFieldDto IG.Sim.SimDomainDto.GetVectorField ( string  fieldName)
inline

Returns the vector field DTO of the specified name that is installed on the current simulation domain DTO, or null if there is no such vector field.

Exception is thrown if the specified field name is null or empty string.

Parameters
fieldNameName of the field that is returned.
SimVectorFieldDto IG.Sim.SimDomainDto.RemoveVectorfield ( string  fieldName)
inline

Removes the vector field of hte specified name from the current domain DTO. Nothing happens if a field with the specified name does not exist on the current domain DTO.

Parameters
fieldNameName of the vector field to be removed.
Returns
The removed vector field, or null if there was no such field.

References IG.Sim.SimFieldBaseDto< FieldType >.Length.

void IG.Sim.SimDomainDto.AddTensorField ( SimTensorFieldDto  field)
inline

Adds the specified field DTO to the array of tensor fields.

Exception is thrown if the field to be added is null.

Parameters
fieldField DTO to be added.

References IG.Sim.SimFieldBaseDto< FieldType >.Length.

int IG.Sim.SimDomainDto.GetTensorFieldIndex ( string  fieldName)
inline

Returns index of the tensor field with the specified name within the array of tensor fields, or -1 if the specified field has not been bound.

Exception is thrown if the specified field name is null or empty string.

Parameters
fieldNameName of the field whose index should be returned.

References IG.Sim.SimFieldBaseDto< FieldType >.FieldName, and IG.Sim.SimFieldBaseDto< FieldType >.Length.

SimTensorFieldDto IG.Sim.SimDomainDto.GetTensorField ( string  fieldName)
inline

Returns the tensor field DTO of the specified name that is installed on the current simulation domain DTO, or null if there is no such tensor field.

Exception is thrown if the specified field name is null or empty string.

Parameters
fieldNameName of the field that is returned.
SimTensorFieldDto IG.Sim.SimDomainDto.RemoveTensorfield ( string  fieldName)
inline

Removes the tensor field of hte specified name from the current domain DTO. Nothing happens if a field with the specified name does not exist on the current domain DTO.

Parameters
fieldNameName of the tensor field to be removed.
Returns
The removed tensor field, or null if there was no such field.

References IG.Sim.SimFieldBaseDto< FieldType >.Length.

static void IG.Sim.SimDomainDto.SaveJson ( SimDomainDto  simDomain,
string  filePath 
)
inlinestatic

Saves (serializes) the specified simulation domain DTO to the specified JSON file. File is owerwritten if it exists.

Parameters
simDomainObject that is saved to a file.
filePathPath to the file in which object is is saved.
static void IG.Sim.SimDomainDto.SaveJson ( SimDomainDto  simDomain,
string  filePath,
bool  append 
)
inlinestatic

Saves (serializes) the specified simulation domain 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.

Parameters
simDomainObject that is saved to a file.
filePathPath to the file in which object is is saved.
appendSpecifies whether serialized data is appended at the end of the file in the case that the file already exists.

References IG.Sim.SimDomainDto.NulllifyCrossLinks(), and IG.Sim.SimDomainDto.RestoreCrossLinks().

static void IG.Sim.SimDomainDto.LoadJson ( string  filePath,
ref SimDomainDto  simDomain 
)
inlinestatic

Restores (deserializes) a simulation domain DTO from the specified file in JSON format.

Parameters
filePathFile from which object is restored.
simDomainObject 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.SimDomainDto.RestoreCrossLinks().

override void IG.Sim.SimDomainDto.CopyFromPlain ( SimDomainDto  obj)
inlineprotected
override void IG.Sim.SimDomainDto.CopyToPlain ( ref SimDomainDto  obj)
inlineprotected
override SimDomainDto IG.Sim.SimDomainDto.CreateObject ( )
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 >.

override void IG.Sim.SimDomainDto.NulllifyCrossLinks ( )
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 >.

References IG.Sim.SimFieldBaseDto< FieldType >.Length, and IG.Sim.SimFieldBaseDto< FieldType >.NulllifyCrossLinks().

Referenced by IG.Sim.SimDomainDto.SaveJson().

override void IG.Sim.SimDomainDto.RestoreCrossLinks ( )
inlinevirtual

Member Data Documentation

int IG.Sim.SimDomainDto.DimensionOfSpace

Dimension of space in which the field represented by the current object is embedded.

int IG.Sim.SimDomainDto.DomainTimeStep

Time step number.

double IG.Sim.SimDomainDto.DomainTime

Time.

string IG.Sim.SimDomainDto.DomainName

Name of the simulation domain represented by the current DTO.

int IG.Sim.SimDomainDto.DomainIndex

Index of the simulation domain represented by the current DTO, as indexed in simulator.

SimScalarFieldDto [] IG.Sim.SimDomainDto.ScalarFields
private

Values of scalar fields that are defined on the current domain.

SimVectorFieldDto [] IG.Sim.SimDomainDto.VectorFields
private

Values of vector fields that are defined on the current domain.

SimTensorFieldDto [] IG.Sim.SimDomainDto.TensorFields
private

Values of tensor fields that are defined on the current domain.


The documentation for this class was generated from the following file: