Design File Functions

This group of functions is available for managing Design Variables through the API.

ReadApplyDESFile(file_name)

Read in and apply a design file (*.des) to the current OpenVSP project

WriteDESFile(file_name)

Write all design variables to a design file (*.des)

ReadApplyXDDMFile(file_name)

Read in and apply a Cart3D XDDM file (*.xddm) to the current OpenVSP project

WriteXDDMFile(file_name)

Write all design variables to a Cart3D XDDM file (*.xddm)

GetNumDesignVars()

Get the number of design variables

AddDesignVar(parm_id, type)

Add a design variable

AddDesignVarLimits(parm_id, type, ...)

Add a design variable See also: XDDM_QUANTITY_TYPE :param [in]: parm_id string Parm ID :param [in]: type int XDDM type enum (XDDM_VAR or XDDM_CONST) :param [in]: lowerlimit double Variable lower limit :param [in]: upperlimit double Variable upper limit

DeleteAllDesignVars()

Delete all design variables

GetDesignVar(index)

Get the Parm ID of the specified design variable

GetDesignVarType(index)

Get the XDDM type of the specified design variable

GetDesignVarTypeByID(parm_id)

Get the XDDM type of a design variable, by its Parm ID.

DeleteDesignVar(parm_id)

Delete a design variable, by its Parm ID.

GetDesignVarVec()

Get the Parm IDs of the design variables, in the order of their indexes.

Details

openvsp.ReadApplyDESFile(file_name)[source]

Read in and apply a design file (*.des) to the current OpenVSP project

pid = AddGeom( "POD" )

Update()

length = GetParm( pid, "Length", "Design" )

AddDesignVar( length, XDDM_VAR )

WriteDESFile( "TestDesignVars.des" )

ReadApplyDESFile( "TestDesignVars.des" )
Parameters:

[in] – file_name string *.des input file

openvsp.WriteDESFile(file_name)[source]

Write all design variables to a design file (*.des)

pid = AddGeom( "POD" )

Update()

length = GetParm( pid, "Length", "Design" )

AddDesignVar( length, XDDM_VAR )

WriteDESFile( "TestDesignVars.des" )
Parameters:

[in] – file_name string *.des output file

openvsp.ReadApplyXDDMFile(file_name)[source]

Read in and apply a Cart3D XDDM file (*.xddm) to the current OpenVSP project

pid = AddGeom( "POD" )

Update()

length = GetParm( pid, "Length", "Design" )

AddDesignVar( length, XDDM_VAR )

WriteXDDMFile( "TestDesignVars.xddm" )

ReadApplyXDDMFile( "TestDesignVars.xddm" )
Parameters:

[in] – file_name string *.xddm input file

openvsp.WriteXDDMFile(file_name)[source]

Write all design variables to a Cart3D XDDM file (*.xddm)

pid = AddGeom( "POD" )

Update()

length = GetParm( pid, "Length", "Design" )

AddDesignVar( length, XDDM_VAR )

WriteXDDMFile( "TestDesignVars.xddm" )
Parameters:

[in] – file_name string *.xddm output file

openvsp.GetNumDesignVars()[source]

Get the number of design variables

pid = AddGeom( "POD" )

Update()

length = GetParm( pid, "Length", "Design" )

AddDesignVar( length, XDDM_VAR )

assert GetNumDesignVars() == 1, "GetNumDesignVars did not count the variable"
Return type:

int

Returns:

int Number of design variables

openvsp.AddDesignVar(parm_id, type)[source]

Add a design variable

pid = AddGeom( "POD" )

Update()

length = GetParm( pid, "Length", "Design" )

AddDesignVar( length, XDDM_VAR )

assert GetNumDesignVars() == 1, "AddDesignVar did not add the variable"

See also: XDDM_QUANTITY_TYPE :param [in]: parm_id string Parm ID :param [in]: type int XDDM type enum (XDDM_VAR or XDDM_CONST)

openvsp.AddDesignVarLimits(parm_id, type, lowerlimit, upperlimit)[source]

Add a design variable See also: XDDM_QUANTITY_TYPE :param [in]: parm_id string Parm ID :param [in]: type int XDDM type enum (XDDM_VAR or XDDM_CONST) :param [in]: lowerlimit double Variable lower limit :param [in]: upperlimit double Variable upper limit

openvsp.DeleteAllDesignVars()[source]

Delete all design variables

pid = AddGeom( "POD" )

Update()

length = GetParm( pid, "Length", "Design" )

AddDesignVar( length, XDDM_VAR )

DeleteAllDesignVars()

assert GetNumDesignVars() == 0, "DeleteAllDesignVars left variables behind"
openvsp.GetDesignVar(index)[source]

Get the Parm ID of the specified design variable

pid = AddGeom( "POD" )

Update()

length = GetParm( pid, "Length", "Design" )

AddDesignVar( length, XDDM_VAR )

assert GetDesignVar( 0 ) == length, "GetDesignVar did not report the variable"
Parameters:

[in] – index int Index of design variable

Return type:

string

Returns:

string Parm ID

openvsp.GetDesignVarType(index)[source]

Get the XDDM type of the specified design variable

pid = AddGeom( "POD" )

Update()

length = GetParm( pid, "Length", "Design" )

AddDesignVar( length, XDDM_VAR )

assert GetDesignVarType( 0 ) == XDDM_VAR, "GetDesignVarType did not report the type"

See also: XDDM_QUANTITY_TYPE, GetDesignVarTypeByID :param [in]: index int Index of design variable :rtype: int :return: int XDDM type enum (XDDM_VAR or XDDM_CONST)

openvsp.GetDesignVarTypeByID(parm_id)[source]

Get the XDDM type of a design variable, by its Parm ID.

pod_id = AddGeom( "POD" )

length_id = FindParm( pod_id, "Length", "Design" )

AddDesignVar( length_id, XDDM_CONST )

assert GetDesignVarTypeByID( length_id ) == XDDM_CONST, "GetDesignVarTypeByID did not return the type"

See also: XDDM_QUANTITY_TYPE, GetDesignVarType :param [in]: parm_id string Parm ID of the design variable :rtype: int :return: int XDDM type enum (i.e. XDDM_VAR)

openvsp.DeleteDesignVar(parm_id)[source]

Delete a design variable, by its Parm ID.

pod_id = AddGeom( "POD" )

length_id = FindParm( pod_id, "Length", "Design" )

AddDesignVar( length_id, XDDM_CONST )

DeleteDesignVar( length_id )

assert GetNumDesignVars() == 0, "DeleteDesignVar did not delete the variable"

See also: AddDesignVar, DeleteAllDesignVars :param [in]: parm_id string Parm ID of the design variable

openvsp.GetDesignVarVec()[source]

Get the Parm IDs of the design variables, in the order of their indexes.

pod_id = AddGeom( "POD" )

length_id = FindParm( pod_id, "Length", "Design" )

AddDesignVar( length_id, XDDM_CONST )

assert list( GetDesignVarVec() ) == [ length_id ], "GetDesignVarVec did not return the variable"

See also: GetDesignVar, GetNumDesignVars :rtype: std::vector< std::string,std::allocator< std::string > > :return: array<string> Array of Parm IDs