コード例 #1
0
ファイル: TotalEnergy.C プロジェクト: karpeev/ferret
TotalEnergy::TotalEnergy(const std::string & name, InputParameters parameters) :
  GeneralPostprocessor(name, parameters),
  _bulk_energy(getPostprocessorValue(getParam<PostprocessorName>("bulk_energy"))),
  _wall_energy(getPostprocessorValue(getParam<PostprocessorName>("wall_energy"))),
  _electric_energy(getPostprocessorValue(getParam<PostprocessorName>("electric_energy")))
{
}
コード例 #2
0
ファイル: EigenExecutionerBase.C プロジェクト: ChaliZhg/moose
EigenExecutionerBase::EigenExecutionerBase(const std::string & name, InputParameters parameters) :
    Executioner(name, parameters),
     _problem(*parameters.getCheckedPointerParam<FEProblem *>("_fe_problem", "This might happen if you don't have a mesh")),
     _eigen_sys(static_cast<EigenSystem &>(_problem.getNonlinearSystem())),
     _eigenvalue(1.0),
     _source_integral(getPostprocessorValue("bx_norm")),
     _normalization(isParamValid("normalization") ? getPostprocessorValue("normalization")
                    : getPostprocessorValue("bx_norm")) // use |Bx| for normalization by default
{

  //FIXME: currently we have to use old and older solution vectors for power iteration.
  //       We will need 'step' in the future.
  _problem.transient(true);

  {
    // No time integrator for eigenvalue problem
    std::string ti_str = "SteadyState";
    InputParameters params = _app.getFactory().getValidParams(ti_str);
    _problem.addTimeIntegrator(ti_str, "ti", params);
  }

  // we want to tell the App about what our system time is (in case anyone else is interested).
  Real system_time = getParam<Real>("time");
  _app.setStartTime(system_time);

  // set the system time
  _problem.time() = system_time;
  _problem.timeOld() = system_time;

  // used for controlling screen print-out
  _problem.timeStep() = 0;
  _problem.dt() = 1.0;
}
コード例 #3
0
CavityPressureUserObject::CavityPressureUserObject(const std::string & obj_name, InputParameters params) :
    GeneralUserObject(obj_name, params),
   _cavity_pressure(declareRestartableData<Real>("cavity_pressure", 0)),
   _n0(declareRestartableData<Real>("initial_moles", 0)),
   _initial_pressure(getParam<Real>("initial_pressure")),
   _material_input(),
   _R(getParam<Real>("R")),
   _temperature( getPostprocessorValue("temperature")),
   _init_temp_given( isParamValid("initial_temperature") ),
   _init_temp( _init_temp_given ? getParam<Real>("initial_temperature") : 0 ),
   _volume( getPostprocessorValue("volume")),
   _start_time(0),
   _startup_time( getParam<Real>("startup_time")),
   _initialized(declareRestartableData<bool>("initialized", false))
{

  if (isParamValid("material_input"))
  {
    std::vector<PostprocessorName> ppn = params.get<std::vector<PostprocessorName> >("material_input");
    const unsigned len = ppn.size();
    for (unsigned i(0); i < len; ++i)
    {
      _material_input.push_back( &getPostprocessorValueByName(ppn[i]) );
    }
  }

}
コード例 #4
0
ファイル: EigenExecutionerBase.C プロジェクト: kun-liu/moose
EigenExecutionerBase::EigenExecutionerBase(const std::string & name, InputParameters parameters)
    :Executioner(name, parameters),
     _problem(*parameters.getCheckedPointerParam<FEProblem *>("_fe_problem", "This might happen if you don't have a mesh")),
     _eigen_sys(static_cast<EigenSystem &>(_problem.getNonlinearSystem())),
     _eigenvalue(_problem.parameters().set<Real>("eigenvalue")), // used for storing the eigenvalue
     _source_integral(getPostprocessorValue("bx_norm")),
     _source_integral_old(getPostprocessorValueOld("bx_norm")),
     _solution_diff(isParamValid("xdiff") ? &getPostprocessorValue("xdiff") : NULL),
     _normalization(isParamValid("normalization") ? getPostprocessorValue("normalization")
                    : getPostprocessorValue("bx_norm")) // use |Bx| for normalization by default
{
  _eigenvalue = 1.0;

  // EigenKernel needs this postprocessor
  _problem.parameters().set<PostprocessorName>("eigen_postprocessor")
    = getParam<PostprocessorName>("bx_norm");

  //FIXME: currently we have to use old and older solution vectors for power iteration.
  //       We will need 'step' in the future.
  _problem.transient(true);

  {
    // No time integrator for eigenvalue problem
    std::string ti_str = "SteadyState";
    InputParameters params = _app.getFactory().getValidParams(ti_str);
    _problem.addTimeIntegrator(ti_str, "ti", params);
  }

  // set the system time
  _problem.time() = getParam<Real>("time");

  // used for controlling screen print-out
  _problem.timeStep() = 0;
  _problem.dt() = 1.0;
}
コード例 #5
0
MixedModeEquivalentK::MixedModeEquivalentK(const InputParameters & parameters) :
    GeneralPostprocessor(parameters),
    _ki_value(getPostprocessorValue("KI_name")),
    _kii_value(getPostprocessorValue("KII_name")),
    _kiii_value(getPostprocessorValue("KIII_name")),
    _poissons_ratio(getParam<Real>("poissons_ratio"))
{
}
コード例 #6
0
LiquidInterfaceVelocity::LiquidInterfaceVelocity(const InputParameters & parameters) :
    GeneralPostprocessor(parameters),
    _MinTemp(getPostprocessorValue("MinTemp")),
    _MaxTemp(getPostprocessorValue("MaxTemp")),
    _Hv(getPostprocessorValue("VaporHeight")),
    _r_inner(getParam<Real>("cell_inner_radius")),
    _r_outer(getParam<Real>("cell_outer_radius"))
{}
コード例 #7
0
PlenumPressureUserObject::PlenumPressureUserObject(const std::string & name, InputParameters params)
  :GeneralUserObject(name, params),
   _plenum_pressure(declareRestartableData<Real>("plenum_pressure", 0)),
   _n0(declareRestartableData<Real>("initial_moles", 0)),
   _initial_pressure(getParam<Real>("initial_pressure")),
   _material_input(),
   _R(getParam<Real>("R")),
   _temperature( getPostprocessorValue("temperature")),
   _volume( getPostprocessorValue("volume")),
   _start_time(0),
   _startup_time( getParam<Real>("startup_time")),
   _refab_needed(isParamValid("refab_time") ? getParam<std::vector<Real> >("refab_time").size() : 0),
   _refab_gas_released(declareRestartableData<Real>("refab_gas_released", 0)),
   _refab_time( isParamValid("refab_time") ?
                getParam<std::vector<Real> >("refab_time") :
                std::vector<Real>(1, -std::numeric_limits<Real>::max()) ),
   _refab_pressure( isParamValid("refab_pressure") ?
                    getParam<std::vector<Real> >("refab_pressure") :
                    std::vector<Real>(_refab_time.size(), 0) ),
   _refab_temperature( isParamValid("refab_temperature") ?
                       getParam<std::vector<Real> >("refab_temperature") :
                       std::vector<Real>(_refab_time.size(), 0) ),
   _refab_volume( isParamValid("refab_volume") ?
                  getParam<std::vector<Real> >("refab_volume") :
                  std::vector<Real>(_refab_time.size(), 0) ),
   _refab_type( isParamValid("refab_type") ?
                getParam<std::vector<unsigned> >("refab_type") :
                std::vector<unsigned>(_refab_time.size(), 0) ),
   _refab_counter(declareRestartableData<unsigned int>("refab_counter", 0)),
   _initialized(declareRestartableData<bool>("initialized", false))
{

  if (isParamValid("material_input"))
  {
    std::vector<PostprocessorName> ppn = params.get<std::vector<PostprocessorName> >("material_input");
    const unsigned len = ppn.size();
    for (unsigned i(0); i < len; ++i)
    {
      _material_input.push_back( &getPostprocessorValueByName(ppn[i]) );
    }
  }

  if (params.isParamValid("refab_time") &&
      !(params.isParamValid("refab_pressure") &&
        params.isParamValid("refab_temperature") &&
        params.isParamValid("refab_volume")))
  {
    mooseError("PlenumPressureUserObject error: refabrication time given but not complete set of refabrication data");
  }
  if (_refab_time.size() != _refab_pressure.size() ||
      _refab_pressure.size() != _refab_temperature.size() ||
      _refab_temperature.size() != _refab_volume.size() ||
      _refab_volume.size() != _refab_type.size())
  {
    mooseError("Refab parameters do not have equal lengths");
  }

}
コード例 #8
0
ファイル: ThermalConductivity.C プロジェクト: FHilty/moose
ThermalConductivity::ThermalConductivity(const InputParameters & parameters)
  : SideAverageValue(parameters),
    _dx(getParam<Real>("dx")),
    _flux(getPostprocessorValue("flux")),
    _T_hot(getPostprocessorValue("T_hot")),
    _length_scale(getParam<Real>("length_scale")),
    _k0(getParam<Real>("k0")),
    _step_zero(declareRestartableData<bool>("step_zero", true))
{
}
コード例 #9
0
AnisoHeatConductionMaterial::AnisoHeatConductionMaterial(const InputParameters & parameters) :
  Material(parameters),

  _has_temp(isCoupled("temp")),
  _temperature(_has_temp ? coupledValue("temp") : _zero),

  _my_thermal_conductivity_x(isParamValid("thermal_conductivity_x") ? getParam<Real>("thermal_conductivity_x") : -1),
  _my_thermal_conductivity_y(isParamValid("thermal_conductivity_y") ? getParam<Real>("thermal_conductivity_y") : -1),
  _my_thermal_conductivity_z(isParamValid("thermal_conductivity_z") ? getParam<Real>("thermal_conductivity_z") : -1),

  _thermal_conductivity_x_pp(isParamValid("thermal_conductivity_x_pp") ? &getPostprocessorValue("thermal_conductivity_x_pp") : NULL),
  _thermal_conductivity_y_pp(isParamValid("thermal_conductivity_y_pp") ? &getPostprocessorValue("thermal_conductivity_y_pp") : NULL),
  _thermal_conductivity_z_pp(isParamValid("thermal_conductivity_z_pp") ? &getPostprocessorValue("thermal_conductivity_z_pp") : NULL),

  _my_specific_heat(isParamValid("specific_heat") ? getParam<Real>("specific_heat") : 0),

  _thermal_conductivity_x(&declareProperty<Real>("thermal_conductivity_x")),
  _thermal_conductivity_x_dT(&declareProperty<Real>("thermal_conductivity_x_dT")),
  _thermal_conductivity_y(isParamValid("thermal_conductivity_y") || isParamValid("thermal_conductivity_y_pp") ?
                          &declareProperty<Real>("thermal_conductivity_y") : NULL),
  _thermal_conductivity_y_dT(_thermal_conductivity_y ? &declareProperty<Real>("thermal_conductivity_y_dT") : NULL),
  _thermal_conductivity_z(isParamValid("thermal_conductivity_z") || isParamValid("thermal_conductivity_z_pp") ?
                          &declareProperty<Real>("thermal_conductivity_z") : NULL),
  _thermal_conductivity_z_dT(_thermal_conductivity_z ? &declareProperty<Real>("thermal_conductivity_z_dT") : NULL),

  _specific_heat(declareProperty<Real>("specific_heat")),
  _specific_heat_temperature_function( getParam<FunctionName>("specific_heat_temperature_function") != "" ? &getFunction("specific_heat_temperature_function") : NULL)
{
  bool k_x = isParamValid("thermal_conductivity_x") || (NULL != _thermal_conductivity_x_pp);
  bool k_y = isParamValid("thermal_conductivity_y") || (NULL != _thermal_conductivity_y_pp);
  bool k_z = isParamValid("thermal_conductivity_z") || (NULL != _thermal_conductivity_z_pp);

  if (!k_x ||
      (_subproblem.mesh().dimension() > 1 && !k_y) ||
      (_subproblem.mesh().dimension() > 2 && !k_z))
  {
    mooseError("Incomplete set of orthotropic thermal conductivity parameters");
  }
  if (_specific_heat_temperature_function && !_has_temp)
  {
    mooseError("Must couple with temperature if using specific heat function");
  }
  if (isParamValid("specific_heat") && _specific_heat_temperature_function)
  {
    mooseError("Cannot define both specific heat and specific heat temperature function");
  }

  k_x = isParamValid("thermal_conductivity_x") && (NULL != _thermal_conductivity_x_pp);
  k_y = isParamValid("thermal_conductivity_y") && (NULL != _thermal_conductivity_y_pp);
  k_z = isParamValid("thermal_conductivity_z") && (NULL != _thermal_conductivity_z_pp);
  if (k_x || k_y || k_z)
  {
    mooseError("Cannot define thermal conductivity value and Postprocessor");
  }
}
コード例 #10
0
ファイル: AutoRBTransient.C プロジェクト: jarons/dendragapus
AutoRBTransient::AutoRBTransient(const InputParameters & parameters) :
    Transient(parameters), 
    _new_tol_mult(getParam<Real>("tol_mult")),
    _new_tol(getPostprocessorValue("InitialResidual")),
    _his_final_norm(getPostprocessorValue("FinalResidual")),
    _min_abs_tol(getParam<Real>("nl_abs_tol")),
    _current_norm_old(0)
    //his_initial_norm_old(-1.0)
{
  //*#*//  These changes set _spectral_radius only for the very beginning.
    // Afterwards, it is carried over between timesteps.
    // This did not work well, because solvers don't start out asymptotic
    //   like they finish.
  //*#*//_spectral_radius = pow(_new_tol_mult, 0.5);
}
コード例 #11
0
EvaporationFunction::EvaporationFunction(const std::string & name, InputParameters parameters) :
      Function(name, parameters),
