Skip to content

Commit

Permalink
renaming check_partials attribute in mphys components
Browse files Browse the repository at this point in the history
  • Loading branch information
timryanb committed Jan 16, 2025
1 parent a3ab45a commit ede1119
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions tacs/mphys/buckling.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ def initialize(self):

self.fea_assembler = None

self.check_partials = False
self.check_partials_mode = False

def setup(self):
self.fea_assembler = self.options["fea_assembler"]
self.check_partials = self.options["check_partials"]
self.check_partials_mode = self.options["check_partials"]
self.write_solution = self.options["write_solution"]
self.solution_counter = 0

Expand Down Expand Up @@ -91,7 +91,7 @@ def compute(self, inputs, outputs):

def compute_jacvec_product(self, inputs, d_inputs, d_outputs, mode):
if mode == "fwd":
if not self.check_partials:
if not self.check_partials_mode:
raise ValueError("TACS forward mode requested but not implemented")
if mode == "rev":
# always update internal because same tacs object could be used by multiple scenarios
Expand Down
8 changes: 4 additions & 4 deletions tacs/mphys/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ def initialize(self):
self.fea_assembler = None

self.transposed = False
self.check_partials = False
self.check_partials_mode = False

self.old_dvs = None
self.old_xs = None

def setup(self):
self.check_partials = self.options["check_partials"]
self.check_partials_mode = self.options["check_partials"]
self.fea_assembler = self.options["fea_assembler"]
self.discipline_vars = self.options["discipline_vars"]
self.coupling_loads = self.options["coupling_loads"]
Expand Down Expand Up @@ -150,7 +150,7 @@ def solve_nonlinear(self, inputs, outputs):

def solve_linear(self, d_outputs, d_residuals, mode):
if mode == "fwd":
if self.check_partials:
if self.check_partials_mode:
print("solver fwd")
else:
raise ValueError("forward mode requested but not implemented")
Expand All @@ -163,7 +163,7 @@ def solve_linear(self, d_outputs, d_residuals, mode):
def apply_linear(self, inputs, outputs, d_inputs, d_outputs, d_residuals, mode):
self._update_internal(inputs, outputs)
if mode == "fwd":
if not self.check_partials:
if not self.check_partials_mode:
raise ValueError("TACS forward mode requested but not implemented")

if mode == "rev":
Expand Down

0 comments on commit ede1119

Please sign in to comment.