Exemplo n.º 1
0
 def __init__(self, case_name, dir_name, field_name):
     self.case = case_name
     if os.path.isdir(os.path.join(case_name, 'domain', 'postProcessing')):
         self.dir_path = os.path.join(case_name, 'domain', 'postProcessing', dir_name)
     else:
         self.dir_path = os.path.join(case_name, 'domain', dir_name)
     self.time_dirs = time_dirs(self.dir_path)
     self.field_name = field_name
     self._times = None
     self._values = None
     self._probe_positions = None
     self.read()
Exemplo n.º 2
0
def createSwakFilePath(caseName, statName):
    swakPrefix = 'swakExpression_'
    swakFolder = os.path.join(caseName, 'postProcessing',
                              swakPrefix + statName)
    if not os.path.exists(swakFolder):
        swakFolder = os.path.join(caseName, swakPrefix + statName)
    timeDir = time_dirs(swakFolder)[-1]
    filePath = os.path.join(swakFolder, timeDir, statName)
    if os.path.exists(filePath):
        return filePath
    else:
        raise ValueError(
            'No swak file found for case {} and statistic {}'.format(
                caseName, statName))
Exemplo n.º 3
0
                        default = 2.0)
    parser.add_argument('--step', type=float, help='Time difference between plots that contains all lines', \
                        default = 0.1)
    figOptions = FigureOptions(parser)
    args = parser.parse_args()
    fieldNames = args.fields
    x = args.x
    all_times = args.alltimes
    min_time  = args.min_time
    max_time  = args.max_time
    step = args.step
    figOptions.parseOptions(args)

    createPlotDirectory()

    if all_times:
        times = time_dirs('domain')
        if '0' in times:
            times.remove('0')
    else:
        n = int(round((max_time-min_time)/step) + 1)
        times = np.linspace(min_time, max_time, n)
    for time in times:
        plotRadialProfile('domain', x, float(time), fieldNames)
        figOptions.adjustAxes()
        figOptions.setGrid()
        figOptions.saveFig(plotName('domain', float(time), x))
        plt.clf()


Exemplo n.º 4
0
 def fieldTimeDirs(self):
     """Return the list of time folders where fields have been written."""
     return time_dirs(os.path.join(self.case_path, 'domain'))
Exemplo n.º 5
0
    figOptions = FigureOptions(parser)

    args = parser.parse_args()

    radial_profile = not args.longitudinal
    fieldNames = args.fields
    x = args.x
    r = args.r
    plot_time = args.time
    all_times = args.alltimes
    figOptions.parseOptions(args)

    analyticalLineStyle = {'color': 'k', 'linestyle': '-', 'dashes': (6, 5)}

    if all_times:
        times = [float(t) for t in time_dirs('domain')]
        if 0 in times:
            times.remove(0)
    else:
        times = [plot_time]

    for time in times:
        if radial_profile:
            plotPO2YProfiles.createPlotDirectory()
            plotPO2SimulatedAndAnalyticalYProfile('.',
                                                  time,
                                                  x,
                                                  style=analyticalLineStyle,
                                                  fieldNames=fieldNames)
            plotName = plotPO2YProfiles.plotName('.', time, x)
        else: