IGLib  1.7.2
The IGLib base library for development of numerical, technical and business applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
IG.Num.SimKosecFileManagerConv2 Class Reference

Interface with simulator of G. Kosec for convection problems in a cave with 2 obstacles. More...

+ Inheritance diagram for IG.Num.SimKosecFileManagerConv2:
+ Collaboration diagram for IG.Num.SimKosecFileManagerConv2:

Public Member Functions

 SimKosecFileManagerConv2 (string dataDirectory)
 
 SimKosecFileManagerConv2 (string dataDirectory, double thickness, double obstacleLength)
 Constructor. More...
 
 SimKosecFileManagerConv2 (string dataDirectory, double thickness)
 Constructor. More...
 
override bool RepairInputParameters (IVector parameters)
 Repairs simulation parameters, if necessary, in such a way that values are consistent with simuation data (e.g. spacing of nodes). More...
 
- Public Member Functions inherited from IG.Num.SimKosecFileManagerConvBase
 SimKosecFileManagerConvBase (string dataDirectory)
 Constructor. More...
 
 SimKosecFileManagerConvBase (string dataDirectory, double thickness, double obstacleLength)
 Constructor. More...
 
 SimKosecFileManagerConvBase (string dataDirectory, double thickness)
 Constructor. More...
 
- Public Member Functions inherited from IG.Num.SimKosecFileManagerBase
string GetPath (string relativePath)
 Returns full path of the file or directory with the specified relative path within the data and messages exchange directory. More...
 
virtual void SaveInput ()
 Saves contents of the simulation input file. Usually the contents is generated by taking the contents of the template input file and making some modification in it in order to reflect the current values of optimization parameters. More...
 
void UpdateDefaultInputValues ()
 Updates the input field values for which default values are defined on the list DefaultInputValues. More...
 
string GetOptimizationParametersDefinedFromInput (int which)
 Returns value of the specified input (optimization) parameter obtained from the current contents of simulation input, according to the definition of direct mapping between this parameter and scalar input field value. If mapping is not defined for the component specified then null is returned. Returned value is obtained by GetInputFieldValue. More...
 
void GetOptimizationParametersDefinedFromInput (IVector param)
 Gets current values of input (optimization) parameters obtained from the current contents of simulation input, according to the definitions of direct mappings between input parameters and scalar input field values. Values are written to components of the provided vector. Vector is not resized, therefore it must be of correct dimension. Those components for which direct mapping between a specific input parameter and scalar input field in simulation input is not defined, are not obtained and stored in vector components (i.e., eventual previous values are preserved). Returned value is obtained by GetInputFieldValue. More...
 
virtual void UpdateOptimizationParametersDefined (IVector parameters)
 Updates simulation inputs according to the values of input (optimization) parameters for those parameters for which direct mapping to input fields are defined. More...
 
void UpdateInputDefined (IVector parameters)
 Updates simulation input with default values and with values of optimization parameters for which direct mappings to input fields are defined (the latter only when vector of parameters is specified, i.e. not null). More...
 
virtual InputFieldDefinition GetInputFieldDefinition (int fieldId)
 Returns an input field definition that corresponds to the specified field ID. Exception is thrown if the field with this ID is not yet contained in input field definitions. More...
 
virtual InputFieldDefinition GetInputFieldDefinition (string fieldName)
 Returns an input field definition that corresponds to the specified field name. Exception is thrown if definition with this name does not yet exist. More...
 
virtual InputFieldDefinition GetInputFieldDefinition (int fieldId, string fieldName)
 Returns an input field definition that corresponds to the specified field ID and field name. If a matching definition is already included then that definition is returned, if not then definition is created anew. Exception is thrown if neither of this can be done. More...
 
virtual InputFieldDefinition GetInputFieldDefinition (int fieldId, string fieldName, string fieldDescription)
 Returns an input field definition that corresponds to the specified field ID and field name. If a matching definition is already included then that definition is returned, if not then definition is created anew. Exception is thrown if neither of this can be done. More...
 
virtual void AddInputFieldDefinition (InputFieldDefinition def)
 Adds a new input field definition. Name of the definition must be unique (not already added). More...
 
virtual void AddInputFieldDefinitions (params InputFieldDefinition[] definitions)
 Adds a set of input field definitions by calling

See also
AddInputFieldDefinition

. More...

 
void ClearInputFieldDefinition (int fieldId)
 Removes the specified input field definition from the stored collection of definitions. More...
 
