示例#1
0
    def __init__(self):
        self.tfAdvect = TfAdvect()
        self.copyCases()
        self.heatmaps()

        self.btfTimestep = siunitx.Timestep(
                'schaerAdvect-btf-1000-dt', '$atmostests_builddir/schaerAdvect-btf-1000-linearUpwind')

        self.cutCellTimestep = siunitx.Timestep(
                'schaerAdvect-cutCell-1000-dt', '$atmostests_builddir/schaerAdvect-cutCell-1000-linearUpwind')

        self.convergence = Gnuplot(
                'cubicFit-schaerAdvect-convergence',
                output=os.path.join('thesis/cubicFit/schaerAdvect/convergence'),
                plot=os.path.join('src/thesis/cubicFit/schaerAdvect/convergence.plt'),
                data=[
                    '$atmostests_builddir/schaerAdvect-btf-linearUpwind-collated/10000/l2errorT.txt',
                    '$atmostests_builddir/schaerAdvect-btf-cubicFit-collated/10000/l2errorT.txt',
                    '$atmostests_builddir/schaerAdvect-btf-linearUpwind-collated/10000/linferrorT.txt',
                    '$atmostests_builddir/schaerAdvect-btf-cubicFit-collated/10000/linferrorT.txt',
                    '$atmostests_builddir/schaerAdvect-cutCell-linearUpwind-collated/10000/l2errorT.txt',
                    '$atmostests_builddir/schaerAdvect-cutCell-cubicFit-collated/10000/l2errorT.txt',
                    '$atmostests_builddir/schaerAdvect-cutCell-linearUpwind-collated/10000/linferrorT.txt',
                    '$atmostests_builddir/schaerAdvect-cutCell-cubicFit-collated/10000/linferrorT.txt',
                    '$atmostests_builddir/tfAdvect-btf-linearUpwind-collated/10000/l2errorT.txt',
                    '$atmostests_builddir/tfAdvect-btf-cubicFit-collated/10000/l2errorT.txt',
                    '$atmostests_builddir/tfAdvect-btf-linearUpwind-collated/10000/linferrorT.txt',
                    '$atmostests_builddir/tfAdvect-btf-cubicFit-collated/10000/linferrorT.txt',
                    '$atmostests_builddir/tfAdvect-cutCell-linearUpwind-collated/10000/l2errorT.txt',
                    '$atmostests_builddir/tfAdvect-cutCell-cubicFit-collated/10000/l2errorT.txt',
                    '$atmostests_builddir/tfAdvect-cutCell-linearUpwind-collated/10000/linferrorT.txt',
                    '$atmostests_builddir/tfAdvect-cutCell-cubicFit-collated/10000/linferrorT.txt'
        ])
示例#2
0
    def __init__(self):
        self.copyCases()
        self.meshes()
        self.meshesFigure = PDFLaTeXFigure(
                'resting-fig-meshes',
                output=os.path.join('thesis/slanted/resting/fig-meshes'),
                figure=os.path.join('src/thesis/slanted/resting/fig-meshes'),
                components=self.btfMesh.outputs() + \
                           self.sleveMesh.outputs() + \
                           self.cutCellMesh.outputs() + \
                           self.slantedCellMesh.outputs()
        )

        self.w = Gnuplot(
            'resting-w',
            output=os.path.join('thesis/slanted/resting/w'),
            plot=os.path.join('src/thesis/slanted/resting/w.plt'),
            data=[
                '$atmostests_builddir/resting-btf-1000m-cubicFit/energy.dat',
                '$atmostests_builddir/resting-sleve-1000m-cubicFit/energy.dat',
                '$atmostests_builddir/resting-cutCell-1000m-cubicFit/energy.dat',
                '$atmostests_builddir/resting-slantedCell-1000m-cubicFit/energy.dat',
                '$atmostests_builddir/resting-btf-cubicFit-collated/maxw.txt',
                '$atmostests_builddir/resting-sleve-cubicFit-collated/maxw.txt',
                '$atmostests_builddir/resting-cutCell-cubicFit-collated/maxw.txt',
                '$atmostests_builddir/resting-slantedCell-cubicFit-collated/maxw.txt'
            ])

        self.btf1000mMaxW = siunitx.Velocity(
            'resting-btf-1000m-cubicFit-maxw',
            '$atmostests_builddir/resting-btf-1000m-cubicFit', 'maxw.txt')
示例#3
0
    def __init__(self, degree=3, elements=100, endTime=100.0, dt=0.15):
        self.centredDifferenceH = SWEPC(
            'lakeAtRest-centredDifferenceH',
            output='uq/lakeAtRest-centredDifferenceH',
            testCase='lakeAtRest',
            solver='centredDifferenceH',
            degree=degree,
            elements=elements,
            endTime=endTime,
            dt=dt)

        self.wellBalancedH = SWEPC('lakeAtRest-wellBalancedH',
                                   output='uq/lakeAtRest-wellBalancedH',
                                   testCase='lakeAtRest',
                                   solver='wellBalancedH',
                                   degree=degree,
                                   elements=elements,
                                   endTime=endTime,
                                   dt=dt)

        self.plot = Gnuplot('lakeAtRest',
                            output=os.path.join('uq/lakeatrest'),
                            plot=os.path.join('src/uq/lakeatrest.plt'),
                            data=self.wellBalancedH.outputs() +
                            self.centredDifferenceH.outputs())

        self.figure = PDFLaTeXFigure(
            'fig-lakeAtRest',
            output=os.path.join('uq/fig-lakeatrest'),
            figure=os.path.join('src/uq/fig-lakeatrest'),
            components=self.plot.outputs())
class TsengSteadyState:
    def __init__(self):
        self.sg3 = SWEPC('tsengSteadyState-wellBalancedH-3',
                         output='uq/tsengSteadyState-wellBalancedH-3',
                         testCase='tsengSteadyState',
                         solver='wellBalancedH',
                         degree=3,
                         elements=200,
                         endTime=100000.0,
                         dt=0.5)

        self.flowPlot = Gnuplot(
            'tsengSteadyState-flow',
            output=os.path.join('uq/tsengSteadyState-flow'),
            plot=os.path.join('src/uq/tsengSteadyState-flow.plt'),
            data=self.sg3.outputs())

        self.flowFigure = PDFLaTeXFigure(
            'fig-tsengSteadyState-flow',
            output=os.path.join('uq/fig-tsengSteadyState-flow'),
            figure=os.path.join('src/uq/fig-tsengSteadyState-flow'),
            components=self.flowPlot.outputs())

    def outputs(self):
        return self.flowFigure.outputs()

    def addTo(self, build):
        build.add(self.sg3)
        build.add(self.flowPlot)
        build.add(self.flowFigure)
示例#5
0
 def __init__(self):
     self.convergence = Gnuplot(
         'highOrderFit-schaerAdvectSmooth-convergence',
         output=os.path.join(
             'thesis/highOrderFit/schaerAdvectSmooth/convergence'),
         plot=os.path.join(
             'src/thesis/highOrderFit/schaerAdvectSmooth/convergence.plt'),
         data=[
             '$atmostests_builddir/schaerAdvectSmooth-cos4-btf-cubicFit-collated/10000/l2errorT.txt',
             '$atmostests_builddir/schaerAdvectSmooth-cos4-btf-cubicFit-collated/10000/linferrorT.txt',
             '$atmostests_builddir/schaerAdvectSmooth-cos4-btf-highOrderFit-collated/10000/l2errorT.txt',
             '$atmostests_builddir/schaerAdvectSmooth-cos4-btf-highOrderFit-collated/10000/linferrorT.txt',
             '$atmostests_builddir/schaerAdvectSmooth-cos4-cutCell-cubicFit-collated/10000/l2errorT.txt',
             '$atmostests_builddir/schaerAdvectSmooth-cos4-cutCell-cubicFit-collated/10000/linferrorT.txt',
             '$atmostests_builddir/schaerAdvectSmooth-cos4-cutCell-highOrderFit-collated/10000/l2errorT.txt',
             '$atmostests_builddir/schaerAdvectSmooth-cos4-cutCell-highOrderFit-collated/10000/linferrorT.txt'
         ])
