LCOV - code coverage report
Current view: top level - src - alamo.cc (source / functions) Coverage Total Hit
Test: coverage_merged.info Lines: 74.2 % 31 23
Test Date: 2025-07-23 22:41:20 Functions: 100.0 % 1 1

            Line data    Source code
       1              : // This is the main entry point for alamo and is a general-purpose launcher for
       2              : // many of the main integrators.
       3              : // Check the possible values for :code:`alamo.program` below to see the possible
       4              : // integrators that can be launched.
       5              : //
       6              : 
       7              : #include <iostream>
       8              : #include <fstream>
       9              : #include <iomanip>
      10              : 
      11              : #include "Util/Util.H"
      12              : #include "IO/ParmParse.H"
      13              : #include "IO/FileNameParse.H"
      14              : #include "IO/WriteMetaData.H"
      15              : #include "AMReX_ParmParse.H"
      16              : 
      17              : #include "Model/Solid/Affine/Cubic.H"
      18              : #include "Model/Solid/Affine/Hexagonal.H"
      19              : #include "Model/Solid/Finite/PseudoAffine/Cubic.H"
      20              : 
      21              : #include "Integrator/AllenCahn.H"
      22              : #include "Integrator/CahnHilliard.H"
      23              : #include "Integrator/PhaseFieldMicrostructure.H"
      24              : #include "Integrator/Mechanics.H"
      25              : #include "Integrator/Flame.H"
      26              : #include "Integrator/HeatConduction.H"
      27              : #include "Integrator/Fracture.H"
      28              : #include "Integrator/ThermoElastic.H"
      29              : #include "Integrator/Dendrite.H"
      30              : #include "Integrator/PFC.H"
      31              : 
      32           12 : int main (int argc, char* argv[])
      33              : {
      34           12 :     Util::Initialize(argc,argv);
      35              : 
      36           12 :     std::string program;
      37           12 :     IO::ParmParse pp;
      38              :     // This input determines which integrator is used.
      39           48 :     pp.query_validate(  "alamo.program", program,
      40              :                         {"microstructure", "flame", "heat", "dendrite","allencahn","cahnhilliard","pfc"});
      41           12 :     srand(2);
      42              : 
      43           12 :     Integrator::Integrator *integrator = nullptr;
      44           12 :     if (program == "microstructure")
      45              :     {
      46            3 :         std::string model;
      47              :         // This input determines which elastic model is used - only if using
      48              :         // the PhaseFieldMicrostructure integrator.
      49           12 :         pp.query_validate(  "alamo.program.microstructure.model",model,
      50              :                             {"affine.cubic","affine.hexagonal","finite.pseudoaffine.cubic"});
      51            3 :         if (model == "affine.cubic")
      52            3 :             pp.select_only<Integrator::PhaseFieldMicrostructure<Model::Solid::Affine::Cubic>>(integrator);
      53            0 :         else if (model == "affine.hexagonal")
      54            0 :             pp.select_only<Integrator::PhaseFieldMicrostructure<Model::Solid::Affine::Hexagonal>>(integrator);
      55            0 :         else if (model == "finite.pseudoaffine.cubic")
      56            0 :             pp.select_only<Integrator::PhaseFieldMicrostructure<Model::Solid::Finite::PseudoAffine::Cubic>>(integrator);
      57            0 :         else Util::Abort(INFO,model," is not a valid model");
      58            3 :     }
      59            9 :     else if (program == "flame")                pp.select_only<Integrator::Flame>(integrator);
      60            6 :     else if (program == "heat")                 pp.select_only<Integrator::HeatConduction>(integrator);
      61            4 :     else if (program == "fracture")             pp.select_only<Integrator::Fracture>(integrator);
      62            4 :     else if (program == "dendrite")             pp.select_only<Integrator::Dendrite>(integrator);
      63            3 :     else if (program == "allencahn")            pp.select_only<Integrator::AllenCahn>(integrator);
      64            0 :     else if (program == "cahnhilliard")         pp.select_only<Integrator::CahnHilliard>(integrator);
      65            0 :     else if (program == "pfc")                  pp.select_only<Integrator::PFC>(integrator);
      66            0 :     else Util::Abort(INFO,"Error: \"",program,"\" is not a valid program.");
      67              : 
      68           12 :     integrator->InitData();
      69           12 :     integrator->Evolve();
      70           12 :     delete integrator;
      71              : 
      72           12 :     Util::Finalize();
      73           12 : } 
        

Generated by: LCOV version 2.0-1