Changeset 728149 for src/interface


Ignore:
Timestamp:
Apr 30, 2012, 2:40:31 PM (14 years ago)
Author:
Frederik Heber <heber@…>
Children:
759a6a
Parents:
d448a7
Message:

Conformalized vmg getter functions with other solvers.

  • also rename gamma -> cycle_type.
  • all getters now return FCSResult and require two parameters.

git-svn-id: https://svn.version.fz-juelich.de/scafacos/trunk@1778 5161e1c8-67bf-11de-9fd5-51895aff932f

Location:
src/interface
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/interface/interface_fcs.cpp

    rd448a7 r728149  
    5353  static vmg_int max_iter = -1;
    5454  static vmg_int smoothing_steps = -1;
    55   static vmg_int gamma = -1;
     55  static vmg_int cycle_type = -1;
    5656  static vmg_float precision = -1;
    5757  static vmg_float box_offset[3];
     
    6464
    6565static void VMG_fcs_init(vmg_int level, vmg_int* periodic,vmg_int max_iter,
    66                          vmg_int smoothing_steps, vmg_int gamma, vmg_float precision,
     66                         vmg_int smoothing_steps, vmg_int cycle_type, vmg_float precision,
    6767                         vmg_float* box_offset, vmg_float box_size,
    6868                         vmg_int near_field_cells, vmg_int interpolation_degree,
     
    7373  VMGBackupSettings::max_iter = max_iter;
    7474  VMGBackupSettings::smoothing_steps = smoothing_steps;
    75   VMGBackupSettings::gamma = gamma;
     75  VMGBackupSettings::cycle_type = cycle_type;
    7676  VMGBackupSettings::precision = precision;
    7777  std::memcpy(VMGBackupSettings::box_offset, box_offset, 3*sizeof(vmg_float));
     
    158158   */
    159159  if (singular)
    160     Techniques::SetCorrectionSchemePeriodic(interface->MinLevel(), interface->MaxLevel(), gamma);
    161   else
    162     Techniques::SetFullApproximationSchemeDirichlet(interface->MinLevel(), interface->MaxLevel(), gamma);
     160    Techniques::SetCorrectionSchemePeriodic(interface->MinLevel(), interface->MaxLevel(), cycle_type);
     161  else
     162    Techniques::SetFullApproximationSchemeDirichlet(interface->MinLevel(), interface->MaxLevel(), cycle_type);
    163163
    164164  /*
     
    184184
    185185void VMG_fcs_setup(vmg_int level, vmg_int* periodic, vmg_int max_iter,
    186                    vmg_int smoothing_steps, vmg_int gamma, vmg_float precision,
     186                   vmg_int smoothing_steps, vmg_int cycle_type, vmg_float precision,
    187187                   vmg_float* box_offset, vmg_float box_size,
    188188                   vmg_int near_field_cells, vmg_int interpolation_degree,
     
    195195      VMGBackupSettings::max_iter != max_iter ||
    196196      VMGBackupSettings::smoothing_steps != smoothing_steps ||
    197       VMGBackupSettings::gamma != gamma ||
     197      VMGBackupSettings::cycle_type != cycle_type ||
    198198      VMGBackupSettings::precision != precision ||
    199199      VMGBackupSettings::box_offset[0] != box_offset[0] ||
     
    208208    VMG_fcs_destroy();
    209209    VMG_fcs_init(level, periodic, max_iter,
    210                  smoothing_steps, gamma, precision,
     210                 smoothing_steps, cycle_type, precision,
    211211                 box_offset, box_size, near_field_cells,
    212212                 interpolation_degree, discretization_order,
  • src/interface/interface_fcs.h

    rd448a7 r728149  
    1414
    1515void VMG_fcs_setup(fcs_int level, fcs_int* periodic, fcs_int max_iter,
    16                    fcs_int smoothing_steps, fcs_int gamma, fcs_float precision,
     16                   fcs_int smoothing_steps, fcs_int cycle_type, fcs_float precision,
    1717                   fcs_float* box_offset, fcs_float box_size,
    1818                   fcs_int near_field_cells, fcs_int interpolation_degree,
  • src/interface/interface_particles_cf.cpp

    rd448a7 r728149  
    5959  int max_level, max_iterations;
    6060  int pre_smoothing_steps, post_smoothing_steps;
    61   int gamma, near_field_cells, discretization_order;
     61  int cycle_type, near_field_cells, discretization_order;
    6262  vmg_float precision;
    6363  std::string lop_str, datafile_str;
     
    107107  pre_smoothing_steps = Helper::ToValWithDefault<int>(xml_conf.child_value("pre_smoothing_steps"), 3);
    108108  post_smoothing_steps = Helper::ToValWithDefault<int>(xml_conf.child_value("post_smoothing_steps"), 3);
    109   gamma = Helper::ToValWithDefault<int>(xml_conf.child_value("gamma"), 1);
     109  cycle_type = Helper::ToValWithDefault<int>(xml_conf.child_value("cycle_type"), 1);
    110110  near_field_cells = Helper::ToValWithDefault<int>(xml_conf.child_value("near_field_cells"), 3);
    111111  discretization_order = Helper::ToValWithDefault<int>(xml_conf.child_value("discretization_order"), 2);
     
    133133  if (!lop_str.compare("cs")) {
    134134    lop = new LevelOperatorCS(Stencils::RestrictionFullWeight, Stencils::InterpolationTrilinear);
    135     Techniques::SetCorrectionSchemePeriodic(interface->MinLevel(), interface->MaxLevel(), gamma);
     135    Techniques::SetCorrectionSchemePeriodic(interface->MinLevel(), interface->MaxLevel(), cycle_type);
    136136  } else if (!lop_str.compare("fas")) {
    137137    lop = new LevelOperatorFAS(Stencils::RestrictionFullWeight, Stencils::Injection, Stencils::InterpolationTrilinear);
    138     Techniques::SetFullApproximationSchemePeriodic(interface->MinLevel(), interface->MaxLevel(), gamma);
     138    Techniques::SetFullApproximationSchemePeriodic(interface->MinLevel(), interface->MaxLevel(), cycle_type);
    139139  } else if (!lop_str.compare("cs_debug")) {
    140140    lop = new LevelOperatorCS(Stencils::RestrictionFullWeight, Stencils::InterpolationTrilinear);
    141     Techniques::SetCorrectionSchemePeriodicDebug(interface->MinLevel(), interface->MaxLevel(), gamma);
     141    Techniques::SetCorrectionSchemePeriodicDebug(interface->MinLevel(), interface->MaxLevel(), cycle_type);
    142142  } else if (!lop_str.compare("fas_debug")) {
    143143    lop = new LevelOperatorFAS(Stencils::RestrictionFullWeight, Stencils::Injection, Stencils::InterpolationTrilinear);
    144     Techniques::SetFullApproximationSchemePeriodicDebug(interface->MinLevel(), interface->MaxLevel(), gamma);
     144    Techniques::SetFullApproximationSchemePeriodicDebug(interface->MinLevel(), interface->MaxLevel(), cycle_type);
    145145  } else {
    146146    lop = new LevelOperatorCS(Stencils::RestrictionFullWeight, Stencils::InterpolationTrilinear);
    147     Techniques::SetCorrectionSchemePeriodic(interface->MinLevel(), interface->MaxLevel(), gamma);
     147    Techniques::SetCorrectionSchemePeriodic(interface->MinLevel(), interface->MaxLevel(), cycle_type);
    148148  }
    149149  lop->Register("LEVEL_OPERATOR");
     
    170170    std::printf("  Maximum level:                %d\n", max_level);
    171171    std::printf("  Maximum number of iterations: %d\n", max_iterations);
    172     std::printf("  Gamma:                        %d\n", gamma);
     172    std::printf("  Gamma:                        %d\n", cycle_type);
    173173    std::printf("  Pre smoothing steps:          %d\n", pre_smoothing_steps);
    174174    std::printf("  Post smoothing steps:         %d\n", post_smoothing_steps);
Note: See TracChangeset for help on using the changeset viewer.