示例#6
0
    def __init__(self):
        self.distortedMeshCase = GmtPlotCopyCase(
            'deformationPlane-mesh-distorted-6',
            source='$atmostests_builddir',
            target='$builddir',
            plots=['src/thesis/highOrderFit/deformationPlane/mesh.gmtdict'])

        self.distortedMesh = GmtPlot(
            'deformationPlane-distortedMesh',
            plot='mesh',
            case=Case('deformationPlane-mesh-distorted-6'),
            time='constant')

        self.meshesFigure = PDFLaTeXFigure(
            'deformationPlane-fig-meshes',
            output=os.path.join(
                'thesis/highOrderFit/deformationPlane/fig-meshes'),
            figure=os.path.join(
                'src/thesis/highOrderFit/deformationPlane/fig-meshes'),
            components=self.distortedMesh.outputs())

        self.convergence = Gnuplot(
            'highOrderFit-deformationPlane-convergence',
            output=os.path.join(
                'thesis/highOrderFit/deformationPlane/convergence'),
            plot=os.path.join(
                'src/thesis/highOrderFit/deformationPlane/convergence.plt'),
            data=[
                '$atmostests_builddir/deformationPlane-uniform-cubicFit-collated/5/l2errorT.txt',
                '$atmostests_builddir/deformationPlane-uniform-cubicFit-collated/5/linferrorT.txt',
                '$atmostests_builddir/deformationPlane-uniform-highOrderFit-collated/5/l2errorT.txt',
                '$atmostests_builddir/deformationPlane-uniform-highOrderFit-collated/5/linferrorT.txt',
                '$atmostests_builddir/deformationPlane-distorted-cubicFit-collated/5/l2errorT.txt',
                '$atmostests_builddir/deformationPlane-distorted-cubicFit-collated/5/linferrorT.txt',
                '$atmostests_builddir/deformationPlane-distorted-highOrderFit-collated/5/l2errorT.txt',
                '$atmostests_builddir/deformationPlane-distorted-highOrderFit-collated/5/linferrorT.txt'
            ])
示例#7
0
    def write(self):
        build = self.build

        schaerAdvect = generators.SchaerAdvect()
        deformationSphere = generators.DeformationSphere()
        deformationPlane = generators.DeformationPlane()
        schaerAdvectSmooth = generators.SchaerAdvectSmooth()
        mountainAdvect = generators.MountainAdvect()
        resting = generators.Resting()
        schaerWaves = generators.SchaerWaves()
        arakawaKonor = generators.ArakawaKonor()

        stabilisation = Gnuplot(
            'cubicFit-stabilisation',
            output=os.path.join('thesis/cubicFit/stabilisation'),
            plot=os.path.join('src/thesis/cubicFit/stabilisation.plt'),
            data=[
                os.path.join('src/thesis/cubicFit/centralQuad.dat'),
                os.path.join('src/thesis/cubicFit/cubic.dat')
            ])

        thesis = PDFLaTeX(
            'thesis',
            output=os.path.join('thesis/thesis'),
            document=os.path.join('src/thesis/thesis'),
            components=[
                'src/thesis/title.tex', 'src/thesis/acknowledgements.tex',
                'src/thesis/abstract.tex', 'src/thesis/mysouthall.tex',
                'src/thesis/math.tex', 'src/thesis/thesis.bib',
                'src/thesis/intro.tex', 'src/thesis/cubicFit.tex',
                'src/thesis/cubicFit/transport.tex',
                'src/thesis/cubicFit/scheme.tex',
                'src/thesis/cubicFit/linearUpwind.tex',
                'src/thesis/cubicFit/schaerAdvect.tex',
                'src/thesis/cubicFit/tfAdvect.tex',
                'src/thesis/cubicFit/deformationSphere.tex',
                'src/thesis/cubicFit/interior-stencils.tex',
                'src/thesis/cubicFit/double-upwind-stencil.tex',
                'src/thesis/cubicFit/boundary-stencils.tex',
                'src/thesis/cubicFit/spherical.tex',
                'src/thesis/highOrderFit.tex',
                'src/thesis/highOrderFit/scheme.tex',
                'src/thesis/highOrderFit/deformationPlane.tex',
                'src/thesis/highOrderFit/schaerAdvectSmooth.tex',
                'src/thesis/slanted.tex', 'src/thesis/slanted/method.tex',
                'src/thesis/slanted/construct-mesh.tex',
                'src/thesis/slanted/mountainAdvect.tex',
                'src/thesis/slanted/exnerFoamH.tex',
                'src/thesis/slanted/resting.tex', 'src/thesis/cp.tex',
                'src/thesis/cp/vertical-staggering.tex',
                'src/thesis/cp/method.tex', 'src/thesis/cp/variables.tex',
                'src/thesis/cp/schaerWaves.tex',
                'src/thesis/cp/arakawaKonor.tex', 'src/thesis/discussion.tex'
            ] + stabilisation.outputs() + schaerAdvect.outputs() +
            deformationSphere.outputs() + deformationPlane.outputs() +
            schaerAdvectSmooth.outputs() + mountainAdvect.outputs() +
            resting.outputs() + schaerWaves.outputs() + arakawaKonor.outputs())

        shortcuts = Shortcuts([thesis.output])

        build.add(stabilisation)
        schaerAdvect.addTo(build)
        deformationSphere.addTo(build)
        deformationPlane.addTo(build)
        schaerAdvectSmooth.addTo(build)
        mountainAdvect.addTo(build)
        resting.addTo(build)
        schaerWaves.addTo(build)
        arakawaKonor.addTo(build)
        build.add(thesis)
        build.add(shortcuts)

        build.write()
