From d4e62070e64356a9349ab7bb539d2ef0cbe11825 Mon Sep 17 00:00:00 2001 From: David Anderegg Date: Fri, 17 Sep 2021 08:19:11 +0200 Subject: [PATCH] fix writing summary file --- adflow_util/__init__.py | 2 +- adflow_util/adflow_util.py | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/adflow_util/__init__.py b/adflow_util/__init__.py index 56266ee..62fb375 100644 --- a/adflow_util/__init__.py +++ b/adflow_util/__init__.py @@ -1,4 +1,4 @@ -__version__ = '1.3.0' +__version__ = '1.3.1' from .adflow_util import ADFLOW_UTIL from .adflow_plot import ADflowData diff --git a/adflow_util/adflow_util.py b/adflow_util/adflow_util.py index f6c373c..295f88c 100644 --- a/adflow_util/adflow_util.py +++ b/adflow_util/adflow_util.py @@ -52,8 +52,6 @@ class ADFLOW_UTIL: def __init__(self, aeroOptions, solverOptions, options=None): self.aeroOptions = aeroOptions self.solverOptions = solverOptions - # self.name = name - # self.reset_ap = reset_ap defaultOptions = { # The name that is beeing used for the '.out' file and AP @@ -94,6 +92,8 @@ def __init__(self, aeroOptions, solverOptions, options=None): self.CFDSolver = None + self.funcs_data = [] + def run(self): # init stuff self.check_ap_input() @@ -198,8 +198,12 @@ def create_funcs_table(self, funcs, n=0): header.append('iterTot') data.append(int(self.CFDSolver.adflow.iteration.itertot)) + # add it to the global data array + self.funcs_data.append(data) + # only write header if it is the first line - data_string = tabulate([data], headers=header, floatfmt=".8f") + "\n" + data_string = tabulate( + self.funcs_data, headers=header, floatfmt=".8f") + "\n" # strip off header if it is not the first run (this is done for # alignment purposes) if n > 0: