AnsysParser

class persalys.AnsysParser(*args)

Class used to read Ansys project files.

Methods

generateTemplate(*args)

Reads the project file and fills in variables information.

getAnsysVersion()

Returns formatted ansys version (vXXX) to help generate default ansys solver path.

getClassName()

Accessor to the object's name.

getExecutableFileName()

Returns ansys solver file name.

getFullAnsysVersion()

Returns ansys version as found in the project file

getInputVariables()

Returns input variables.

getModelFileName()

Returns the project file name.

getOutputFileName()

Returns the design point file name.

getOutputVariables()

Returns output variables.

getTemplateFileName()

Returns ansys journal template file name.

loadData(fileName)

Reads the project file and fills in variables information.

populateCouplingStep(*args)

Sets ansys solver file name.

setExecutableFileName(fileName)

Sets ansys solver file name.

setInputVariables(inputs)

Sets input variables.

setModelFileName(fileName)

Sets the project file name.

setOutputFileName(fileName)

Sets the design point file name.

setOutputVariables(outputs)

Sets output variables.

setTemplateFileName(fileName)

Sets ansys journal template file name.

__init__(*args)
generateTemplate(*args)

Reads the project file and fills in variables information.

Parameters
templateFileNamestr

Name of the template to generate. By default, a template file named input.txt.in is created next to the project (.wbpj) file

outputFileNamestr

Name of the Ansys design point output file. By default: output.csv

getAnsysVersion()

Returns formatted ansys version (vXXX) to help generate default ansys solver path.

Returns
ansysVersionstr

Formatted ansys version (ex: returns ‘v202’ for full version ‘2020 R2’).

getClassName()

Accessor to the object’s name.

Returns
class_namestr

The object class name (object.__class__.__name__).

getExecutableFileName()

Returns ansys solver file name.

Returns
executableFileNamestr

Ansys solver file name.

getFullAnsysVersion()

Returns ansys version as found in the project file

Returns
fullAnsysVersionstr

Full ansys version used to create the project (ex: ‘2020 R2’).

getInputVariables()

Returns input variables.

Returns
inputssequence of Input

Input variables

getModelFileName()

Returns the project file name.

Returns
modelFileNamestr

Project file name.

getOutputFileName()

Returns the design point file name.

Returns
outputFileNamestr

Ansys design point file name.

getOutputVariables()

Returns output variables.

Returns
outputssequence of Output

Output variables

getTemplateFileName()

Returns ansys journal template file name.

Returns
templateFileNamestr

Ansys template replay file name.

loadData(fileName)

Reads the project file and fills in variables information.

Parameters
fileNamestr

Name of the project file

populateCouplingStep(*args)

Sets ansys solver file name.

Parameters
modelCouplingPhysicalModel

Model that contains the step to be populated.

indStepint

Index of the step to be populated.

templateFileNamestr

Input template file path to be generated (Optional, defaults to input.txt.in in the directory containing the ansys project file).

setExecutableFileName(fileName)

Sets ansys solver file name.

Parameters
executableFileNamestr

Ansys solver file name.

setInputVariables(inputs)

Sets input variables.

Parameters
inputssequence of Input

Input variables

setModelFileName(fileName)

Sets the project file name.

Parameters
modelFileNamestr

Project file name.

setOutputFileName(fileName)

Sets the design point file name.

Parameters
outputFileNamestr

Ansys design point file name.

setOutputVariables(outputs)

Sets output variables.

Parameters
outputssequence of Output

Output variables

setTemplateFileName(fileName)

Sets ansys journal template file name.

Parameters
templateFileNamestr

Ansys template replay file name.