示例#8
0
class SchaerAdvect:
    def __init__(self):
        self.tfAdvect = TfAdvect()
        self.copyCases()
        self.heatmaps()

        self.btfTimestep = siunitx.Timestep(
                'schaerAdvect-btf-1000-dt', '$atmostests_builddir/schaerAdvect-btf-1000-linearUpwind')

        self.cutCellTimestep = siunitx.Timestep(
                'schaerAdvect-cutCell-1000-dt', '$atmostests_builddir/schaerAdvect-cutCell-1000-linearUpwind')

        self.convergence = Gnuplot(
                'cubicFit-schaerAdvect-convergence',
                output=os.path.join('thesis/cubicFit/schaerAdvect/convergence'),
                plot=os.path.join('src/thesis/cubicFit/schaerAdvect/convergence.plt'),
                data=[
                    '$atmostests_builddir/schaerAdvect-btf-linearUpwind-collated/10000/l2errorT.txt',
                    '$atmostests_builddir/schaerAdvect-btf-cubicFit-collated/10000/l2errorT.txt',
                    '$atmostests_builddir/schaerAdvect-btf-linearUpwind-collated/10000/linferrorT.txt',
                    '$atmostests_builddir/schaerAdvect-btf-cubicFit-collated/10000/linferrorT.txt',
                    '$atmostests_builddir/schaerAdvect-cutCell-linearUpwind-collated/10000/l2errorT.txt',
                    '$atmostests_builddir/schaerAdvect-cutCell-cubicFit-collated/10000/l2errorT.txt',
                    '$atmostests_builddir/schaerAdvect-cutCell-linearUpwind-collated/10000/linferrorT.txt',
                    '$atmostests_builddir/schaerAdvect-cutCell-cubicFit-collated/10000/linferrorT.txt',
                    '$atmostests_builddir/tfAdvect-btf-linearUpwind-collated/10000/l2errorT.txt',
                    '$atmostests_builddir/tfAdvect-btf-cubicFit-collated/10000/l2errorT.txt',
                    '$atmostests_builddir/tfAdvect-btf-linearUpwind-collated/10000/linferrorT.txt',
                    '$atmostests_builddir/tfAdvect-btf-cubicFit-collated/10000/linferrorT.txt',
                    '$atmostests_builddir/tfAdvect-cutCell-linearUpwind-collated/10000/l2errorT.txt',
                    '$atmostests_builddir/tfAdvect-cutCell-cubicFit-collated/10000/l2errorT.txt',
                    '$atmostests_builddir/tfAdvect-cutCell-linearUpwind-collated/10000/linferrorT.txt',
                    '$atmostests_builddir/tfAdvect-cutCell-cubicFit-collated/10000/linferrorT.txt'
        ])

    def copyCases(self):
        self.btfLinearUpwind = GmtPlotCopyCase(
                'schaerAdvect-btf-1000-linearUpwind',
                source='$atmostests_builddir',
                target='$builddir',
                plots=['src/thesis/cubicFit/schaerAdvect/errorW.gmtdict'],
                files=['10000/T', '10000/T_analytic', '10000/T_diff']
        )

        self.cutCellLinearUpwind = GmtPlotCopyCase(
                'schaerAdvect-cutCell-1000-linearUpwind',
                source='$atmostests_builddir',
                target='$builddir',
                plots=['src/thesis/cubicFit/schaerAdvect/error.gmtdict'],
                files=['10000/T', '10000/T_analytic', '10000/T_diff']
        )

        self.btfCubicFit = GmtPlotCopyCase(
                'schaerAdvect-btf-1000-cubicFit',
                source='$atmostests_builddir',
                target='$builddir',
                plots=['src/thesis/cubicFit/schaerAdvect/errorSW.gmtdict'],
                files=['10000/T', '10000/T_analytic', '10000/T_diff']
        )

        self.cutCellCubicFit = GmtPlotCopyCase(
                'schaerAdvect-cutCell-1000-cubicFit',
                source='$atmostests_builddir',
                target='$builddir',
                plots=['src/thesis/cubicFit/schaerAdvect/errorS.gmtdict'],
                files=['10000/T', '10000/T_analytic', '10000/T_diff']
        )

    def heatmaps(self):
        self.btfLinearUpwindError = GmtPlot(
            'schaerAdvect-btfLinearUpwindError',
            plot='errorW',
            case=Case('schaerAdvect-btf-1000-linearUpwind'),
            time=10000,
            data=['10000/T', '10000/T_analytic', '10000/T_diff']
        )

        self.cutCellLinearUpwindError = GmtPlot(
            'schaerAdvect-cutCellLinearUpwindError',
            plot='error',
            case=Case('schaerAdvect-cutCell-1000-linearUpwind'),
            time=10000,
            data=['10000/T', '10000/T_analytic', '10000/T_diff'],
            colorBar='legends/error_T_diff.eps'
        )

        self.btfCubicFitError = GmtPlot(
            'schaerAdvect-btfCubicFitError',
            plot='errorSW',
            case=Case('schaerAdvect-btf-1000-cubicFit'),
            time=10000,
            data=['10000/T', '10000/T_analytic', '10000/T_diff']
        )

        self.cutCellCubicFitError = GmtPlot(
            'schaerAdvect-cutCellCubicFitError',
            plot='errorS',
            case=Case('schaerAdvect-cutCell-1000-cubicFit'),
            time=10000,
            data=['10000/T', '10000/T_analytic', '10000/T_diff']
        )

        self.heatmapL2Errors = [
            siunitx.Num('schaerAdvect-btf-1000-linearUpwind-l2error', '$atmostests_builddir/schaerAdvect-btf-1000-linearUpwind', '10000/l2errorT.txt'),
            siunitx.Num('schaerAdvect-cutCell-1000-linearUpwind-l2error', '$atmostests_builddir/schaerAdvect-cutCell-1000-linearUpwind', '10000/l2errorT.txt'),
            siunitx.Num('schaerAdvect-btf-1000-cubicFit-l2error', '$atmostests_builddir/schaerAdvect-btf-1000-cubicFit', '10000/l2errorT.txt'),
            siunitx.Num('schaerAdvect-cutCell-1000-cubicFit-l2error', '$atmostests_builddir/schaerAdvect-cutCell-1000-cubicFit', '10000/l2errorT.txt')
        ]

        self.heatmapLinfErrors = [
            siunitx.Num('schaerAdvect-btf-1000-linearUpwind-linferror', '$atmostests_builddir/schaerAdvect-btf-1000-linearUpwind', '10000/linferrorT.txt'),
            siunitx.Num('schaerAdvect-cutCell-1000-linearUpwind-linferror', '$atmostests_builddir/schaerAdvect-cutCell-1000-linearUpwind', '10000/linferrorT.txt'),
            siunitx.Num('schaerAdvect-btf-1000-cubicFit-linferror', '$atmostests_builddir/schaerAdvect-btf-1000-cubicFit', '10000/linferrorT.txt'),
            siunitx.Num('schaerAdvect-cutCell-1000-cubicFit-linferror', '$atmostests_builddir/schaerAdvect-cutCell-1000-cubicFit', '10000/linferrorT.txt')
        ]

        self.heatmap = PDFLaTeXFigure(
                'schaerAdvect-fig-error',
                output=os.path.join('thesis/cubicFit/schaerAdvect/fig-error'),
                figure=os.path.join('src/thesis/cubicFit/schaerAdvect/fig-error'),
                components= \
                       self.btfLinearUpwindError.outputs() \
                     + self.cutCellLinearUpwindError.outputs() \
                     + self.btfCubicFitError.outputs() \
                     + self.cutCellCubicFitError.outputs() \
                     + self.tfAdvect.btfLinearUpwindError.outputs() \
                     + self.tfAdvect.cutCellLinearUpwindError.outputs() \
                     + self.tfAdvect.btfCubicFitError.outputs() \
                     + self.tfAdvect.cutCellCubicFitError.outputs() \
                     + list(itertools.chain.from_iterable([e.outputs() for e in self.heatmapL2Errors])) \
                     + list(itertools.chain.from_iterable([e.outputs() for e in self.heatmapLinfErrors])) \
                     + list(itertools.chain.from_iterable([e.outputs() for e in self.tfAdvect.heatmapL2Errors])) \
                     + list(itertools.chain.from_iterable([e.outputs() for e in self.tfAdvect.heatmapLinfErrors]))
        )

    def outputs(self):
        return self.heatmap.outputs() \
             + self.btfTimestep.outputs() \
             + self.cutCellTimestep.outputs() \
             + self.convergence.outputs() \
             + self.tfAdvect.outputs()

    def addTo(self, build):
        self.tfAdvect.addTo(build)

        build.add(self.btfLinearUpwind)
        build.add(self.cutCellLinearUpwind)
        build.add(self.btfCubicFit)
        build.add(self.cutCellCubicFit)

        build.add(self.heatmap)
        build.add(self.btfLinearUpwindError)
        build.add(self.cutCellLinearUpwindError)
        build.add(self.btfCubicFitError)
        build.add(self.cutCellCubicFitError)
        build.addAll(self.heatmapL2Errors)
        build.addAll(self.heatmapLinfErrors)

        build.add(self.btfTimestep)
        build.add(self.cutCellTimestep)

        build.add(self.convergence)