/*
   _k_cond(getMaterialProperty<Real>("k_cond")),
   _HBO2(coupledValue("HBO2")),
   _rho_h2o(getMaterialProperty<Real>("WaterDensity")),
   _h_fg_h2o(getMaterialProperty<Real>("WaterVaporizationEnthalpy")),
  _grad_T(coupledGradient("temperature")),
*/
  _pp(getPostprocessorValue("PP")),
    _HypoTurningPoint(getParam<Real>("HypoTurningPoint")),
    _UsingHypo(getParam<Real>("UsingHypo")),
 // _turningpoint(getParam<Real>("TurningPoint"))
  _turningpoint(getPostprocessorValue("TurningPoint"))
{}
コード例 #12
0
ファイル: NodalFloodCount.C プロジェクト: DarinReid/moose
NodalFloodCount::NodalFloodCount(const std::string & name, InputParameters parameters) :
    GeneralPostprocessor(name, parameters),
    Coupleable(parameters, false),
    MooseVariableDependencyInterface(),
    ZeroInterface(parameters),
    _vars(getCoupledMooseVars()),
    _threshold(getParam<Real>("threshold")),
    _connecting_threshold(isParamValid("connecting_threshold") ? getParam<Real>("connecting_threshold") : getParam<Real>("threshold")),
    _mesh(_subproblem.mesh()),
    _var_number(_vars[0]->number()),
    _single_map_mode(getParam<bool>("use_single_map")),
    _condense_map_info(getParam<bool>("condense_map_info")),
    _global_numbering(getParam<bool>("use_global_numbering")),
    _var_index_mode(getParam<bool>("enable_var_coloring")),
    _maps_size(_single_map_mode ? 1 : _vars.size()),
    _pbs(NULL),
    _element_average_value(parameters.isParamValid("elem_avg_value") ? getPostprocessorValue("elem_avg_value") : _real_zero),
    _track_memory(getParam<bool>("track_memory_usage"))
    // _bubble_volume_file_name(parameters.isParamValid("bubble_volume_file") ? getParam<FileName>("bubble_volume_file") : "")
{
  // Size the data structures to hold the correct number of maps
  _bubble_maps.resize(_maps_size);
  _bubble_sets.resize(_maps_size);
  _region_counts.resize(_maps_size);
  _region_offsets.resize(_maps_size);

  if (_var_index_mode)
    _var_index_maps.resize(_maps_size);

  // This map is always size to the number of variables
  _nodes_visited.resize(_vars.size());
}
コード例 #13
0
ファイル: BodyForce.C プロジェクト: JasonTurner56/ARL
BodyForce::BodyForce(const InputParameters & parameters) :
    Kernel(parameters),
    _value(getParam<Real>("value")),
    _function(getFunction("function")),
    _postprocessor(parameters.isParamValid("postprocessor") ? &getPostprocessorValue("postprocessor") : NULL)
{
}
コード例 #14
0
CumulativeValuePostprocessor::CumulativeValuePostprocessor(const InputParameters & parameters) :
    GeneralPostprocessor(parameters),
    _sum(0.0),
    _sum_old(getPostprocessorValueOldByName(name())),
    _pps_value(getPostprocessorValue("postprocessor"))
{
}
コード例 #15
0
// DEPRECATED CONSTRUCTOR
FeatureFloodCount::FeatureFloodCount(const std::string & deprecated_name, InputParameters parameters) :
    GeneralPostprocessor(deprecated_name, parameters),
    Coupleable(parameters, false),
    MooseVariableDependencyInterface(),
    ZeroInterface(parameters),
    _vars(getCoupledMooseVars()),
    _threshold(getParam<Real>("threshold")),
    _connecting_threshold(isParamValid("connecting_threshold") ? getParam<Real>("connecting_threshold") : getParam<Real>("threshold")),
    _mesh(_subproblem.mesh()),
    _var_number(_vars[0]->number()),
    _single_map_mode(getParam<bool>("use_single_map")),
    _condense_map_info(getParam<bool>("condense_map_info")),
    _global_numbering(getParam<bool>("use_global_numbering")),
    _var_index_mode(getParam<bool>("enable_var_coloring")),
    _use_less_than_threshold_comparison(getParam<bool>("use_less_than_threshold_comparison")),
    _maps_size(_single_map_mode ? 1 : _vars.size()),
    _pbs(NULL),
    _element_average_value(parameters.isParamValid("elem_avg_value") ? getPostprocessorValue("elem_avg_value") : _real_zero),
    _track_memory(getParam<bool>("track_memory_usage")),
    _compute_boundary_intersecting_volume(getParam<bool>("compute_boundary_intersecting_volume")),
    _is_elemental(getParam<MooseEnum>("flood_entity_type") == "ELEMENTAL" ? true : false)
{
  // Size the data structures to hold the correct number of maps
  _bubble_maps.resize(_maps_size);
  _bubble_sets.resize(_maps_size);
  _region_counts.resize(_maps_size);
  _region_offsets.resize(_maps_size);

  if (_var_index_mode)
    _var_index_maps.resize(_maps_size);

  // This map is always size to the number of variables
  _entities_visited.resize(_vars.size());
}
コード例 #16
0
ファイル: FeatureFloodCount.C プロジェクト: ivance00/moose
FeatureFloodCount::FeatureFloodCount(const InputParameters & parameters) :
    GeneralPostprocessor(parameters),
    Coupleable(this, false),
    MooseVariableDependencyInterface(),
    ZeroInterface(parameters),
    _vars(getCoupledMooseVars()),
    _threshold(getParam<Real>("threshold")),
    _connecting_threshold(isParamValid("connecting_threshold") ? getParam<Real>("connecting_threshold") : getParam<Real>("threshold")),
    _mesh(_subproblem.mesh()),
    _var_number(_vars[0]->number()),
    _single_map_mode(getParam<bool>("use_single_map")),
    _condense_map_info(getParam<bool>("condense_map_info")),
    _global_numbering(getParam<bool>("use_global_numbering")),
    _var_index_mode(getParam<bool>("enable_var_coloring")),
    _use_less_than_threshold_comparison(getParam<bool>("use_less_than_threshold_comparison")),
    _n_vars(_vars.size()),
    _maps_size(_single_map_mode ? 1 : _vars.size()),
    _n_procs(_app.n_processors()),
    _entities_visited(_vars.size()), // This map is always sized to the number of variables
    _feature_count(0),
    _partial_feature_sets(_maps_size),
    _feature_sets(_maps_size),
    _feature_maps(_maps_size),
    _pbs(nullptr),
    _element_average_value(parameters.isParamValid("elem_avg_value") ? getPostprocessorValue("elem_avg_value") : _real_zero),
    _halo_ids(_maps_size),
    _compute_boundary_intersecting_volume(getParam<bool>("compute_boundary_intersecting_volume")),
    _is_elemental(getParam<MooseEnum>("flood_entity_type") == "ELEMENTAL" ? true : false)
{
  if (_var_index_mode)
    _var_index_maps.resize(_maps_size);
}
コード例 #17
0
ファイル: PLC_LSH.C プロジェクト: Liuux/moose
PLC_LSH::PLC_LSH( const InputParameters & parameters)
  :SolidModel(parameters),
   _coefficient(parameters.get<Real>("coefficient")),
   _n_exponent(parameters.get<Real>("n_exponent")),
   _m_exponent(parameters.get<Real>("m_exponent")),
   _activation_energy(parameters.get<Real>("activation_energy")),
   _gas_constant(parameters.get<Real>("gas_constant")),

   _yield_stress(parameters.get<Real>("yield_stress")),
   _hardening_constant(parameters.get<Real>("hardening_constant")),

   _max_its(parameters.get<unsigned int>("max_its")),
   _output_iteration_info(getParam<bool>("output_iteration_info")),
   _relative_tolerance(parameters.get<Real>("relative_tolerance")),
   _absolute_tolerance(parameters.get<Real>("absolute_tolerance")),

   _absolute_stress_tolerance(parameters.get<Real>("absolute_stress_tolerance")),

   _creep_strain(declareProperty<SymmTensor>("creep_strain")),
   _creep_strain_old(declarePropertyOld<SymmTensor>("creep_strain")),

   _plastic_strain(declareProperty<SymmTensor>("plastic_strain")),
   _plastic_strain_old(declarePropertyOld<SymmTensor>("plastic_strain")),

   _hardening_variable(declareProperty<Real>("hardening_variable")),
   _hardening_variable_old(declarePropertyOld<Real>("hardening_variable")),

   _output( getParam<PostprocessorName>("output") != "" ? &getPostprocessorValue("output") : NULL )