void ClearinputfieldDefinition (string fieldName)
 Removes the specified input field definition from the stored collection of definitions. More...
 
void ClearInputFieldDefinition (int fieldId, string fieldName)
 Removes the specified input field definition from the stored collection of definitions. More...
 
void ClearinputFieldDefinitions ()
 Clears all input fielddefinitions. More...
 
virtual void RemoveInputFieldDefinitions ()
 
void SetInputFieldValue (string fieldName, string fieldValue)
 Sets the sepcified input field to the specified value. This is done by appending a corresponding text to the contents of the input file (at this stage, the file is not modified yet). More...
 
void SetInputFieldValue (int fieldId, string fieldValue)
 Sets the sepcified input field to the specified value. This is done by appending a corresponding text to the contents of the input file (at this stage, the file is not modified yet). More...
 
void SetInputFieldValue (int fieldId, string fieldName, string fieldValue)
 Sets the sepcified input field to the specified value. This is done by appending a corresponding text to the contents of the input file (at this stage, the file is not modified yet). More...
 
void SetInputFieldValue (InputFieldDefinition def, string fieldValue)
 Sets the sepcified input field to the specified value. This is done by appending a corresponding text to the contents of the input file (at this stage, the file is not modified yet). More...
 
void AddInputComment (string commentString)
 Adds comment to the input file. More...
 
string GetInputFieldValue (string fieldName)
 Returns value of the sepcified input field. More...
 
string GetInputFieldValue (int fieldId)
 Returns value of the sepcified input field. More...
 
string GetInputFieldValue (int fieldId, string fieldName)
 Returns value of the sepcified input field. More...
 
string GetInputFieldValue (InputFieldDefinition def)
 Returns the value of the specified input field, which is obtained from the contents of teh input file. More...
 
virtual void ReadInputParameters (ref IVector inputParameters)
 Reads optimization input parameters form the file at a standard location. More...
 
virtual void WriteInputParameters (IVector inputParameters)
 Writes optimization input parameters to the standard location. More...
 
virtual void DeleteOutputFiles ()
 Deletes the output files. More...
 
virtual void ReadOutputValues (ref IVector outputValues)
 Reads optimization output values form the file at a standard location. More...
 
virtual void WriteOutputValues (IVector outputValues)
 Writes optimization ouptut values to the standard location. More...
 
void RunSimulator ()
 Runs the simulaor interfaced by the current object. This method only runs the simulator, it does not prepare any input. More...
 
void RunSimulator (string[] commandlineArguments)
 Runns the simulator with the specified command-line arguments. Warning: this method should be used for testing only because the command-line arguments that should be passed to the simulator are specified by the interrface rules and can not be specified arbitrarily. Otherwise, run the overloaded method with no arguments. This method only runs the simulator, it does not prepare any input. More...
 
void CalculateVectorResponse (IVector inputParameters, ref IVector outputValues)
 Calculates simulator's response for the specified input parameters. More...
 
void WriteToConsole ()
 Writes data about the current object to console. Normally, ToString() will be used for that, but sometimed this method is used because it is more suitable for debugging. More...
 
override string ToString ()
 Returns string representation of the current object. More...
 

Protected Member Functions

override void Init ()
 Initializes internal variables. Called at the beginning of all constructors. More...
 
override void GetInputParametersManual (ref IVector inputParameters)
 Gets the current values of input parameters form the input file. This method must be overridden in derived concrete classes. More...
 
override void UpdateInputParametersManual (IVector inputParameters)
 Prepares current values of input parameters in the simulation input thet will be written to the simulation input file. This method must be overridden in derived concrete classes. Only mappings form input parameters to simulation input that are manually defined must be performed by this function, since automatic mappings are already included in functions such as "WriteInputParameters". More...
 
- Protected Member Functions inherited from IG.Num.SimKosecFileManagerConvBase
override void InstallInputFields ()
 Installs data about input fields that can be queried and set in the input file. More...
 
override void InstallInputMappings ()
 Installs definitions of default values of input fields that are automatically set before running the simulation, and eventually definitios for mappings between (optimization) input parameters and input fields in input file. More...
 
- Protected Member Functions inherited from IG.Num.SimKosecFileManagerBase
 SimKosecFileManagerBase (string dataDirectory)
 Constructs a new file manager for interfacing simulator of Gregor Kosec. More...
 
