Alamo
alamo.cc
Go to the documentation of this file.
1//
2// This is the main entry point for alamo and is a general-purpose launcher for
3// many of the main integrators.
4// Check the possible values for :code:`alamo.program` below to see the possible
5// integrators that can be launched.
6//
7
8#include <iostream>
9#include <fstream>
10#include <iomanip>
11
12#include "AMReX_ParallelDescriptor.H"
13#include "Util/Util.H"
14#include "IO/ParmParse.H"
15#include "IO/FileNameParse.H"
16#include "IO/WriteMetaData.H"
17#include "AMReX_ParmParse.H"
18
22
27#include "Integrator/Flame.H"
29#include "Integrator/Fracture.H"
31#include "Integrator/Dendrite.H"
32#include "Integrator/PFC.H"
33
34int main (int argc, char* argv[])
35{
36 Util::Initialize(argc,argv);
37
38 std::string program;
40 // This input determines which integrator is used.
41 pp.query_validate( "alamo.program", program,
42 {"microstructure", "flame", "heat", "dendrite","allencahn","cahnhilliard","pfc"});
43 srand(2);
44
45 Integrator::Integrator *integrator = nullptr;
46 if (program == "microstructure")
47 {
48 std::string model;
49 // This input determines which elastic model is used - only if using
50 // the PhaseFieldMicrostructure integrator.
51 pp.query_validate( "alamo.program.microstructure.model",model,
52 {"affine.cubic","affine.hexagonal","finite.pseudoaffine.cubic"});
53 if (model == "affine.cubic")
55 else if (model == "affine.hexagonal")
57 else if (model == "finite.pseudoaffine.cubic")
59 else Util::Abort(INFO,model," is not a valid model");
60 }
61 else if (program == "flame") pp.select_only<Integrator::Flame>(integrator);
62 else if (program == "heat") pp.select_only<Integrator::HeatConduction>(integrator);
63 else if (program == "dendrite") pp.select_only<Integrator::Dendrite>(integrator);
64 else if (program == "allencahn") pp.select_only<Integrator::AllenCahn>(integrator);
65 else if (program == "cahnhilliard") pp.select_only<Integrator::CahnHilliard>(integrator);
66 else if (program == "pfc") pp.select_only<Integrator::PFC>(integrator);
67 else Util::Abort(INFO,"Error: \"",program,"\" is not a valid program.");
68
69 integrator->InitData();
70 integrator->Evolve();
71 delete integrator;
72
74}
#define INFO
Definition Util.H:20
int main(int argc, char *argv[])
Definition alamo.cc:34
void select_only(PTRTYPE *&ic_eta, Args &&args)
Definition ParmParse.H:765
int query_validate(std::string name, int &value, std::vector< int > possibleintvals, std::string file="", std::string func="", int line=-1)
Definition ParmParse.H:195
This is the definition of the Allen Cahn class.
Definition AllenCahn.H:45
void InitData()
Front-end method to initialize simulation on all levels.
void Evolve()
Front-end method to start simulation.
Solve the Allen-Cahn evolution equation for microstructure with parameters , where n corresponds to t...
void Abort(const char *msg)
Definition Util.cpp:170
void Finalize()
Definition Util.cpp:158
void Initialize()
Definition Util.cpp:128