Line data Source code
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 :
19 : #include "Model/Solid/Affine/Cubic.H"
20 : #include "Model/Solid/Affine/Hexagonal.H"
21 : #include "Model/Solid/Finite/PseudoAffine/Cubic.H"
22 :
23 : #include "Integrator/AllenCahn.H"
24 : #include "Integrator/CahnHilliard.H"
25 : #include "Integrator/PhaseFieldMicrostructure.H"
26 : #include "Integrator/Mechanics.H"
27 : #include "Integrator/Flame.H"
28 : #include "Integrator/HeatConduction.H"
29 : #include "Integrator/Fracture.H"
30 : #include "Integrator/ThermoElastic.H"
31 : #include "Integrator/Dendrite.H"
32 : #include "Integrator/PFC.H"
33 :
34 13 : int main (int argc, char* argv[])
35 : {
36 13 : Util::Initialize(argc,argv);
37 :
38 13 : std::string program;
39 13 : IO::ParmParse pp;
40 : // This input determines which integrator is used.
41 91 : pp.query_validate( "alamo.program", program,
42 : {"microstructure", "flame", "heat", "dendrite","allencahn","cahnhilliard","pfc"});
43 13 : srand(2);
44 :
45 13 : Integrator::Integrator *integrator = nullptr;
46 13 : if (program == "microstructure")
47 : {
48 3 : std::string model;
49 : // This input determines which elastic model is used - only if using
50 : // the PhaseFieldMicrostructure integrator.
51 21 : pp.query_validate( "alamo.program.microstructure.model",model,
52 : {"affine.cubic","affine.hexagonal","finite.pseudoaffine.cubic"});
53 3 : if (model == "affine.cubic")
54 3 : pp.select_only<Integrator::PhaseFieldMicrostructure<Model::Solid::Affine::Cubic>>(integrator);
55 0 : else if (model == "affine.hexagonal")
56 0 : pp.select_only<Integrator::PhaseFieldMicrostructure<Model::Solid::Affine::Hexagonal>>(integrator);
57 0 : else if (model == "finite.pseudoaffine.cubic")
58 0 : pp.select_only<Integrator::PhaseFieldMicrostructure<Model::Solid::Finite::PseudoAffine::Cubic>>(integrator);
59 0 : else Util::Abort(INFO,model," is not a valid model");
60 3 : }
61 10 : else if (program == "flame") pp.select_only<Integrator::Flame>(integrator);
62 7 : else if (program == "heat") pp.select_only<Integrator::HeatConduction>(integrator);
63 3 : else if (program == "dendrite") pp.select_only<Integrator::Dendrite>(integrator);
64 2 : else if (program == "allencahn") pp.select_only<Integrator::AllenCahn>(integrator);
65 0 : else if (program == "cahnhilliard") pp.select_only<Integrator::CahnHilliard>(integrator);
66 0 : else if (program == "pfc") pp.select_only<Integrator::PFC>(integrator);
67 0 : else Util::Abort(INFO,"Error: \"",program,"\" is not a valid program.");
68 :
69 13 : integrator->InitData();
70 13 : integrator->Evolve();
71 13 : delete integrator;
72 :
73 13 : Util::Finalize();
74 13 : }
|