virtual InputFieldDefinition GetDefinition (List< InputFieldDefinition > list, int id, string name)
 Finds and returns the specified input field definition on the specified list. More...
 
void AddDefaultInputValues (params InputFieldDefinition[] definitions)
 Adds a set of default input values to the list DefaultInputValues of default values. These values will be set when input file is prepared. More...
 
InputFieldDefinition GetDefaultInputValue (int id, string name)
 Finds and returns the specified deefault input value definition.

See also
GetDefinition
More...
 
void AddOptimizationParameterDefinitions (params InputFieldDefinition[] definitions)
 Adds a set of optimization parameter definitions to the list. Each definitios specifies which parameter in the simulation input file corresponds to a given optimization parameter. It is alloved that some definitions are null. The corresponding optimization parameters will not be mapped automatically to input fields by functions such as UpdateOptimizationParametersDefined, but tehir mapping must be provided specially in definitions of (usually overridden) functions such as UpdateInputParametersManual. More...
 
InputFieldDefinition GetOptimizationParameterDefinition (int id, string name)
 Finds and returns the specified optimization parameter definition.

See also
GetDefinition
More...
 

Additional Inherited Members

- Public Attributes inherited from IG.Num.SimKosecFileManagerConvBase
double ObstacleThickness = 0.1
 Thickness of obstacless. More...
 
double ObstacleLength = 0.4
 Length of obstacle. More...
 
double SimulationTime = 20.0
 Simulation time. More...
 
double MaxX = 1
 Domain upper bound in X direction. More...
 
double MaxY = 1
 Domain upper bound in X direction. More...
 
int NumX = 0
 Number of nodes in X direction. More...
 
int NumY = 0
 Number of nodes in Y direction. More...
 
double DX = 0
 Step in X direction. More...
 
double DY = 0
 Step in Y direction. More...
 
double MinX = 0
 Domain lower bound in X direction. More...
 
double MinY = 0
 Domain lower bound in Y direction. More...
 
- Protected Attributes inherited from IG.Num.SimKosecFileManagerConvBase
int _numParameters = 0
 
- Protected Attributes inherited from IG.Num.SimKosecFileManagerBase
bool _redirectOutput = false
 
string _redirectedOutputPath = null
 
string _directory = null
 
string _csvSeparator = SimKosecConst.CsvSeparatorDefault
 
IBoundingBox _inputParameterBounds
 
- Properties inherited from IG.Num.SimKosecFileManagerBase
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 InternalLock [get]
 Used internally for locking access to internal fields. More...
 
bool RedirectOutput [get, set]
 Gets or sets the plag indicating whether standard output will be redirected or not. More...
 
string RedirectedOutputPath [get, set]
 Gets or sets path to the file where standard output will be redirected. Setting to null causes that output will not be redirected. More...
 
string RedirectedOutputFileName [get, set]
 Gets or sets name of the file where output is redirected. More...
 
int OutputLevel [get, set]
 Level of information that is output to the console by some methods. More...
 
virtual int NumInputParameters [get, set]
 Number of input optimization parameters for the simulator. More...
 
virtual int NumOutputValues [get, set]
 Number of optimization output values produced by the simulator. More...
 
string DataDirectory [get, protected set]
 Directory for data and messages exchange through files. More...
 
string CsvSeparator [get, set]
 Separator used to separate values in CSV files. More...
 
virtual string TemplateInputPath [get, protected set]
 File path of the template analysis input file. This file is transcribed, with appropriate modification according to the optimization parameters, to the actual simulation input file. Setter takes only pure file name, without path information. If set to null then file path is set to null and will be recalculated when getter is called. More...
 
virtual string InputPath [get, protected set]
 File path of the analysis input file. This file contains all the input data for the direct analysis. If set to null then file path is set to null and will be recalculated when getter is called. More...
 
virtual string ExecutableFilename [get, set]
 File name of the executable that performs the direct analysis. More...
 
virtual string ExecutablePath [get, protected set]
 File path of the analysis exeutable. If set to null then file path is set to null and will be recalculated when getter is called. More...
 
virtual string OutputBaseDirpath [get, protected set]
 Path of the base directory where output files are located. Setter takes only pure directory name, without path information. If set to null then directory path is set to null and will be recalculated when getter is called. More...
 
virtual string OutputDirpath [get, protected set]
 Path of the directory where output files are located. Setter takes only pure directory name, without path information. If set to null then directory path is set to null and will be recalculated when getter is called. More...
 
