Skip to content

Commit

Permalink
typos & rearranging
Browse files Browse the repository at this point in the history
  • Loading branch information
hajdik committed Sep 14, 2022
1 parent 08a7bd5 commit a1321d6
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions pygeo/mphys/mphys_dvgeo.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ def initialize(self):
self.options.declare("geo_options", default=None)

def setup(self):
self.geo_type = self.options["geo_type"]

# create the DVGeo object that does the computations
if self.options["geo_type"] == "ffd":
if self.geo_type == "ffd":
# we are doing an FFD-based DVGeo
self.DVGeo = DVGeometry(self.options["geo_file"])

elif self.options["geo_type"] == "vsp":
elif self.geo_type == "vsp":
# we are doing a VSP-based DVGeo
if self.options["geo_options"] is None:
vsp_options = {}
Expand All @@ -39,7 +41,7 @@ def setup(self):

self.DVGeo = DVGeometryVSP(self.options["geo_file"], comm=self.comm, **vsp_options)

elif self.options["geo_type"] == "esp":
elif self.geo_type == "esp":
# we are doing an ESP-based DVGeo
if self.options["geo_options"] is None:
esp_options = {}
Expand All @@ -48,7 +50,6 @@ def setup(self):

self.DVGeo = DVGeometryESP(self.options["geo_file"], comm=self.comm, **esp_options)

self.geo_type = self.options["geo_type"]
self.DVCon = DVConstraints()
self.DVCon.setDVGeo(self.DVGeo)
self.omPtSetList = []
Expand Down Expand Up @@ -164,7 +165,7 @@ def nom_addLocalDV(self, dvName, axis="y", pointSelect=None, childIdx=None):
def nom_addVSPVariable(self, component, group, parm, **kwargs):
# VSP DVs are only added to VSP-based DVGeo objects
if self.geo_type != "vsp":
raise RuntimeError(f"Only VSP-based DVGeo objects can use local DVs, not type:{self.geo_type}")
raise RuntimeError(f"Only VSP-based DVGeo objects can use VSP DVs, not type:{self.geo_type}")

# actually add the DV to VSP
self.DVGeo.addVariable(component, group, parm, **kwargs)
Expand All @@ -181,7 +182,7 @@ def nom_addVSPVariable(self, component, group, parm, **kwargs):
def nom_addESPVariable(self, desmptr_name, **kwargs):
# ESP DVs are only added to VSP-based DVGeo objects
if self.geo_type != "esp":
raise RuntimeError(f"Only ESP-based DVGeo objects can use local DVs, not type:{self.geo_type}")
raise RuntimeError(f"Only ESP-based DVGeo objects can use ESP DVs, not type:{self.geo_type}")

# actually add the DV to ESP
self.DVGeo.addVariable(desmptr_name, **kwargs)
Expand Down

0 comments on commit a1321d6

Please sign in to comment.