示例#9
0
    def __init__(self):
        self.copyCases()
        self.meshes()
        self.meshesFigure = PDFLaTeXFigure(
                'mountainAdvect-fig-meshes',
                output=os.path.join('thesis/slanted/mountainAdvect/fig-meshes'),
                figure=os.path.join('src/thesis/slanted/mountainAdvect/fig-meshes'),
                components=self.btfMesh.outputs() \
                    + self.cutCellMesh.outputs() \
                    + self.slantedCellMesh.outputs()
        )

        self.heatmaps()
        self.errorFigure = PDFLaTeXFigure(
                'mountainAdvect-fig-error',
                output=os.path.join('thesis/slanted/mountainAdvect/fig-error'),
                figure=os.path.join('src/thesis/slanted/mountainAdvect/fig-error'),
                components=self.btfLinearUpwindError.outputs() \
                    + self.cutCellLinearUpwindError.outputs() \
                    + self.slantedCellLinearUpwindError.outputs() \
                    + self.btfCubicFitError.outputs() \
                    + self.cutCellCubicFitError.outputs() \
                    + self.slantedCellCubicFitError.outputs() \
                    + list(itertools.chain.from_iterable([e.outputs() for e in self.heatmapL2Errors])) \
                    + list(itertools.chain.from_iterable([e.outputs() for e in self.heatmapLinfErrors]))
        )

        self.tracerPlot = GmtPlot(
            'mountainAdvect-btfCubicFitTracer',
            plot='tracer',
            case=Case('mountainAdvect-h0-btf-1000-5000m-cubicFit'),
            time=10000,
            data=['10000/T_0', '10000/T_5000', '10000/T', '10000/T_analytic'])

        self.tracerFigure = PDFLaTeXFigure(
            'mountainAdvect-fig-tracer',
            output=os.path.join('thesis/slanted/mountainAdvect/fig-tracer'),
            figure=os.path.join(
                'src/thesis/slanted/mountainAdvect/fig-tracer'),
            components=self.tracerPlot.outputs())

        self.l2ByMountainHeight = Gnuplot(
            'mountainAdvect-l2ByMountainHeight',
            output=os.path.join(
                'thesis/slanted/mountainAdvect/l2ByMountainHeight'),
            plot=os.path.join(
                'src/thesis/slanted/mountainAdvect/l2ByMountainHeight.plt'),
            data=[
                '$atmostests_builddir/mountainAdvect-h0-btf-1000-linearUpwind-collated/10000/l2errorT.txt',
                '$atmostests_builddir/mountainAdvect-h0-btf-1000-cubicFit-collated/10000/l2errorT.txt',
                '$atmostests_builddir/mountainAdvect-h0-cutCell-1000-linearUpwind-collated/10000/l2errorT.txt',
                '$atmostests_builddir/mountainAdvect-h0-cutCell-1000-cubicFit-collated/10000/l2errorT.txt',
                '$atmostests_builddir/mountainAdvect-h0-slantedCell-1000-linearUpwind-collated/10000/l2errorT.txt',
                '$atmostests_builddir/mountainAdvect-h0-slantedCell-1000-cubicFit-collated/10000/l2errorT.txt'
            ])

        self.maxdt = Gnuplot(
            'mountainAdvect-maxdt',
            output=os.path.join('thesis/slanted/mountainAdvect/maxdt'),
            plot=os.path.join('src/thesis/slanted/mountainAdvect/maxdt.plt'),
            data=[
                '$atmostests_builddir/mountainAdvect-maxdt-btf-6000m-cubicFit-collated/dt.txt',
                '$atmostests_builddir/mountainAdvect-maxdt-btf-6000m-cubicFit-collated/co.txt',
                '$atmostests_builddir/mountainAdvect-maxdt-cutCell-6000m-cubicFit-collated/dt.txt',
                '$atmostests_builddir/mountainAdvect-maxdt-cutCell-6000m-cubicFit-collated/co.txt',
                '$atmostests_builddir/mountainAdvect-maxdt-slantedCell-6000m-cubicFit-collated/dt.txt',
                '$atmostests_builddir/mountainAdvect-maxdt-slantedCell-6000m-cubicFit-collated/co.txt'
            ])

        self.timesteps = LaTeXSubstitution(
            'mountainAdvect-timesteps',
            output=os.path.join('thesis/slanted/mountainAdvect/timesteps'),
            input=os.path.join(
                'src/thesis/slanted/mountainAdvect/timesteps.template'),
            data=[
                '$atmostests_builddir/mountainAdvect-h0-btf-1000-0m-linearUpwind/dt.txt',
                '$atmostests_builddir/mountainAdvect-h0-btf-1000-3000m-linearUpwind/dt.txt',
                '$atmostests_builddir/mountainAdvect-h0-btf-1000-4000m-linearUpwind/dt.txt',
                '$atmostests_builddir/mountainAdvect-h0-btf-1000-5000m-linearUpwind/dt.txt',
                '$atmostests_builddir/mountainAdvect-h0-btf-1000-6000m-linearUpwind/dt.txt',
                '$atmostests_builddir/mountainAdvect-h0-cutCell-1000-0m-linearUpwind/dt.txt',
                '$atmostests_builddir/mountainAdvect-h0-cutCell-1000-3000m-linearUpwind/dt.txt',
                '$atmostests_builddir/mountainAdvect-h0-cutCell-1000-4000m-linearUpwind/dt.txt',
                '$atmostests_builddir/mountainAdvect-h0-cutCell-1000-5000m-linearUpwind/dt.txt',
                '$atmostests_builddir/mountainAdvect-h0-cutCell-1000-6000m-linearUpwind/dt.txt',
                '$atmostests_builddir/mountainAdvect-h0-slantedCell-1000-0m-linearUpwind/dt.txt',
                '$atmostests_builddir/mountainAdvect-h0-slantedCell-1000-3000m-linearUpwind/dt.txt',
                '$atmostests_builddir/mountainAdvect-h0-slantedCell-1000-4000m-linearUpwind/dt.txt',
                '$atmostests_builddir/mountainAdvect-h0-slantedCell-1000-5000m-linearUpwind/dt.txt',
                '$atmostests_builddir/mountainAdvect-h0-slantedCell-1000-6000m-linearUpwind/dt.txt'
            ])

        self.unstableCourantNumber = siunitx.Num(
            'mountainAdvect-h0-slantedCell-1000-6000m-linearUpwind-co',
            '$atmostests_builddir/mountainAdvect-h0-slantedCell-1000-6000m-linearUpwind',
            Paths.courantNumber)