string OptOutputCsvPath [get, protected set]
 File path of the analysis output file in CSV format. This file contains the pre-agreed set of output values obtained by post-processing of simulator results. If set to null then file path is set to null and will be recalculated when getter is called. More...
 
virtual string InputFileContents [get, protected set]
 The current input file contents. By default this is obtained form the template input file. If the property is set to null at some point then it will be set to contents of the template input file at the first get access. More...
 
virtual string[][] InputFileLines [get, set]
 The current input represented as an array of text lines. More...
 
List< InputFieldDefinitionDefaultInputValues [get]
 List containing default values for input parameters, which will be set before the simulation input file is prepared, which makes possible to play with the definition of the template direct problem. More...
 
List< InputFieldDefinitionOptimizationParameterDefinitions [get]
 List of definitions of direct mappings od input (optimization) parameters to input fields. Contains, for each input parameter, the definition of the input field that is represented by this parameter. This list can contain null references, which are usually for parameters that can not be directly mapped to scalar input fields defined in the simulation input file. More...
 
SortedDictionary< string,
InputFieldDefinition
InputFieldDefinitions [get]
 Gets the sorted dictionary that contains input field definitions. This should be used only exceptionally; use the higher level method for dealing with input field definitions. More...
 
virtual IBoundingBox InputParameterBounds [get, protected set]
 Bounds on input parameters. More...
 
string[] OneCommandArgument [get]
 Used to run the simulatior in the default case where there is only one command-line argument. More...
 
- Properties inherited from IG.Lib.ILockable
object Lock [get]
 

Detailed Description

Interface with simulator of G. Kosec for convection problems in a cave with 2 obstacles.

Constructor & Destructor Documentation

IG.Num.SimKosecFileManagerConv2.SimKosecFileManagerConv2 ( string  dataDirectory)
inline
IG.Num.SimKosecFileManagerConv2.SimKosecFileManagerConv2 ( string  dataDirectory,
double  thickness,
double  obstacleLength 
)
inline

Constructor.

Parameters
dataDirectoryBase directory for simulation.
thicknessObstacle thickness.
obstacleLengthObstacle length.
IG.Num.SimKosecFileManagerConv2.SimKosecFileManagerConv2 ( string  dataDirectory,
double  thickness 
)
inline

Constructor.

Parameters
dataDirectoryBase directory for simulation.
thicknessObstacle thickness.

Member Function Documentation

override void IG.Num.SimKosecFileManagerConv2.Init ( )
inlineprotectedvirtual

Initializes internal variables. Called at the beginning of all constructors.

To be overridden in derived classes!

Reimplemented from IG.Num.SimKosecFileManagerConvBase.

References IG.Num.IBoundingBox.SetBounds().

override bool IG.Num.SimKosecFileManagerConv2.RepairInputParameters ( IVector  parameters)
inlinevirtual

Repairs simulation parameters, if necessary, in such a way that values are consistent with simuation data (e.g. spacing of nodes).

Parameters
parametersVector of parameters to be repaired. Repaired values are stored in the same vector.
Returns
true if parameters were corrected, false otherwise.

Implements IG.Num.SimKosecFileManagerBase.

References IG.Num.SimKosecFileManagerConvBase.DX, IG.Num.SimKosecFileManagerConvBase.DY, IG.Num.SimKosecFileManagerConvBase.MinX, and IG.Num.SimKosecFileManagerConvBase.MinY.

override void IG.Num.SimKosecFileManagerConv2.GetInputParametersManual ( ref IVector  inputParameters)
inlineprotectedvirtual

Gets the current values of input parameters form the input file. This method must be overridden in derived concrete classes.

Parameters
inputParametersVector object where current values of input parameters are stored.

Implements IG.Num.SimKosecFileManagerBase.

override void IG.Num.SimKosecFileManagerConv2.UpdateInputParametersManual ( IVector  inputParameters)
inlineprotectedvirtual

Prepares current values of input parameters in the simulation input thet will be written to the simulation input file. This method must be overridden in derived concrete classes. Only mappings form input parameters to simulation input that are manually defined must be performed by this function, since automatic mappings are already included in functions such as "WriteInputParameters".

Parameters
inputParametersVector of input (optimization) parameter values to be set.

Implements IG.Num.SimKosecFileManagerBase.


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