MPhys DVGeo Component
- class pygeo.mphys.mphys_dvgeo.OM_DVGEOCOMP(*args, **kwargs)[source]
- initialize()[source]
Set up a geometry component with either 1 DVGeo or multiple DVGeos.
A single DVGeo are initialized by specifying its file and type and, optionally, additional options. Available options can be found in the specific DVGeometry class.
Multiple DVGeos are initialized in a dictionary of these values and must have a unique name. The format is:
>>> DVGeoInfo = { >>> "name1": {"file": file1, "type": type1, "options": options1} >>> "name2": {"file": file2, "type": type2, "options": options2} >>> }
The two setup methods cannot currently be used together.
- nom_addComponent(comp, ffd_file, triMesh, DVGeoName=None)[source]
Add a component a DVGeometryMulti object. This is a wrapper for the DVGeoMulti.addComponent method.
- Parameters:
- compstr
The name of the component.
- ffd_filestr
Path to the FFD file for the new DVGeo object for this component.
- triMeshstr, optional
Path to the triangulated mesh file for this component.
- DVGeoNamestr, optional
The name of the DVGeo object to add this component to.
- nom_addESPVariable(desmptr_name, rows=None, cols=None, dh=0.001, isComposite=False, DVGeoName=None)[source]
Add an ESP design variables to the DVGeometryESP object Wrapper for
addVariable
Input parameters are identical to those in wrapped function unless otherwise specified- Parameters:
- desmptr_namestr
See
addVariable
- rowslist or None, optional
See
addVariable
- colslist or None, optional
See
addVariable
- dhfloat, optional
See
addVariable
- isCompositebool, optional
Whether this DV is to be included in the composite DVs, by default False
- DVGeoNamestring, optional
The name of the DVGeo to add DVs to, necessary if there are multiple DVGeo objects
- Raises:
- RuntimeError
Raised if the underlying DVGeo parameterization is not ESP-based
- nom_addGlobalDV(dvName, value, func, childName=None, comp=None, isComposite=False, DVGeoName=None, prependName=False, config=None)[source]
Add a global design variable to the DVGeo object. This is a wrapper for the DVGeo.addGlobalDV method.
- Parameters:
- dvNamestr
See
addGlobalDV
- valuefloat, or iterable list of floats
See
addGlobalDV
- funcpython function
See
addGlobalDV
- childNamestr, optional
Name of the child FFD, if this DV is for a child FFD.
- compstr, optional
Name of the DVGeoMulti component, if this DV is for a multi component
- isCompositebool, optional
Whether this DV is to be included in the composite DVs, by default False
- DVGeoNamestring, optional
The name of the DVGeo to return, necessary if there are multiple DVGeo objects
- Raises:
- RuntimeError
Raised if the underlying DVGeo object is not an FFD
- nom_addLocalSectionDV(dvName, secIndex, childName=None, comp=None, axis=1, pointSelect=None, volList=None, orient0=None, orient2='svd', config=None, DVGeoName=None, prependName=False)[source]
Add one or more section local design variables to the DVGeometry object Wrapper for
addLocalSectionDV
Input parameters are identical to those in wrapped function unless otherwise specified- Parameters:
- dvNamestr
Name to give this design variable
- secIndexchar or list of chars
See wrapped
- childNamestr, optional
Name of the child FFD, if this DV is for a child FFD.
- compstr, optional
Name of the DVGeoMulti component, if this DV is for a multi component
- axisint, optional
See wrapped
- pointSelectpointSelect object, optional
See wrapped
- volListlist, optional
See wrapped
- orient0orientation, optional
See wrapped
- orient2str, optional
See wrapped
- configstr or list, optional
See wrapped
- DVGeoNamestring, optional
The name of the DVGeo to return, necessary if there are multiple DVGeo objects
- Returns:
- nVal, int
number of local section DVs
- Raises:
- RuntimeError
Raised if the underlying DVGeo parameterization is not FFD-based
- nom_addProjectedAreaConstraint(name, axis, scaled=True, addToPyOpt=True, surface_name='default', DVGeoName='default', compNames=None)[source]
Add a DVCon projected area constraint to the problem Wrapper for
addProjectedAreaConstraint
Input parameters are identical to those in wrapped function unless otherwise specified- Parameters:
- name
See wrapped
- axis
See wrapped
- scaledbool, optional
See wrapped
- surface_namestr, optional
See wrapped
- DVGeoNamestr, optional
See wrapped
- compNameslist, optional
See wrapped
- nom_addShapeFunctionDV(dvName, shapes, childName=None, comp=None, config=None, DVGeoName=None, prependName=False)[source]
Add one or more local shape function design variables to the DVGeometry object Wrapper for
addShapeFunctionDV
Input parameters are identical to those in wrapped function unless otherwise specified- Parameters:
- dvNamestr
Name to give this design variable
- shapeslist of dictionaries, or a single dictionary
See wrapped
- childNamestr, optional
Name of the child FFD, if this DV is for a child FFD.
- compstr, optional
Name of the DVGeoMulti component, if this DV is for a multi component
- configstr or list, optional
See wrapped
- DVGeoNamestring, optional
The name of the DVGeo to return, necessary if there are multiple DVGeo objects
- Returns:
- Nint
The number of design variables added.
- Raises:
- RuntimeError
Raised if the underlying DVGeo parameterization is not FFD-based
- nom_addSurfaceAreaConstraint(name, scaled=True, addToPyOpt=True, surfaceName='default', DVGeoName='default', compNames=None)[source]
Add a DVCon surface area constraint to the problem Wrapper for
addSurfaceAreaConstraint
Input parameters are identical to those in wrapped function unless otherwise specified- Parameters:
- name
See wrapped
- scaledbool, optional
See wrapped
- surfaceNamestr, optional
See wrapped
- DVGeoNamestr, optional
See wrapped
- compNameslist, optional
See wrapped
- nom_addVolumeConstraint(name, leList, teList, nSpan=10, nChord=10, scaled=True, addToPyOpt=True, surfaceName='default', DVGeoName='default', compNames=None)[source]
Add a DVCon volume constraint to the problem Wrapper for
addVolumeConstraint
Input parameters are identical to those in wrapped function unless otherwise specified- Parameters:
- name
See wrapped
- leList
See wrapped
- teList
See wrapped
- nSpanint, optional
See wrapped
- nChordint, optional
See wrapped
- scaledbool, optional
See wrapped
- surfaceNamestr, optional
See wrapped
- DVGeoNamestr, optional
See wrapped
- compNameslist, optional
See wrapped
- nom_add_discipline_coords(discipline, points=None, DVGeoName=None, **kwargs)[source]
Add the coordinates for an MPhys discipline to the DVGeo object.
Calling this method will add both and input and an output to the DVGeo’s OpenMDAO component. The input should be connected to a component that provides the coordinates of the “baseline” geometry (e.g a mesh coordinate subsystem), and the output will be the coordinates of the parameterized geometry after the design variables have been applied.
- Parameters:
- disciplineMPhysGeometry class
MPhysGeometry class for the relevant discipline, e.g MPhysVariables.Aerodynamics.Surface.Geometry or MPhysVariables.Structure.Geometry
- pointsarray, size (N,3), optional
The coordinates to embed. By default None, in which case the points will be added automatically during the first call to the compute method.
- DVGeoNamestr, optional
The name of the DVGeo to add the points to, necessary if there are multiple DVGeo objects. By default None.
- **kwargs
Any additional keyword arguments to pass to the addPointSet method of the DVGeo object.
- nom_getDVCon()[source]
Gets the DVConstraints object held in the geometry component so DVCon methods can be called directly on it
- Returns:
- self.DVCon, DVConstraints object
DVConstraints object held by this geometry component
- nom_getDVGeo(childName=None, comp=None, DVGeoName=None)[source]
Gets the DVGeometry object held in the geometry component so DVGeo methods can be called directly on it
- Parameters:
- childNamestr, optional
Name of the child FFD, if you want a child DVGeo returned
- compstr, optional
Name of the DVGeoMulti component, if this DV is for a multi component
- DVGeoNamestr, optional
The name of the DVGeo to return, necessary if there are multiple DVGeo objects
- Returns:
- DVGeometry object
DVGeometry object held by this geometry component