AbstractAmrWriter.h 2.14 KB
Newer Older
frey_m's avatar
frey_m committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
//
// Class AbstractAmrWriter
//   Abstract base class for writing AMR data to output files.
//
// Copyright (c) 2016 - 2020, Matthias Frey, Paul Scherrer Institut, Villigen PSI, Switzerland
// All rights reserved
//
// Implemented as part of the PhD thesis
// "Precise Simulations of Multibunches in High Intensity Cyclotrons"
//
// This file is part of OPAL.
//
// OPAL is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// You should have received a copy of the GNU General Public License
// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
//
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
#ifndef ABSTRACT_AMR_WRITER_H
#define ABSTRACT_AMR_WRITER_H

#include "Amr/AmrObject.h"
#include "Amr/AmrDefs.h"
#include "Algorithms/AmrPartBunch.h"

class AbstractAmrWriter {
    
public:
    /*!
     * @param rho is the charge density on all levels
     * @param phi is the electrostatic potential on all levels
     * @param efield are the electric field components on all levels
     * @param refRatio are the refinement ratios among the levels
     * @param geom are the geometries of all levels
frey_m's avatar
frey_m committed
37
     * @param nLevel available
38
     * @param time specifies the step.
frey_m's avatar
frey_m committed
39
     * @param scale used for mapping
40
     */
41 42 43
    virtual void writeFields(const amr::AmrScalarFieldContainer_t& rho,
                             const amr::AmrScalarFieldContainer_t& phi,
                             const amr::AmrVectorFieldContainer_t& efield,
44 45
                             const amr::AmrIntArray_t& refRatio,
                             const amr::AmrGeomContainer_t& geom,
frey_m's avatar
frey_m committed
46
                             const int& nLevel,
frey_m's avatar
frey_m committed
47 48
                             const double& time,
                             const double& scale = 1.0) = 0;
49 50 51
    
    /*!
     * @param bunch_p
frey_m's avatar
frey_m committed
52 53
     * @param time
     * @param scale used for mapping
54
     */
frey_m's avatar
frey_m committed
55
    virtual void writeBunch(const AmrPartBunch* bunch_p,
frey_m's avatar
frey_m committed
56
                            const double& time,
frey_m's avatar
frey_m committed
57
                            const double& scale = 1.0) = 0;
58 59 60 61 62 63
    
    virtual ~AbstractAmrWriter() { }
    
};

#endif