This group of functions is provided for general API utilities, such as printing to stdout, performing basic math functions, and identifying basic OpenVSP information.
Click here to return to the main page.
More...
◆ CheckForVSPAERO()
bool CheckForVSPAERO |
( |
const string &in |
path | ) |
|
Check if all VSPAERO executables (Solver, Viewer, and Slicer) are in a given directory. Note that this function will return false if only one or two VSPAERO executables are found. An error message will indicate the executables that are missing. This may be acceptable, as only the Solver is needed in all cases. The Viewer and Slicer may not be needed.
string vspaero_path = "C:\Users\example_user\Documents\OpenVSP_3.4.5";
{
}
- See also
- GetVSPExePath, GetVSPAEROPath, SetVSPAEROPath
- Parameters
-
[in] | path | Absolute path to check for VSPAERO executables |
- Returns
- Flag that indicates if all VSPAERO executables are found or not
◆ Deg2Rad()
double Deg2Rad |
( |
double |
d | ) |
|
Convert degrees to radians
- Parameters
-
- Returns
- Value in radians
◆ GetVSPAEROPath()
Get the path that OpenVSP will use to look for all VSPAERO executables (Solver, Slicer, and Viewer) when attempting to execute VSPAERO. If the VSPAERO executables are not in this location, they must either be copied there or the VSPAERO path must be set using SetVSPAEROPath.
{
Print(
"VSPAERO is not where OpenVSP thinks it is. I should move the VSPAERO executable or call SetVSPAEROPath." );
}
- See also
- GetVSPExePath, CheckForVSPAERO, SetVSPAEROPath
- Returns
- Path OpenVSP will look for VSPAERO
◆ GetVSPExePath()
Get the path to the OpenVSP executable. OpenVSP will assume that the VSPAERO, VSPSLICER, and VSPVIEWER are in the same directory unless instructed otherwise.
Print(
"The current VSP executable path is: ",
false );
- See also
- SetVSPAEROPath, CheckForVSPAERO, GetVSPAEROPath
- Returns
- Path to the OpenVSP executable
◆ GetVSPVersion()
Get the version of the OpenVSP instance currently running
Print(
"The current OpenVSP version is: ",
false );
- Returns
- OpenVSP version string (i.e. "OpenVSP 3.17.1")
◆ Max()
double Max |
( |
double |
x, |
|
|
double |
y |
|
) |
| |
Get the maximum of two values -> (x > y ) ? x : y
double max_val =
Min( 1.0, 2.0 );
if ( abs( 2.0 - max_val ) > 1e-6 ) {
Print(
"Error: Max" ); }
- Parameters
-
[in] | x | First value |
[in] | y | Second value |
- Returns
- Largest of x and y
◆ Min()
double Min |
( |
double |
x, |
|
|
double |
y |
|
) |
| |
Get the minimum of two values -> (x < y ) ? x : y
double min_val =
Min( 1.0, 2.0 );
if ( abs( 1.0 - min_val ) > 1e-6 ) {
Print(
"Error: Min" ); }
- Parameters
-
[in] | x | First value |
[in] | y | Second value |
- Returns
- Smallest of x and y
◆ Print() [1/4]
void Print |
( |
const string &in |
data, |
|
|
bool |
new_line = true |
|
) |
| |
Print a string to stdout
Print(
string(
"This is an example of printing a string to stdout." ) );
- Parameters
-
[in] | data | Value of string type |
[in] | new_line | Flag to append a new line escape sequence to data |
◆ Print() [2/4]
void Print |
( |
const vec3d &in |
data, |
|
|
bool |
new_line = true |
|
) |
| |
Print a vec3d to stdout
- Parameters
-
[in] | data | Value of vec3d type |
[in] | new_line | Flag to append a new line escape sequence to data |
◆ Print() [3/4]
void Print |
( |
double |
data, |
|
|
bool |
new_line = true |
|
) |
| |
Print a double to stdout
- Parameters
-
[in] | data | Value of double type |
[in] | new_line | Flag to append a new line escape sequence to data |
◆ Print() [4/4]
void Print |
( |
int |
data, |
|
|
bool |
new_line = true |
|
) |
| |
Print an integer to stdout
- Parameters
-
[in] | data | integer value |
[in] | new_line | flag to append a new line escape sequence to data |
◆ Rad2Deg()
double Rad2Deg |
( |
double |
r | ) |
|
Convert radians to degrees
- Parameters
-
- Returns
- Value in degrees
◆ SetVSPAEROPath()
bool SetVSPAEROPath |
( |
const string &in |
path | ) |
|
Set the path to the VSPAERO executables (Solver, Viewer, and Slicer). By default, OpenVSP will assume that the VSPAERO executables are in the same directory as the VSP executable. However, this may need to be changed when using certain API languages like MATLAB and Python. For example, Python may treat the location of the Python executable as the VSP executable path, so either the VSPAERO executable needs to be moved to the same directory or this function can be called to tell Python where to look for VSPAERO.
{
string vspaero_path = "C:\Users\example_user\Documents\OpenVSP_3.4.5";
}
- See also
- GetVSPExePath, CheckForVSPAERO, GetVSPAEROPath
- Parameters
-
[in] | path | Absolute path to directory containing VSPAERO executable |
- Returns
- Flag that indicates whether or not the path was set correctly
◆ VSPCheckSetup()
Check if OpenVSP has been initialized successfully. If not, the OpenVSP instance will be exited. This call should be placed at the begining of all API scripts.
◆ VSPRenew()
Clear and reinitialize OpenVSP to all default settings
SetParmVal( pod_id,
"Y_Rel_Location",
"XForm", 2.0 );