示例#10
0
class MountainAdvect:
    def __init__(self):
        self.copyCases()
        self.meshes()
        self.meshesFigure = PDFLaTeXFigure(
                'mountainAdvect-fig-meshes',
                output=os.path.join('thesis/slanted/mountainAdvect/fig-meshes'),
                figure=os.path.join('src/thesis/slanted/mountainAdvect/fig-meshes'),
                components=self.btfMesh.outputs() \
                    + self.cutCellMesh.outputs() \
                    + self.slantedCellMesh.outputs()
        )

        self.heatmaps()
        self.errorFigure = PDFLaTeXFigure(
                'mountainAdvect-fig-error',
                output=os.path.join('thesis/slanted/mountainAdvect/fig-error'),
                figure=os.path.join('src/thesis/slanted/mountainAdvect/fig-error'),
                components=self.btfLinearUpwindError.outputs() \
                    + self.cutCellLinearUpwindError.outputs() \
                    + self.slantedCellLinearUpwindError.outputs() \
                    + self.btfCubicFitError.outputs() \
                    + self.cutCellCubicFitError.outputs() \
                    + self.slantedCellCubicFitError.outputs() \
                    + list(itertools.chain.from_iterable([e.outputs() for e in self.heatmapL2Errors])) \
                    + list(itertools.chain.from_iterable([e.outputs() for e in self.heatmapLinfErrors]))
        )

        self.tracerPlot = GmtPlot(
            'mountainAdvect-btfCubicFitTracer',
            plot='tracer',
            case=Case('mountainAdvect-h0-btf-1000-5000m-cubicFit'),
            time=10000,
            data=['10000/T_0', '10000/T_5000', '10000/T', '10000/T_analytic'])

        self.tracerFigure = PDFLaTeXFigure(
            'mountainAdvect-fig-tracer',
            output=os.path.join('thesis/slanted/mountainAdvect/fig-tracer'),
            figure=os.path.join(
                'src/thesis/slanted/mountainAdvect/fig-tracer'),
            components=self.tracerPlot.outputs())

        self.l2ByMountainHeight = Gnuplot(
            'mountainAdvect-l2ByMountainHeight',
            output=os.path.join(
                'thesis/slanted/mountainAdvect/l2ByMountainHeight'),
            plot=os.path.join(
                'src/thesis/slanted/mountainAdvect/l2ByMountainHeight.plt'),
            data=[
                '$atmostests_builddir/mountainAdvect-h0-btf-1000-linearUpwind-collated/10000/l2errorT.txt',
                '$atmostests_builddir/mountainAdvect-h0-btf-1000-cubicFit-collated/10000/l2errorT.txt',
                '$atmostests_builddir/mountainAdvect-h0-cutCell-1000-linearUpwind-collated/10000/l2errorT.txt',
                '$atmostests_builddir/mountainAdvect-h0-cutCell-1000-cubicFit-collated/10000/l2errorT.txt',
                '$atmostests_builddir/mountainAdvect-h0-slantedCell-1000-linearUpwind-collated/10000/l2errorT.txt',
                '$atmostests_builddir/mountainAdvect-h0-slantedCell-1000-cubicFit-collated/10000/l2errorT.txt'
            ])

        self.maxdt = Gnuplot(
            'mountainAdvect-maxdt',
            output=os.path.join('thesis/slanted/mountainAdvect/maxdt'),
            plot=os.path.join('src/thesis/slanted/mountainAdvect/maxdt.plt'),
            data=[
                '$atmostests_builddir/mountainAdvect-maxdt-btf-6000m-cubicFit-collated/dt.txt',
                '$atmostests_builddir/mountainAdvect-maxdt-btf-6000m-cubicFit-collated/co.txt',
                '$atmostests_builddir/mountainAdvect-maxdt-cutCell-6000m-cubicFit-collated/dt.txt',
                '$atmostests_builddir/mountainAdvect-maxdt-cutCell-6000m-cubicFit-collated/co.txt',
                '$atmostests_builddir/mountainAdvect-maxdt-slantedCell-6000m-cubicFit-collated/dt.txt',
                '$atmostests_builddir/mountainAdvect-maxdt-slantedCell-6000m-cubicFit-collated/co.txt'
            ])

        self.timesteps = LaTeXSubstitution(
            'mountainAdvect-timesteps',
            output=os.path.join('thesis/slanted/mountainAdvect/timesteps'),
            input=os.path.join(
                'src/thesis/slanted/mountainAdvect/timesteps.template'),
            data=[
                '$atmostests_builddir/mountainAdvect-h0-btf-1000-0m-linearUpwind/dt.txt',
                '$atmostests_builddir/mountainAdvect-h0-btf-1000-3000m-linearUpwind/dt.txt',
                '$atmostests_builddir/mountainAdvect-h0-btf-1000-4000m-linearUpwind/dt.txt',
                '$atmostests_builddir/mountainAdvect-h0-btf-1000-5000m-linearUpwind/dt.txt',
                '$atmostests_builddir/mountainAdvect-h0-btf-1000-6000m-linearUpwind/dt.txt',
                '$atmostests_builddir/mountainAdvect-h0-cutCell-1000-0m-linearUpwind/dt.txt',
                '$atmostests_builddir/mountainAdvect-h0-cutCell-1000-3000m-linearUpwind/dt.txt',
                '$atmostests_builddir/mountainAdvect-h0-cutCell-1000-4000m-linearUpwind/dt.txt',
                '$atmostests_builddir/mountainAdvect-h0-cutCell-1000-5000m-linearUpwind/dt.txt',
                '$atmostests_builddir/mountainAdvect-h0-cutCell-1000-6000m-linearUpwind/dt.txt',
                '$atmostests_builddir/mountainAdvect-h0-slantedCell-1000-0m-linearUpwind/dt.txt',
                '$atmostests_builddir/mountainAdvect-h0-slantedCell-1000-3000m-linearUpwind/dt.txt',
                '$atmostests_builddir/mountainAdvect-h0-slantedCell-1000-4000m-linearUpwind/dt.txt',
                '$atmostests_builddir/mountainAdvect-h0-slantedCell-1000-5000m-linearUpwind/dt.txt',
                '$atmostests_builddir/mountainAdvect-h0-slantedCell-1000-6000m-linearUpwind/dt.txt'
            ])

        self.unstableCourantNumber = siunitx.Num(
            'mountainAdvect-h0-slantedCell-1000-6000m-linearUpwind-co',
            '$atmostests_builddir/mountainAdvect-h0-slantedCell-1000-6000m-linearUpwind',
            Paths.courantNumber)

    def copyCases(self):
        self.btf5000mLinearUpwind = GmtPlotCopyCase(
            'mountainAdvect-h0-btf-1000-5000m-linearUpwind',
            source='$atmostests_builddir',
            target='$builddir',
            plots=[
                'src/thesis/slanted/mountainAdvect/meshW.gmtdict',
                'src/thesis/slanted/mountainAdvect/errorW.gmtdict'
            ],
            files=['10000/T', '10000/T_analytic', '10000/T_diff'])

        self.cutCell5000mLinearUpwind = GmtPlotCopyCase(
            'mountainAdvect-h0-cutCell-1000-5000m-linearUpwind',
            source='$atmostests_builddir',
            target='$builddir',
            plots=[
                'src/thesis/slanted/mountainAdvect/meshW.gmtdict',
                'src/thesis/slanted/mountainAdvect/error.gmtdict'
            ],
            files=['10000/T', '10000/T_analytic', '10000/T_diff'])

        self.slantedCell5000mLinearUpwind = GmtPlotCopyCase(
            'mountainAdvect-h0-slantedCell-1000-5000m-linearUpwind',
            source='$atmostests_builddir',
            target='$builddir',
            plots=[
                'src/thesis/slanted/mountainAdvect/mesh.gmtdict',
                'src/thesis/slanted/mountainAdvect/error.gmtdict'
            ],
            files=['10000/T', '10000/T_analytic', '10000/T_diff'])

        self.btf5000mCubicFit = GmtPlotCopyCase(
            'mountainAdvect-h0-btf-1000-5000m-cubicFit',
            source='$atmostests_builddir',
            target='$builddir',
            plots=[
                'src/thesis/slanted/mountainAdvect/errorSW.gmtdict',
                'src/thesis/slanted/mountainAdvect/tracer.gmtdict'
            ],
            files=['10000/T', '10000/T_analytic', '10000/T_diff'],
            renamedFiles={
                '0/T': '10000/T_0',
                '5000/T': '10000/T_5000'
            })

        self.cutCell5000mCubicFit = GmtPlotCopyCase(
            'mountainAdvect-h0-cutCell-1000-5000m-cubicFit',
            source='$atmostests_builddir',
            target='$builddir',
            plots=['src/thesis/slanted/mountainAdvect/errorS.gmtdict'],
            files=['10000/T', '10000/T_analytic', '10000/T_diff'])

        self.slantedCell5000mCubicFit = GmtPlotCopyCase(
            'mountainAdvect-h0-slantedCell-1000-5000m-cubicFit',
            source='$atmostests_builddir',
            target='$builddir',
            plots=['src/thesis/slanted/mountainAdvect/errorS.gmtdict'],
            files=['10000/T', '10000/T_analytic', '10000/T_diff'])

    def meshes(self):
        self.btfMesh = GmtPlot(
            'mountainAdvect-btfMesh',
            plot='meshW',
            case=Case('mountainAdvect-h0-btf-1000-5000m-linearUpwind'),
            time='constant')

        self.cutCellMesh = GmtPlot(
            'mountainAdvect-cutCellMesh',
            plot='meshW',
            case=Case('mountainAdvect-h0-cutCell-1000-5000m-linearUpwind'),
            time='constant')

        self.slantedCellMesh = GmtPlot(
            'mountainAdvect-slantedCellMesh',
            plot='mesh',
            case=Case('mountainAdvect-h0-slantedCell-1000-5000m-linearUpwind'),
            time='constant')

    def heatmaps(self):
        self.btfLinearUpwindError = GmtPlot(
            'mountainAdvect-btfLinearUpwindError',
            plot='errorW',
            case=Case('mountainAdvect-h0-btf-1000-5000m-linearUpwind'),
            time=10000,
            data=['10000/T', '10000/T_analytic', '10000/T_diff'])

        self.cutCellLinearUpwindError = GmtPlot(
            'mountainAdvect-cutCellLinearUpwindError',
            plot='error',
            case=Case('mountainAdvect-h0-cutCell-1000-5000m-linearUpwind'),
            time=10000,
            data=['10000/T', '10000/T_analytic', '10000/T_diff'],
            colorBar='legends/error_T_diff.eps')

        self.slantedCellLinearUpwindError = GmtPlot(
            'mountainAdvect-slantedCellLinearUpwindError',
            plot='error',
            case=Case('mountainAdvect-h0-slantedCell-1000-5000m-linearUpwind'),
            time=10000,
            data=['10000/T', '10000/T_analytic', '10000/T_diff'])

        self.btfCubicFitError = GmtPlot(
            'mountainAdvect-btfCubicFitError',
            plot='errorSW',
            case=Case('mountainAdvect-h0-btf-1000-5000m-cubicFit'),
            time=10000,
            data=['10000/T', '10000/T_analytic', '10000/T_diff'])

        self.cutCellCubicFitError = GmtPlot(
            'mountainAdvect-cutCellCubicFitError',
            plot='errorS',
            case=Case('mountainAdvect-h0-cutCell-1000-5000m-cubicFit'),
            time=10000,
            data=['10000/T', '10000/T_analytic', '10000/T_diff'])

        self.slantedCellCubicFitError = GmtPlot(
            'mountainAdvect-slantedCellCubicFitError',
            plot='errorS',
            case=Case('mountainAdvect-h0-slantedCell-1000-5000m-cubicFit'),
            time=10000,
            data=['10000/T', '10000/T_analytic', '10000/T_diff'])

        self.heatmapL2Errors = [
            siunitx.Num(
                'mountainAdvect-h0-btf-1000-5000m-linearUpwind-l2error',
                '$atmostests_builddir/mountainAdvect-h0-btf-1000-5000m-linearUpwind',
                '10000/l2errorT.txt'),
            siunitx.Num(
                'mountainAdvect-h0-cutCell-1000-5000m-linearUpwind-l2error',
                '$atmostests_builddir/mountainAdvect-h0-cutCell-1000-5000m-linearUpwind',
                '10000/l2errorT.txt'),
            siunitx.Num(
                'mountainAdvect-h0-slantedCell-1000-5000m-linearUpwind-l2error',
                '$atmostests_builddir/mountainAdvect-h0-slantedCell-1000-5000m-linearUpwind',
                '10000/l2errorT.txt'),
            siunitx.Num(
                'mountainAdvect-h0-btf-1000-5000m-cubicFit-l2error',
                '$atmostests_builddir/mountainAdvect-h0-btf-1000-5000m-cubicFit',
                '10000/l2errorT.txt'),
            siunitx.Num(
                'mountainAdvect-h0-cutCell-1000-5000m-cubicFit-l2error',
                '$atmostests_builddir/mountainAdvect-h0-cutCell-1000-5000m-cubicFit',
                '10000/l2errorT.txt'),
            siunitx.Num(
                'mountainAdvect-h0-slantedCell-1000-5000m-cubicFit-l2error',
                '$atmostests_builddir/mountainAdvect-h0-slantedCell-1000-5000m-cubicFit',
                '10000/l2errorT.txt')
        ]

        self.heatmapLinfErrors = [
            siunitx.Num(
                'mountainAdvect-h0-btf-1000-5000m-linearUpwind-linferror',
                '$atmostests_builddir/mountainAdvect-h0-btf-1000-5000m-linearUpwind',
                '10000/linferrorT.txt'),
            siunitx.Num(
                'mountainAdvect-h0-cutCell-1000-5000m-linearUpwind-linferror',
                '$atmostests_builddir/mountainAdvect-h0-cutCell-1000-5000m-linearUpwind',
                '10000/linferrorT.txt'),
            siunitx.Num(
                'mountainAdvect-h0-slantedCell-1000-5000m-linearUpwind-linferror',
                '$atmostests_builddir/mountainAdvect-h0-slantedCell-1000-5000m-linearUpwind',
                '10000/linferrorT.txt'),
            siunitx.Num(
                'mountainAdvect-h0-btf-1000-5000m-cubicFit-linferror',
                '$atmostests_builddir/mountainAdvect-h0-btf-1000-5000m-cubicFit',
                '10000/linferrorT.txt'),
            siunitx.Num(
                'mountainAdvect-h0-cutCell-1000-5000m-cubicFit-linferror',
                '$atmostests_builddir/mountainAdvect-h0-cutCell-1000-5000m-cubicFit',
                '10000/linferrorT.txt'),
            siunitx.Num(
                'mountainAdvect-h0-slantedCell-1000-5000m-cubicFit-linferror',
                '$atmostests_builddir/mountainAdvect-h0-slantedCell-1000-5000m-cubicFit',
                '10000/linferrorT.txt')
        ]

    def outputs(self):
        return self.meshesFigure.outputs() \
                + self.tracerFigure.outputs() \
                + self.errorFigure.outputs() \
                + self.l2ByMountainHeight.outputs() \
                + self.maxdt.outputs() \
                + self.timesteps.outputs() \
                + self.unstableCourantNumber.outputs()

    def addTo(self, build):
        build.add(self.btf5000mLinearUpwind)
        build.add(self.cutCell5000mLinearUpwind)
        build.add(self.slantedCell5000mLinearUpwind)
        build.add(self.btf5000mCubicFit)
        build.add(self.cutCell5000mCubicFit)
        build.add(self.slantedCell5000mCubicFit)

        build.add(self.btfMesh)
        build.add(self.cutCellMesh)
        build.add(self.slantedCellMesh)
        build.add(self.meshesFigure)

        build.add(self.btfLinearUpwindError)
        build.add(self.cutCellLinearUpwindError)
        build.add(self.slantedCellLinearUpwindError)
        build.add(self.btfCubicFitError)
        build.add(self.cutCellCubicFitError)
        build.add(self.slantedCellCubicFitError)
        build.addAll(self.heatmapL2Errors)
        build.addAll(self.heatmapLinfErrors)
        build.add(self.errorFigure)

        build.add(self.tracerPlot)
        build.add(self.tracerFigure)

        build.add(self.l2ByMountainHeight)
        build.add(self.maxdt)
        build.add(self.timesteps)
        build.add(self.unstableCourantNumber)
