OpenVSP API Documentation 3.52.0
Loading...
Searching...
No Matches
Design File Functions

This group of functions is available for managing Design Variables through the API. Click here to return to the main page. More...

Functions

void vsp::ReadApplyDESFile (const std::string &file_name)
void vsp::WriteDESFile (const std::string &file_name)
void vsp::ReadApplyXDDMFile (const std::string &file_name)
void vsp::WriteXDDMFile (const std::string &file_name)
int vsp::GetNumDesignVars ()
void vsp::AddDesignVar (const std::string &parm_id, int type)
void vsp::DeleteAllDesignVars ()
std::string vsp::GetDesignVar (int index)
int vsp::GetDesignVarType (int index)

Detailed Description

Function Documentation

◆ AddDesignVar()

void vsp::AddDesignVar ( const std::string & parm_id,
int type )
extern

Add a design variable

string pid = AddGeom( "POD" );
string len = GetParm( pid, "Length", "Design" );
if ( GetNumDesignVars() != 1 ) { Print( "ERROR: AddDesignVar" ); __failure++; }
void Print(const std::string &data, bool new_line=true)
int GetNumDesignVars()
void AddDesignVar(const std::string &parm_id, int type)
@ XDDM_VAR
std::string AddGeom(const std::string &type, const std::string &parent=std::string())
std::string GetParm(const std::string &geom_id, const std::string &name, const std::string &group)
void Update(bool update_managers=true)
See also
XDDM_QUANTITY_TYPE
Parameters
[in]parm_idstring Parm ID
[in]typeint XDDM type enum (XDDM_VAR or XDDM_CONST)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DeleteAllDesignVars()

void vsp::DeleteAllDesignVars ( )
extern

Delete all design variables

string pid = AddGeom( "POD" );
string len = GetParm( pid, "Length", "Design" );
if ( GetNumDesignVars() != 0 ) { Print( "ERROR: DeleteAllDesignVars" ); __failure++; }
void DeleteAllDesignVars()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetDesignVar()

std::string vsp::GetDesignVar ( int index)
extern

Get the Parm ID of the specified design variable

string pid = AddGeom( "POD" );
string len = GetParm( pid, "Length", "Design" );
if ( GetDesignVar( 0 ) != len ) { Print( "ERROR: GetDesignVar" ); __failure++; }
std::string GetDesignVar(int index)
Parameters
[in]indexint Index of design variable
Returns
string Parm ID
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetDesignVarType()

int vsp::GetDesignVarType ( int index)
extern

Get the XDDM type of the specified design variable

string pid = AddGeom( "POD" );
string len = GetParm( pid, "Length", "Design" );
if ( GetDesignVarType( 0 ) != XDDM_VAR ) { Print( "ERROR: GetDesignVarType" ); __failure++; }
int GetDesignVarType(int index)
See also
XDDM_QUANTITY_TYPE
Parameters
[in]indexint Index of design variable
Returns
int XDDM type enum (XDDM_VAR or XDDM_CONST)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetNumDesignVars()

int vsp::GetNumDesignVars ( )
extern

Get the number of design variables

string pid = AddGeom( "POD" );
string len = GetParm( pid, "Length", "Design" );
if ( GetNumDesignVars() != 1 ) { Print( "ERROR: GetNumDesignVars" ); __failure++; }
Returns
int Number of design variables
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadApplyDESFile()

void vsp::ReadApplyDESFile ( const std::string & file_name)
extern

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

string pid = AddGeom( "POD" );
string len = GetParm( pid, "Length", "Design" );
WriteDESFile( "TestDesignVars.des" );
ReadApplyDESFile( "TestDesignVars.des" );
void WriteDESFile(const std::string &file_name)
void ReadApplyDESFile(const std::string &file_name)
Parameters
[in]file_namestring \*.des input file
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadApplyXDDMFile()

void vsp::ReadApplyXDDMFile ( const std::string & file_name)
extern

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

string pid = AddGeom( "POD" );
string len = GetParm( pid, "Length", "Design" );
WriteXDDMFile( "TestDesignVars.xddm" );
ReadApplyXDDMFile( "TestDesignVars.xddm" );
void ReadApplyXDDMFile(const std::string &file_name)
void WriteXDDMFile(const std::string &file_name)
Parameters
[in]file_namestring \*.xddm input file
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteDESFile()

void vsp::WriteDESFile ( const std::string & file_name)
extern

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

string pid = AddGeom( "POD" );
string len = GetParm( pid, "Length", "Design" );
WriteDESFile( "TestDesignVars.des" );
Parameters
[in]file_namestring \*.des output file
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteXDDMFile()

void vsp::WriteXDDMFile ( const std::string & file_name)
extern

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

string pid = AddGeom( "POD" );
string len = GetParm( pid, "Length", "Design" );
WriteXDDMFile( "TestDesignVars.xddm" );
Parameters
[in]file_namestring \*.xddm output file
Here is the call graph for this function:
Here is the caller graph for this function: