Commit dfb416af authored by William F Godoy's avatar William F Godoy
Browse files

Reorganize code

Attempt multiple dispatch
Define each type to extent AbstractExtractor
parent 70750183
module Exio
include('./extractor/ExioExtractor.jl')
import ExioExtractor
mutable struct Exio
extractor::AbstractExtractor
end
function exio_init(app::String, outputPrefix::String)::Exio
if app == 'AmrexCastro'
extractor::AmrexCastro
init(extractor, outputPrefix)
end
return Exio(extractor)
end
end
\ No newline at end of file
export Amrex
mutable struct Amrex <: AbstractExtractor
app::String
outputPrefix::String
degreesOfFreedom::String[]
end
function init!(extractor::Amrex, outputPrefix::String)::
extractor.app = 'Amrex'
extractor.outputPrefix = outputPrefix
extractor.degressOfFreedom = [
'max_step',
'amr.check_int',
'amr.plot_int',
'amr.n_cell',
'amr.max_level'
]
end
\ No newline at end of file
export AmrexCastro
mutable struct AmrexCastro <: AbstractExtractor
app::String
outputPrefix::String
degreesOfFreedom::String[]
end
function init!(extractor::AmrexCastro, outputPrefix::String)
extractor.app = 'AmrexCastro'
extractor.outputPrefix = outputPrefix
extractor.degressOfFreedom = [
'max_step',
'amr.check_int',
'amr.plot_int',
'amr.n_cell',
'amr.max_level',
'castro.cfl',
'castro.max_grid_size'
]
end
module ExioExtractor
export AbstractExtractor
abstract struct AbstractExtractor end
include('./amrex')
include('./amrex_castro')
end
\ No newline at end of file
import Exio
exio = exio_init('AmrexCastro', '.')
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment