Пример #1
0
 NumberSource (const BlockModel& al)
   : Number (al),
     source (Librarian::build_item<Source> (al, "source")),
     begin (al.check ("begin") ? new Time (al.submodel ("begin")) : NULL),
     end (al.check ("end") ? new Time (al.submodel ("end")) : NULL),
     state (uninitialized),
     val (-42.42e42)
 { }
Пример #2
0
ReactionDenit::ReactionDenit (const BlockModel& al)
  : Reaction (al),
    K (al.number ("K")),
    K_fast (al.number ("K_fast", K)),
    alpha (al.number ("alpha")),
    alpha_fast (al.number ("alpha_fast", alpha)),
    heat_factor (al.check ("heat_factor") 
                 ? al.plf ("heat_factor") 
                 : PLF::empty ()),
    water_factor (al.plf ("water_factor")),
    water_factor_fast (al.check ("water_factor_fast" )
                       ? al.plf ("water_factor_fast")
                       : water_factor),
    redox_height (al.number ("redox_height", 1.0))
{ }
Пример #3
0
std::unique_ptr<Volume>
Volume::build_obsolete (const BlockModel& al)
{
  Volume *const vol = Librarian::build_item<Volume> (al, "volume");
  daisy_assert (vol);
  if (al.check ("from"))
    {
      const double from = al.number ("from");
      if (from < 0)
        vol->limit_top (from);
    }
  if (al.check ("to"))
    {
      const double to = al.number ("to");
      if (to < 0)
        vol->limit_bottom (to);
    }
  return std::unique_ptr<Volume> (vol);
}
Пример #4
0
 ActionWaitDays (const BlockModel& al)
   : Action (al),
     days (al.integer ("days")),
     hours (al.integer ("hours")),
     activated (al.check ("end_time")),
     end_time (1, 1, 1, 1)
 { 
   if (activated)
     end_time = Time (al.submodel ("end_time"));
 }
Пример #5
0
 ActionRepeat (const BlockModel& al)
   : Action (al),
     metalib (al.metalib ()),
     modified_frame (Action::frame (), FrameModel::parent_link),
     repeat (&al.model ("repeat").clone ()),
     action (al.check ("do") 
             ? Librarian::build_item<Action> (al, "do")
             : Librarian::build_item<Action> (al, "repeat"))
 { 
   if (!modified_frame.check ("do"))
     modified_frame.set ("do", *repeat);
 }
Пример #6
0
DrainLateral::DrainLateral (const BlockModel& al)
  : Drain (al),
    eq_depth (Librarian::build_item<Draineqd> (al, "eq_depth")),
    L (al.number ("L")),
    rad (al.number ("rad")),
    x (al.number ("x", L / 2.0)),
    pipe_position (al.number ("pipe_position")),
    pipe_outlet (al.check ("pipe_outlet")
                 ? Librarian::build_item<Depth> (al, "pipe_outlet")
                 : Depth::create (pipe_position)),
    K_to_pipes_ (al.number ("K_to_pipes", -1.0)),
    pipe_level (pipe_position),
    height (al.number ("height", pipe_position))
{ }
Пример #7
0
Horizon::Implementation::Implementation (const BlockModel& al)
  : dry_bulk_density (al.number ("dry_bulk_density", -42.42e42)),
    SOM_C_per_N (al.number_sequence ("SOM_C_per_N")),
    C_per_N (al.number ("C_per_N", -42.42e42)),
    SOM_fractions (al.check ("SOM_fractions") 
                   ? al.number_sequence ("SOM_fractions")
                   : std::vector<double> ()),
    turnover_factor (al.number ("turnover_factor")),
    anisotropy (al.number ("anisotropy")),
    attributes (get_attributes (al.submodel_sequence ("attributes"))),
    dimensions (get_dimensions (al.submodel_sequence ("attributes"))),
    nitrification (Librarian::build_item<Nitrification> (al, "Nitrification")),
    secondary (Librarian::build_item<Secondary> (al, "secondary_domain")),
    r_pore_min (al.number ("r_pore_min")),
    primary_sorption_fraction (NAN),
    hor_heat (al.submodel ("HorHeat")),
    CEC (al.number ("CEC", -42.42e42))
{ }