示例#11
0
    def __init__(self):
        self.gaussiansConvergence = Gnuplot(
            'deformationSphere-gaussiansConvergence',
            output=os.path.join(
                'thesis/cubicFit/deformationSphere/gaussiansConvergence'),
            plot=os.path.join(
                'src/thesis/cubicFit/deformationSphere/gaussiansConvergence.plt'
            ),
            data=[
                '$atmostests_builddir/deformationSphere-gaussians-hex-linearUpwind-collated/1036800/l2errorT.txt',
                '$atmostests_builddir/deformationSphere-gaussians-hex-cubicFit-collated/1036800/l2errorT.txt',
                '$atmostests_builddir/deformationSphere-gaussians-cubedSphere-linearUpwind-collated/1036800/l2errorT.txt',
                '$atmostests_builddir/deformationSphere-gaussians-cubedSphere-cubicFit-collated/1036800/l2errorT.txt',
                '$atmostests_builddir/deformationSphere-gaussians-hex-linearUpwind-collated/1036800/linferrorT.txt',
                '$atmostests_builddir/deformationSphere-gaussians-hex-cubicFit-collated/1036800/linferrorT.txt',
                '$atmostests_builddir/deformationSphere-gaussians-cubedSphere-linearUpwind-collated/1036800/linferrorT.txt',
                '$atmostests_builddir/deformationSphere-gaussians-cubedSphere-cubicFit-collated/1036800/linferrorT.txt'
            ])

        self.gaussiansHex8cubicFit = GmtPlotCopyCase(
            'deformationSphere-gaussians-hex-8-cubicFit',
            source='$atmostests_builddir',
            target='$builddir',
            plots=[
                'src/thesis/cubicFit/deformationSphere/tracer.gmtdict',
                'src/thesis/cubicFit/deformationSphere/tracerW.gmtdict',
            ],
            files=['0/T', '518400/T', '1036800/T'])

        gaussiansHex8cubicFitCase = Case(
            'deformationSphere-gaussians-hex-8-cubicFit')

        self.gaussiansInitialTracer = GmtPlot(
            'deformationSphere-gaussiansInitialTracer',
            plot='tracer',
            case=gaussiansHex8cubicFitCase,
            time=0,
            data=['0/T'],
            colorBar='legends/tracer_T.eps')

        self.gaussiansMidTracer = GmtPlot(
            'deformationSphere-gaussiansMidTracer',
            plot='tracerW',
            case=gaussiansHex8cubicFitCase,
            time=518400,
            data=['518400/T'])

        self.gaussiansFinalTracer = GmtPlot(
            'deformationSphere-gaussiansFinalTracer',
            plot='tracerW',
            case=gaussiansHex8cubicFitCase,
            time=1036800,
            data=['1036800/T'])

        self.coarsestSpacing = siunitx.Ang(
            'deformationSphere-mesh-hex-4-averageEquatorialSpacing',
            '$atmostests_builddir/deformationSphere-mesh-hex-4',
            'averageEquatorialSpacing.txt')

        self.hex8Spacing = siunitx.Ang(
            'deformationSphere-mesh-hex-8-averageEquatorialSpacing',
            '$atmostests_builddir/deformationSphere-mesh-hex-8',
            'averageEquatorialSpacing.txt')

        self.finestSpacing = siunitx.Ang(
            'deformationSphere-mesh-hex-9-averageEquatorialSpacing',
            '$atmostests_builddir/deformationSphere-mesh-hex-9',
            'averageEquatorialSpacing.txt')