{
  if (_yield_stress <= 0)
  {
    mooseError("Yield stress must be greater than zero");
  }
}
コード例 #18
0
ファイル: MacroElastic.C プロジェクト: raghavaggarwal/moose
MacroElastic::MacroElastic( const InputParameters & parameters)
  :Elastic(parameters),
   _C1111(getPostprocessorValue("C1111")),
   _C1122(getPostprocessorValue("C1122")),
   _C1133(getPostprocessorValue("C1133")),
   _C2222(getPostprocessorValue("C2222")),
   _C2233(getPostprocessorValue("C2233")),
   _C3333(getPostprocessorValue("C3333")),
   _C1212(getPostprocessorValue("C1212")),
   _C2323(getPostprocessorValue("C2323")),
   _C3131(getPostprocessorValue("C3131"))
{
}
コード例 #19
0
ファイル: MacroElastic.C プロジェクト: raghavaggarwal/moose
// DEPRECATED CONSTRUCTOR
MacroElastic::MacroElastic(const std::string & deprecated_name, InputParameters parameters)
  :Elastic(deprecated_name, parameters),
   _C1111(getPostprocessorValue("C1111")),
   _C1122(getPostprocessorValue("C1122")),
   _C1133(getPostprocessorValue("C1133")),
   _C2222(getPostprocessorValue("C2222")),
   _C2233(getPostprocessorValue("C2233")),
   _C3333(getPostprocessorValue("C3333")),
   _C1212(getPostprocessorValue("C1212")),
   _C2323(getPostprocessorValue("C2323")),
   _C3131(getPostprocessorValue("C3131"))
{
}
コード例 #20
0
DefaultPostprocessorDiffusion::DefaultPostprocessorDiffusion(const std::string & name, InputParameters parameters) :
    Kernel(name, parameters),
    _pps_value(getPostprocessorValue("pps_name"))
{
  // Test the error message for defaultPostprocessorValue
  if (getParam<bool>("test_default_error"))
    parameters.defaultPostprocessorValue("invalid_postprocessor_name");
}
コード例 #21
0
MaterialDiracSinkKernel::MaterialDiracSinkKernel(const InputParameters & parameters) :
    DiracKernel(parameters),
    _diffusivity(getMaterialProperty<Real>("diffusivity_name")),
    _sink_strength(getMaterialProperty<Real>("sink_strength")),
    _point(getParam<Point>("point")),
    _volume(getPostprocessorValue("volume_pps"))
{
}
コード例 #22
0
TotalVariableValue::TotalVariableValue(const InputParameters & parameters) :
    GeneralPostprocessor(parameters),
    _value(0),
    _value_old(getPostprocessorValueOldByName(name())),
    _pps_value(getPostprocessorValue("value")),
    _pps_value_old(getPostprocessorValueOld("value"))
{
}
コード例 #23
0
// DEPRECATED CONSTRUCTOR
TotalVariableValue::TotalVariableValue(const std::string & deprecated_name, InputParameters parameters) :
    GeneralPostprocessor(deprecated_name, parameters),
    _value(0),
    _value_old(getPostprocessorValueOldByName(name())),
    _pps_value(getPostprocessorValue("value")),
    _pps_value_old(getPostprocessorValueOld("value"))
{
}
コード例 #24
0
ファイル: PostprocessorDT.C プロジェクト: AhmedAly83/moose
PostprocessorDT::PostprocessorDT(const InputParameters & parameters) :
    TimeStepper(parameters),
    PostprocessorInterface(parameters),
    _pps_value(getPostprocessorValue("postprocessor")),
    _has_initial_dt(isParamValid("dt")),
    _initial_dt(_has_initial_dt ? getParam<Real>("dt") : 0.)
{
}
コード例 #25
0
ファイル: FeatureVolumeFraction.C プロジェクト: gnsteve/moose
FeatureVolumeFraction::FeatureVolumeFraction(const InputParameters & parameters) :
    GeneralPostprocessor(parameters),
    _value_type(getParam<MooseEnum>("value_type").getEnum<ValueType>()),
    _mesh_volume(getPostprocessorValue("mesh_volume")),
    _feature_volumes(getVectorPostprocessorValue("feature_volumes", "feature_volumes")),
    _equil_fraction(getParam<Real>("equil_fraction")),
    _avrami_value(0)
{
}
コード例 #26
0
ファイル: Pressure.C プロジェクト: LSchoensee/moose
Pressure::Pressure(const InputParameters & parameters)
  :IntegratedBC(parameters),
   _component(getParam<unsigned int>("component")),
   _factor(getParam<Real>("factor")),
   _function( isParamValid("function") ? &getFunction("function") : NULL ),
   _postprocessor( isParamValid("postprocessor") ? &getPostprocessorValue("postprocessor") : NULL )
{
  if (_component > 2)
    mooseError( "Invalid component given for " << name() << ": " << _component << "." << std::endl );
}
コード例 #27
0
ファイル: FeatureVolumeFraction.C プロジェクト: Liuux/moose
FeatureVolumeFraction::FeatureVolumeFraction(const InputParameters & parameters) :
    FeatureFloodCount(parameters),
    _mesh_volume(getPostprocessorValue("mesh_volume")),
    _equil_fraction(getParam<Real>("equil_fraction"))
{
  if (parameters.isParamValid("Avrami_file") && _equil_fraction < 0.0)
    mooseError("please supply an equilibrium fraction of 2nd phase for Avrami analysis (FeatureVolumeFraction).");

  if (!_is_elemental)
    mooseError("FeatureVolumeFraction only calculates volumes when flood_entity_type = ELEMENTAL.");
}
コード例 #28
0
ファイル: ConditionLeftTemp.C プロジェクト: aeslaughter/mamba
ConditionLeftTemp::ConditionLeftTemp(const std::string & name, InputParameters parameters)
 :NodalBC(name, parameters),
   //_coupledvar(coupledValue("anotherVar")),
   _coef1(getParam<Real>("coef1")),
    _HypoTurningPoint(getParam<Real>("HypoTurningPoint")),
    _UsingHypo(getParam<Real>("UsingHypo")),
  // _pp(getPostprocessorValue("PP")),
   _const(getParam<Real>("constval")),
   _turningpoint(getPostprocessorValue("TurningPoint"))
 //  _turningpoint(getParam<Real>("TurningPoint"))
{}
コード例 #29
0
IterationAdaptiveDT::IterationAdaptiveDT(const InputParameters & parameters)
  : TimeStepper(parameters),
    PostprocessorInterface(this),
    _dt_old(declareRestartableData<Real>("dt_old", 0.0)),
    _input_dt(getParam<Real>("dt")),
    _tfunc_last_step(declareRestartableData<bool>("tfunc_last_step", false)),
    _sync_last_step(declareRestartableData<bool>("sync_last_step", false)),
    _linear_iteration_ratio(isParamValid("linear_iteration_ratio")
                                ? getParam<unsigned>("linear_iteration_ratio")
                                : 25), // Default to 25
    _adaptive_timestepping(false),
    _pps_value(isParamValid("postprocessor_dtlim") ? &getPostprocessorValue("postprocessor_dtlim")
                                                   : NULL),
    _timestep_limiting_function(NULL),
    _piecewise_timestep_limiting_function(NULL),
    _times(0),
    _max_function_change(-1),
    _force_step_every_function_point(getParam<bool>("force_step_every_function_point")),
    _tfunc_times(getParam<std::vector<Real>>("time_t").begin(),
                 getParam<std::vector<Real>>("time_t").end()),
    _time_ipol(getParam<std::vector<Real>>("time_t"), getParam<std::vector<Real>>("time_dt")),
    _use_time_ipol(_time_ipol.getSampleSize() > 0),
    _growth_factor(getParam<Real>("growth_factor")),
    _cutback_factor(getParam<Real>("cutback_factor")),
    _nl_its(declareRestartableData<unsigned int>("nl_its", 0)),
    _l_its(declareRestartableData<unsigned int>("l_its", 0)),
    _cutback_occurred(declareRestartableData<bool>("cutback_occurred", false)),
    _at_function_point(false)
{
  if (isParamValid("optimal_iterations"))
  {
    _adaptive_timestepping = true;
    _optimal_iterations = getParam<int>("optimal_iterations");

    if (isParamValid("iteration_window"))
      _iteration_window = getParam<int>("iteration_window");
    else
      _iteration_window = ceil(_optimal_iterations / 5.0);
  }
  else
  {
    if (isParamValid("iteration_window"))
      mooseError("'optimal_iterations' must be used for 'iteration_window' to be used");
    if (isParamValid("linear_iteration_ratio"))
      mooseError("'optimal_iterations' must be used for 'linear_iteration_ratio' to be used");
  }

  if (isParamValid("timestep_limiting_function"))
    _max_function_change =
        isParamValid("max_function_change") ? getParam<Real>("max_function_change") : -1;
  else if (isParamValid("max_function_change"))
    mooseError("'timestep_limiting_function' must be used for 'max_function_change' to be used");
}
コード例 #30
0
ファイル: EelCMethod.C プロジェクト: delcmo/eel2d
Real EelCMethod::computeQpResidual()
{
    // Initialize some variables:
    Real _hmax = _current_elem->hmax();
    // pps:
    //std::cout<<_max_grad_press_pps_name<<std::endl;
    Real _Smax = getPostprocessorValue(_max_eig_pps_name);
    Real _gradP_max = getPostprocessorValue(_max_grad_press_pps_name);
    //std::cout << "kernel gradP_max=" << _gradP_max << std::endl;
    if (std::fabs(_gradP_max) < 1e-10)
        _gradP_max = 1.;
    //std::cout << "kernel gradP_max=" << _gradP_max << std::endl;
    // Compute the norm of grad(pressure):
    Real _norm_grad_press2 = _grad_press[_qp](0)*_grad_press[_qp](0); // + _grad_press[_qp](1)*_grad_press[_qp](1) + _grad_press[_qp](2)*_grad_press[_qp](2);
    //std::cout<<"kernel gradP="<<std::sqrt(_norm_grad_press2)<<std::endl;
    // Compute source term:
    Real _source = _Smax * std::fabs(_grad_press[_qp](0)) / _gradP_max;
    //std::cout << _Smax << std::endl;
    //std::cout << std::fabs(_grad_press[_qp](0)) / _gradP_max << std::endl;
    /// Returns the residual
    return (_Smax*_u[_qp]/_hmax - _source)*_test[_i][_qp] + _Smax*_hmax*_kappa*_grad_u[_qp](0)*_grad_test[_i][_qp](0);
}