示例#12
0
class Resting:
    def __init__(self):
        self.copyCases()
        self.meshes()
        self.meshesFigure = PDFLaTeXFigure(
                'resting-fig-meshes',
                output=os.path.join('thesis/slanted/resting/fig-meshes'),
                figure=os.path.join('src/thesis/slanted/resting/fig-meshes'),
                components=self.btfMesh.outputs() + \
                           self.sleveMesh.outputs() + \
                           self.cutCellMesh.outputs() + \
                           self.slantedCellMesh.outputs()
        )

        self.w = Gnuplot(
            'resting-w',
            output=os.path.join('thesis/slanted/resting/w'),
            plot=os.path.join('src/thesis/slanted/resting/w.plt'),
            data=[
                '$atmostests_builddir/resting-btf-1000m-cubicFit/energy.dat',
                '$atmostests_builddir/resting-sleve-1000m-cubicFit/energy.dat',
                '$atmostests_builddir/resting-cutCell-1000m-cubicFit/energy.dat',
                '$atmostests_builddir/resting-slantedCell-1000m-cubicFit/energy.dat',
                '$atmostests_builddir/resting-btf-cubicFit-collated/maxw.txt',
                '$atmostests_builddir/resting-sleve-cubicFit-collated/maxw.txt',
                '$atmostests_builddir/resting-cutCell-cubicFit-collated/maxw.txt',
                '$atmostests_builddir/resting-slantedCell-cubicFit-collated/maxw.txt'
            ])

        self.btf1000mMaxW = siunitx.Velocity(
            'resting-btf-1000m-cubicFit-maxw',
            '$atmostests_builddir/resting-btf-1000m-cubicFit', 'maxw.txt')

    def copyCases(self):
        self.btfMesh6000mCase = GmtPlotCopyCase(
            'resting-mesh-btf-6000m',
            source='$atmostests_builddir',
            target='$builddir',
            plots=['src/thesis/slanted/resting/meshW.gmtdict'])

        self.sleveMesh6000mCase = GmtPlotCopyCase(
            'resting-mesh-sleve-6000m',
            source='$atmostests_builddir',
            target='$builddir',
            plots=['src/thesis/slanted/resting/mesh.gmtdict'])

        self.cutCellMesh6000mCase = GmtPlotCopyCase(
            'resting-mesh-cutCell-6000m',
            source='$atmostests_builddir',
            target='$builddir',
            plots=['src/thesis/slanted/resting/meshSW.gmtdict'])

        self.slantedCellMesh6000mCase = GmtPlotCopyCase(
            'resting-mesh-slantedCell-6000m',
            source='$atmostests_builddir',
            target='$builddir',
            plots=['src/thesis/slanted/resting/meshS.gmtdict'])

    def meshes(self):
        self.btfMesh = GmtPlot('resting-btfMesh',
                               plot='meshW',
                               case=Case('resting-mesh-btf-6000m'),
                               time='constant')

        self.sleveMesh = GmtPlot('resting-sleveMesh',
                                 plot='mesh',
                                 case=Case('resting-mesh-sleve-6000m'),
                                 time='constant')

        self.cutCellMesh = GmtPlot('resting-cutCellMesh',
                                   plot='meshSW',
                                   case=Case('resting-mesh-cutCell-6000m'),
                                   time='constant')

        self.slantedCellMesh = GmtPlot(
            'resting-slantedCellMesh',
            plot='meshS',
            case=Case('resting-mesh-slantedCell-6000m'),
            time='constant')

    def outputs(self):
        return  self.meshesFigure.outputs() + \
                self.w.outputs() + \
                self.btf1000mMaxW.outputs()

    def addTo(self, build):
        build.add(self.meshesFigure)
        build.add(self.btfMesh6000mCase)
        build.add(self.sleveMesh6000mCase)
        build.add(self.cutCellMesh6000mCase)
        build.add(self.slantedCellMesh6000mCase)
        build.add(self.btfMesh)
        build.add(self.sleveMesh)
        build.add(self.cutCellMesh)
        build.add(self.slantedCellMesh)
        build.add(self.w)
        build.add(self.btf1000mMaxW)
    def __init__(self):
        self.lorenz = GmtPlotCopyCase(
                'arakawaKonor-horizontalGrading-lorenz',
                source='$atmostests_builddir',
                target='$builddir',
                plots=[
                    'src/mc-report-2017-12/theta_diff.gmtdict',
                    'src/mc-report-2017-12/theta_diffS.gmtdict'
                ],
                files=['0/theta_diff', '172800/theta_diff'])

        self.charneyPhillips = GmtPlotCopyCase(
                'arakawaKonor-horizontalGrading-cp',
                source='$atmostests_builddir',
                target='$builddir',
                plots=['src/mc-report-2017-12/theta_diffS.gmtdict'],
                files=['172800/theta_diff'])

        lorenzCase = Case('arakawaKonor-horizontalGrading-lorenz')
        charneyPhillipsCase = Case('arakawaKonor-horizontalGrading-cp')

        self.initialThetaDiff = GmtPlot(
            'arakawaKonor-initial-theta_diff',
            plot='theta_diff',
            case=lorenzCase,
            time=0,
            data=['0/theta_diff'],
            colorBar='legends/theta_diff.eps')

        self.lorenzThetaDiff = GmtPlot(
            'arakawaKonor-lorenz-theta_diff',
            plot='theta_diffS',
            case=lorenzCase,
            time=172800,
            data=['172800/theta_diff'])

        self.charneyPhillipsThetaDiff = GmtPlot(
            'arakawaKonor-cp-theta_diff',
            plot='theta_diffS',
            case=charneyPhillipsCase,
            time=172800,
            data=['172800/theta_diff'])

        self.thetaDiffFigure = PDFLaTeXFigure(
                'arakawaKonor-fig-thetaDiff',
                output=os.path.join('mc-report-2017-12/fig-arakawaKonor-thetaDiff'),
                figure=os.path.join('src/mc-report-2017-12/fig-arakawaKonor-thetaDiff'),
                components=self.initialThetaDiff.outputs() + \
                           self.lorenzThetaDiff.outputs() + \
                           self.charneyPhillipsThetaDiff.outputs()
        )

        self.conservation = Gnuplot(
                'arakawaKonor-conservation',
                output=os.path.join('mc-report-2017-12/arakawaKonor-conservation'),
                plot=os.path.join('src/mc-report-2017-12/arakawaKonor-conservation.plt'),
                data=[
                    '$atmostests_builddir/arakawaKonor-uniform-lorenz/energy.dat',
                    '$atmostests_builddir/arakawaKonor-uniform-cp/energy.dat',
                    '$atmostests_builddir/arakawaKonor-horizontalGrading-lorenz/energy.dat',
                    '$atmostests_builddir/arakawaKonor-horizontalGrading-cp/energy.dat',
                    '$atmostests_builddir/arakawaKonorAdvect-uniform-lorenz/energy.dat',
                    '$atmostests_builddir/arakawaKonorAdvect-uniform-cp/energy.dat',
                    '$atmostests_builddir/arakawaKonorAdvect-horizontalGrading-lorenz/energy.dat',
                    '$atmostests_builddir/arakawaKonorAdvect-horizontalGrading-cp/energy.dat'
                ]
        )
示例#14
0
    def __init__(self):
        self.copyCases()

        uniformLorenzCase = Case('arakawaKonor-uniform-lorenz')
        uniformCPCase = Case('arakawaKonor-uniform-cp')
        horizontalGradingLorenzCase = Case(
            'arakawaKonor-horizontalGrading-lorenz')
        horizontalGradingCPCase = Case('arakawaKonor-horizontalGrading-cp')

        self.uniformInitialThetaDiff = GmtPlot(
            'arakawaKonor-uniform-initial-theta_diff',
            plot='theta_diffW',
            case=uniformLorenzCase,
            time=0,
            data=['0/theta_diff'],
            colorBar='legends/theta_diffW_theta_diff.eps')

        self.uniformLorenzThetaDiff = GmtPlot(
            'arakawaKonor-uniform-lorenz-theta_diff',
            plot='theta_diffSW',
            case=uniformLorenzCase,
            time=172800,
            data=['172800/theta_diff'])

        self.uniformCPThetaDiff = GmtPlot('arakawaKonor-uniform-cp-theta_diff',
                                          plot='theta_diffSW',
                                          case=uniformCPCase,
                                          time=172800,
                                          data=['172800/theta_diff'])

        self.horizontalGradingInitialThetaDiff = GmtPlot(
            'arakawaKonor-horizontalGrading-initial-theta_diff',
            plot='theta_diff',
            case=horizontalGradingLorenzCase,
            time=0,
            data=['0/theta_diff'])

        self.horizontalGradingLorenzThetaDiff = GmtPlot(
            'arakawaKonor-horizontalGrading-lorenz-theta_diff',
            plot='theta_diffS',
            case=horizontalGradingLorenzCase,
            time=172800,
            data=['172800/theta_diff'])

        self.horizontalGradingCPThetaDiff = GmtPlot(
            'arakawaKonor-horizontalGrading-cp-theta_diff',
            plot='theta_diffS',
            case=horizontalGradingCPCase,
            time=172800,
            data=['172800/theta_diff'])

        self.thetaDiffFigure = PDFLaTeXFigure(
                'arakawaKonor-fig-theta_diff',
                output=os.path.join('thesis/cp/arakawaKonor/fig-theta_diff'),
                figure=os.path.join('src/thesis/cp/arakawaKonor/fig-theta_diff'),
                components=self.uniformInitialThetaDiff.outputs() + \
                           self.uniformLorenzThetaDiff.outputs() + \
                           self.uniformCPThetaDiff.outputs() + \
                           self.horizontalGradingInitialThetaDiff.outputs() + \
                           self.horizontalGradingLorenzThetaDiff.outputs() + \
                           self.horizontalGradingCPThetaDiff.outputs()
        )

        self.meshes()
        self.meshesFigure = PDFLaTeXFigure(
                'arakawaKonor-fig-meshes',
                output=os.path.join('thesis/cp/arakawaKonor/fig-meshes'),
                figure=os.path.join('src/thesis/cp/arakawaKonor/fig-meshes'),
                components=self.horizontalGradedMesh.outputs() + \
                           self.verticalGradedMesh.outputs()
        )

        self.conservation = Gnuplot(
            'arakawaKonor-conservation',
            output=os.path.join('thesis/cp/arakawaKonor/conservation'),
            plot=os.path.join('src/thesis/cp/arakawaKonor/conservation.plt'),
            data=[
                '$atmostests_builddir/arakawaKonor-uniform-lorenz/energy.dat',
                '$atmostests_builddir/arakawaKonor-uniform-cp/energy.dat',
                '$atmostests_builddir/arakawaKonor-horizontalGrading-lorenz/energy.dat',
                '$atmostests_builddir/arakawaKonor-horizontalGrading-cp/energy.dat',
                '$atmostests_builddir/arakawaKonor-verticalGrading-lorenz/energy.dat',
                '$atmostests_builddir/arakawaKonor-verticalGrading-cp/energy.dat'
            ])
示例#15
0
class ArakawaKonor:
    def __init__(self):
        self.copyCases()

        uniformLorenzCase = Case('arakawaKonor-uniform-lorenz')
        uniformCPCase = Case('arakawaKonor-uniform-cp')
        horizontalGradingLorenzCase = Case(
            'arakawaKonor-horizontalGrading-lorenz')
        horizontalGradingCPCase = Case('arakawaKonor-horizontalGrading-cp')

        self.uniformInitialThetaDiff = GmtPlot(
            'arakawaKonor-uniform-initial-theta_diff',
            plot='theta_diffW',
            case=uniformLorenzCase,
            time=0,
            data=['0/theta_diff'],
            colorBar='legends/theta_diffW_theta_diff.eps')

        self.uniformLorenzThetaDiff = GmtPlot(
            'arakawaKonor-uniform-lorenz-theta_diff',
            plot='theta_diffSW',
            case=uniformLorenzCase,
            time=172800,
            data=['172800/theta_diff'])

        self.uniformCPThetaDiff = GmtPlot('arakawaKonor-uniform-cp-theta_diff',
                                          plot='theta_diffSW',
                                          case=uniformCPCase,
                                          time=172800,
                                          data=['172800/theta_diff'])

        self.horizontalGradingInitialThetaDiff = GmtPlot(
            'arakawaKonor-horizontalGrading-initial-theta_diff',
            plot='theta_diff',
            case=horizontalGradingLorenzCase,
            time=0,
            data=['0/theta_diff'])

        self.horizontalGradingLorenzThetaDiff = GmtPlot(
            'arakawaKonor-horizontalGrading-lorenz-theta_diff',
            plot='theta_diffS',
            case=horizontalGradingLorenzCase,
            time=172800,
            data=['172800/theta_diff'])

        self.horizontalGradingCPThetaDiff = GmtPlot(
            'arakawaKonor-horizontalGrading-cp-theta_diff',
            plot='theta_diffS',
            case=horizontalGradingCPCase,
            time=172800,
            data=['172800/theta_diff'])

        self.thetaDiffFigure = PDFLaTeXFigure(
                'arakawaKonor-fig-theta_diff',
                output=os.path.join('thesis/cp/arakawaKonor/fig-theta_diff'),
                figure=os.path.join('src/thesis/cp/arakawaKonor/fig-theta_diff'),
                components=self.uniformInitialThetaDiff.outputs() + \
                           self.uniformLorenzThetaDiff.outputs() + \
                           self.uniformCPThetaDiff.outputs() + \
                           self.horizontalGradingInitialThetaDiff.outputs() + \
                           self.horizontalGradingLorenzThetaDiff.outputs() + \
                           self.horizontalGradingCPThetaDiff.outputs()
        )

        self.meshes()
        self.meshesFigure = PDFLaTeXFigure(
                'arakawaKonor-fig-meshes',
                output=os.path.join('thesis/cp/arakawaKonor/fig-meshes'),
                figure=os.path.join('src/thesis/cp/arakawaKonor/fig-meshes'),
                components=self.horizontalGradedMesh.outputs() + \
                           self.verticalGradedMesh.outputs()
        )

        self.conservation = Gnuplot(
            'arakawaKonor-conservation',
            output=os.path.join('thesis/cp/arakawaKonor/conservation'),
            plot=os.path.join('src/thesis/cp/arakawaKonor/conservation.plt'),
            data=[
                '$atmostests_builddir/arakawaKonor-uniform-lorenz/energy.dat',
                '$atmostests_builddir/arakawaKonor-uniform-cp/energy.dat',
                '$atmostests_builddir/arakawaKonor-horizontalGrading-lorenz/energy.dat',
                '$atmostests_builddir/arakawaKonor-horizontalGrading-cp/energy.dat',
                '$atmostests_builddir/arakawaKonor-verticalGrading-lorenz/energy.dat',
                '$atmostests_builddir/arakawaKonor-verticalGrading-cp/energy.dat'
            ])

    def copyCases(self):
        self.uniformLorenz = GmtPlotCopyCase(
            'arakawaKonor-uniform-lorenz',
            source='$atmostests_builddir',
            target='$builddir',
            plots=[
                'src/thesis/cp/arakawaKonor/theta_diffW.gmtdict',
                'src/thesis/cp/arakawaKonor/theta_diffSW.gmtdict'
            ],
            files=['0/theta_diff', '172800/theta_diff'])

        self.uniformCP = GmtPlotCopyCase(
            'arakawaKonor-uniform-cp',
            source='$atmostests_builddir',
            target='$builddir',
            plots=['src/thesis/cp/arakawaKonor/theta_diffSW.gmtdict'],
            files=['172800/theta_diff'])

        self.horizontalGradingLorenz = GmtPlotCopyCase(
            'arakawaKonor-horizontalGrading-lorenz',
            source='$atmostests_builddir',
            target='$builddir',
            plots=[
                'src/thesis/cp/arakawaKonor/meshW.gmtdict',
                'src/thesis/cp/arakawaKonor/theta_diff.gmtdict',
                'src/thesis/cp/arakawaKonor/theta_diffS.gmtdict'
            ],
            files=['0/theta_diff', '172800/theta_diff'])

        self.horizontalGradingCP = GmtPlotCopyCase(
            'arakawaKonor-horizontalGrading-cp',
            source='$atmostests_builddir',
            target='$builddir',
            plots=['src/thesis/cp/arakawaKonor/theta_diffS.gmtdict'],
            files=['172800/theta_diff'])

        self.verticalGradingLorenz = GmtPlotCopyCase(
            'arakawaKonor-verticalGrading-lorenz',
            source='$atmostests_builddir',
            target='$builddir',
            plots=['src/thesis/cp/arakawaKonor/mesh.gmtdict'])

    def meshes(self):
        self.horizontalGradedMesh = GmtPlot(
            'arakawaKonor-horizontalGradedMesh',
            plot='meshW',
            case=Case('arakawaKonor-horizontalGrading-lorenz'),
            time='constant')

        self.verticalGradedMesh = GmtPlot(
            'arakawaKonor-verticalGradedMesh',
            plot='mesh',
            case=Case('arakawaKonor-verticalGrading-lorenz'),
            time='constant')

    def outputs(self):
        return self.thetaDiffFigure.outputs() + \
               self.meshesFigure.outputs() + \
               self.conservation.outputs()

    def addTo(self, build):
        build.add(self.uniformLorenz)
        build.add(self.uniformCP)
        build.add(self.horizontalGradingLorenz)
        build.add(self.horizontalGradingCP)
        build.add(self.verticalGradingLorenz)

        build.add(self.uniformInitialThetaDiff)
        build.add(self.uniformLorenzThetaDiff)
        build.add(self.uniformCPThetaDiff)
        build.add(self.horizontalGradingInitialThetaDiff)
        build.add(self.horizontalGradingLorenzThetaDiff)
        build.add(self.horizontalGradingCPThetaDiff)
        build.add(self.thetaDiffFigure)

        build.add(self.horizontalGradedMesh)
        build.add(self.verticalGradedMesh)
        build.add(self.meshesFigure)

        build.add(self.conservation)