PropertyUserObjectInterface::PropertyUserObjectInterface(const InputParameters & parameters) :
    _problem_ptr(parameters.getCheckedPointerParam<FEProblem *>("_fe_problem")),
    _property_uo(parameters.isParamValid("property_user_object") ?
                 _problem_ptr->getUserObject<PropertyUserObject>(parameters.get<UserObjectName>("property_user_object")) :
                 _problem_ptr->getUserObject<PropertyUserObject>("_pika_property_user_object"))
{
}
Exemple #2
0
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);
}
Exemple #3
0
std::set<SubdomainID>
BlockRestrictable::variableSubdomainIDs(const InputParameters & parameters) const
{
  // Return an empty set if _sys is not defined
  if (!parameters.isParamValid("_sys"))
    return std::set<SubdomainID>();

  // Get the SystemBase and the thread id
  SystemBase* sys = parameters.get<SystemBase *>("_sys");
  THREAD_ID tid = parameters.get<THREAD_ID>("_tid");

  // Pointer to MooseVariable
  MooseVariable * var = NULL;

  // Get the variable based on the type
  if (parameters.have_parameter<NonlinearVariableName>("variable"))
    var = &_blk_feproblem->getVariable(tid, parameters.get<NonlinearVariableName>("variable"));
  else if (parameters.have_parameter<AuxVariableName>("variable"))
    var = &_blk_feproblem->getVariable(tid, parameters.get<AuxVariableName>("variable"));
  else
    mooseError("Unknown variable.");

  // Return the block ids for the variable
  return sys->getSubdomainsForVar(var->number());
}
FiniteStrainPlasticBase::FiniteStrainPlasticBase(const std::string & name,
                                                         InputParameters parameters) :
    FiniteStrainMaterial(name, parameters),
    _max_iter(getParam<unsigned int>("max_NR_iterations")),
    _max_subdivisions(getParam<unsigned int>("max_subdivisions")),
    _f_tol(getParam<std::vector<Real> >("yield_function_tolerance")),
    _ic_tol(parameters.isParamValid("internal_constraint_tolerance") ? getParam<std::vector<Real> >("internal_constraint_tolerance") : std::vector<Real>(0)),
    _epp_tol(getParam<Real>("ep_plastic_tolerance")),

    _fspb_debug(getParam<int>("debug_fspb")),
    _fspb_debug_stress(getParam<RealTensorValue>("debug_jac_at_stress")),
    _fspb_debug_pm(getParam<std::vector<Real> >("debug_jac_at_pm")),
    _fspb_debug_intnl(getParam<std::vector<Real> >("debug_jac_at_intnl")),
    _fspb_debug_stress_change(getParam<Real>("debug_stress_change")),
    _fspb_debug_pm_change(getParam<std::vector<Real> >("debug_pm_change")),
    _fspb_debug_intnl_change(getParam<std::vector<Real> >("debug_intnl_change")),

    _plastic_strain(declareProperty<RankTwoTensor>("plastic_strain")),
    _plastic_strain_old(declarePropertyOld<RankTwoTensor>("plastic_strain")),
    _intnl(declareProperty<std::vector<Real> >("plastic_internal_parameter")),
    _intnl_old(declarePropertyOld<std::vector<Real> >("plastic_internal_parameter")),
    _f(declareProperty<std::vector<Real> >("plastic_yield_function")),
    _iter(declareProperty<unsigned int>("plastic_NR_iterations"))
{
}
SolidMechImplicitEuler::SolidMechImplicitEuler(const InputParameters & parameters)
  : SecondDerivativeImplicitEuler(parameters),
    _density(getMaterialProperty<Real>("density")),
    _artificial_scaling_set(parameters.isParamValid("artificial_scaling")),
    _artificial_scaling(_artificial_scaling_set ? getParam<Real>("artificial_scaling") : 1)
{
}
// 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());
}
Exemple #7
0
Restartable::Restartable(const InputParameters & parameters,
                         std::string system_name,
                         SubProblem * subproblem)
  : _restartable_name(parameters.get<std::string>("_object_name")),
    _restartable_params(&parameters),
    _restartable_system_name(system_name),
    _restartable_tid(parameters.isParamValid("_tid") ? parameters.get<THREAD_ID>("_tid") : 0)
{
  _restartable_subproblem = parameters.isParamValid("_subproblem")
                                ? parameters.get<SubProblem *>("_subproblem")
                                : (parameters.isParamValid("_fe_problem_base")
                                       ? parameters.get<FEProblemBase *>("_fe_problem_base")
                                       : (parameters.isParamValid("_fe_problem")
                                              ? parameters.get<FEProblem *>("_fe_problem")
                                              : subproblem));
}
void
MaterialPropertyInterface::initializeMaterialPropertyInterface(const InputParameters & parameters)
{
  /* AuxKernels may be boundary or block restricted; however, they are built by the same action and task, add_aux_kernel.
     The type of material data that should be stored in the interface is not known until the object is constructed. Thus,
     the private parameter, '_material_data', cannot be set prior to the object creation. To enable the proper
     construction of AuxKernels a secondary, construction time method for setting the _material_data pointer in this interface
     exists. */

  // If the _material_data parameter exists, use it
  if (parameters.isParamValid("_material_data"))
    _material_data = parameters.get<MaterialData *>("_material_data");

  // If the _material_data parameter does not exist, figure it out based on the _block_ids and _boundary_ids parameters
  else
  {
    THREAD_ID tid = parameters.get<THREAD_ID>("_tid");

    // Utilize boundary material if (1) _mi_boundary_ids is not empty and (2) it does not contain ANY_BOUNDARY_ID
    if (!_mi_boundary_ids.empty() && std::find(_mi_boundary_ids.begin(), _mi_boundary_ids.end(), Moose::ANY_BOUNDARY_ID) == _mi_boundary_ids.end())
      _material_data = _mi_feproblem.getBoundaryMaterialData(tid);
    else
      _material_data = _mi_feproblem.getMaterialData(tid);
  }
}
Exemple #9
0
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());
}
BoundaryRestrictable::BoundaryRestrictable(const std::string name, InputParameters & parameters) :
    _bnd_feproblem(parameters.isParamValid("_fe_problem") ?
                   parameters.get<FEProblem *>("_fe_problem") : NULL),
    _bnd_mesh(parameters.isParamValid("_mesh") ?
              parameters.get<MooseMesh *>("_mesh") : NULL),
    _boundary_names(parameters.get<std::vector<BoundaryName> >("boundary")),
    _bnd_dual_restrictable(parameters.get<bool>("_dual_restrictable")),
    _invalid_boundary_id(Moose::INVALID_BOUNDARY_ID),
    _boundary_restricted(false),
    _current_boundary_id(_bnd_feproblem == NULL ? _invalid_boundary_id : _bnd_feproblem->getCurrentBoundaryID())
{

  // If the mesh pointer is not defined, but FEProblem is, get it from there
  if (_bnd_feproblem != NULL && _bnd_mesh == NULL)
    _bnd_mesh = &_bnd_feproblem->mesh();

  // Check that the mesh pointer was defined, it is required for this class to operate
  if (_bnd_mesh == NULL)
    mooseError("The input parameters must contain a pointer to FEProblem via '_fe_problem' or a pointer to the MooseMesh via '_mesh'");

  // If the user supplies boundary IDs
  if (!_boundary_names.empty())
  {
    std::vector<BoundaryID> ids = _bnd_mesh->getBoundaryIDs(_boundary_names, true);
    _bnd_ids.insert(ids.begin(), ids.end());
  }

  // Produce error if the object is not allowed to be both block and boundary restrictable
  if (!_bnd_dual_restrictable && !_bnd_ids.empty() && parameters.isParamValid("_block_ids"))
  {
    std::vector<SubdomainID> blk_ids = parameters.get<std::vector<SubdomainID> >("_block_ids");
    if (!blk_ids.empty() && blk_ids[0] != Moose::ANY_BLOCK_ID)
      mooseError("Attempted to restrict the object '" << name << "' to a boundary, but the object is already restricted by block(s)");
  }

  // Store ANY_BOUNDARY_ID if empty
  if (_bnd_ids.empty())
  {
    _bnd_ids.insert(Moose::ANY_BOUNDARY_ID);
    _boundary_names = std::vector<BoundaryName>(1, "ANY_BOUNDARY_ID");
  }
  else
    _boundary_restricted = true;

  // Store the ids in the input parameters
  parameters.set<std::vector<BoundaryID> >("_boundary_ids") = std::vector<BoundaryID>(_bnd_ids.begin(), _bnd_ids.end());
}
// DEPRECATED CONSTRUCTOR
TensorMechanicsHardeningGaussian::TensorMechanicsHardeningGaussian(const std::string & deprecated_name, InputParameters parameters) :
  TensorMechanicsHardeningModel(deprecated_name, parameters),
  _val_0(getParam<Real>("value_0")),
  _val_res(parameters.isParamValid("value_residual") ? getParam<Real>("value_residual") : _val_0),
  _intnl_0(getParam<Real>("internal_0")),
  _rate(getParam<Real>("rate"))
{
}
TensorMechanicsHardeningCutExponential::TensorMechanicsHardeningCutExponential(const std::string & name, InputParameters parameters) :
  TensorMechanicsHardeningModel(name, parameters),
  _val_0(getParam<Real>("value_0")),
  _val_res(parameters.isParamValid("value_residual") ? getParam<Real>("value_residual") : _val_0),
  _intnl_0(getParam<Real>("internal_0")),
  _rate(getParam<Real>("rate"))
{
}
TensorMechanicsHardeningExponential::TensorMechanicsHardeningExponential(
    const InputParameters & parameters)
  : TensorMechanicsHardeningModel(parameters),
    _val_0(getParam<Real>("value_0")),
    _val_res(parameters.isParamValid("value_residual") ? getParam<Real>("value_residual") : _val_0),
    _rate(getParam<Real>("rate"))
{
}
ReferenceResidualProblem::ReferenceResidualProblem(const InputParameters & params) :
    FEProblem(params)
{
  if (params.isParamValid("solution_variables"))
    _solnVarNames = params.get<std::vector<std::string> >("solution_variables");
  if (params.isParamValid("reference_residual_variables"))
    _refResidVarNames = params.get<std::vector<std::string> >("reference_residual_variables");
  if (_solnVarNames.size() != _refResidVarNames.size())
    mooseError("In ReferenceResidualProblem, size of solution_variables (" \
               << _solnVarNames.size() \
               << ") != size of reference_residual_variables (" \
               << _refResidVarNames.size() \
               << ")");

  _accept_mult = params.get<Real>("acceptable_multiplier");
  _accept_iters = params.get<int>("acceptable_iterations");
}
TensorMechanicsHardeningGaussian::TensorMechanicsHardeningGaussian(const InputParameters & parameters) :
  TensorMechanicsHardeningModel(parameters),
  _val_0(getParam<Real>("value_0")),
  _val_res(parameters.isParamValid("value_residual") ? getParam<Real>("value_residual") : _val_0),
  _intnl_0(getParam<Real>("internal_0")),
  _rate(getParam<Real>("rate"))
{
}
Exemple #16
0
ContactMaster::ContactMaster(const std::string & name, InputParameters parameters) :
  DiracKernel(name, parameters),
  _component(getParam<unsigned int>("component")),
  _model(contactModel(getParam<std::string>("model"))),
  _formulation(contactFormulation(getParam<std::string>("formulation"))),
  _normalize_penalty(getParam<bool>("normalize_penalty")),
  _penetration_locator(getPenetrationLocator(getParam<BoundaryName>("boundary"), getParam<BoundaryName>("slave"), Utility::string_to_enum<Order>(getParam<MooseEnum>("order")))),
  _penalty(getParam<Real>("penalty")),
  _friction_coefficient(getParam<Real>("friction_coefficient")),
  _tension_release(getParam<Real>("tension_release")),
  _updateContactSet(true),
  _time_last_called(-std::numeric_limits<Real>::max()),
  _residual_copy(_sys.residualGhosted()),
  _x_var(isCoupled("disp_x") ? coupled("disp_x") : 99999),
  _y_var(isCoupled("disp_y") ? coupled("disp_y") : 99999),
  _z_var(isCoupled("disp_z") ? coupled("disp_z") : 99999),
  _mesh_dimension(_mesh.dimension()),
  _vars(_x_var, _y_var, _z_var),
  _nodal_area_var(getVar("nodal_area", 0)),
  _aux_system( _nodal_area_var->sys() ),
  _aux_solution( _aux_system.currentSolution() )

{
  if (parameters.isParamValid("tangential_tolerance"))
  {
    _penetration_locator.setTangentialTolerance(getParam<Real>("tangential_tolerance"));
  }
  if (parameters.isParamValid("normal_smoothing_distance"))
  {
    _penetration_locator.setNormalSmoothingDistance(getParam<Real>("normal_smoothing_distance"));
  }
  if (parameters.isParamValid("normal_smoothing_method"))
  {
    _penetration_locator.setNormalSmoothingMethod(parameters.get<std::string>("normal_smoothing_method"));
  }
  if (_model == CM_GLUED ||
      (_model == CM_COULOMB && _formulation == CF_DEFAULT))
  {
    _penetration_locator.setUpdate(false);
  }
  if (_friction_coefficient < 0)
  {
    mooseError("The friction coefficient must be nonnegative");
  }
}
Exemple #17
0
VectorPostprocessor::VectorPostprocessor(const InputParameters & parameters)
  : OutputInterface(parameters),
    _vpp_name(MooseUtils::shortName(parameters.get<std::string>("_object_name"))),
    _vpp_fe_problem(parameters.getCheckedPointerParam<FEProblemBase *>("_fe_problem_base")),
    _vpp_tid(parameters.isParamValid("_tid") ? parameters.get<THREAD_ID>("_tid") : 0),
    _contains_complete_history(parameters.get<bool>("contains_complete_history")),
    _is_broadcast(parameters.get<bool>("_is_broadcast"))
{
}
Exemple #18
0
TensorMechanicsPlasticTensile::TensorMechanicsPlasticTensile(const std::string & name,
                                                         InputParameters parameters) :
    TensorMechanicsPlasticModel(name, parameters),
    _tensile_strength0(getParam<Real>("tensile_strength")),
    _tensile_strength_residual(parameters.isParamValid("tensile_strength_residual") ? getParam<Real>("tensile_strength_residual") : _tensile_strength0),
    _tensile_strength_rate(getParam<Real>("tensile_strength_rate")),
    _small_smoother2(std::pow(getParam<Real>("tensile_tip_smoother"), 2)),
    _tt(getParam<Real>("tensile_edge_smoother")*M_PI/180.0),
    _sin3tt(std::sin(3*_tt)),
    _lode_cutoff(parameters.isParamValid("tensile_lode_cutoff") ? getParam<Real>("tensile_lode_cutoff") : 1.0E-5*std::pow(_f_tol, 2))

{
  if (_lode_cutoff < 0)
    mooseError("tensile_lode_cutoff must not be negative");
  _ccc = (-std::cos(3*_tt)*(std::cos(_tt) - std::sin(_tt)/std::sqrt(3.0)) - 3*std::sin(3*_tt)*(std::sin(_tt) + std::cos(_tt)/std::sqrt(3.0)))/(18*std::pow(std::cos(3*_tt), 3));
  _bbb = (std::sin(6*_tt)*(std::cos(_tt) - std::sin(_tt)/std::sqrt(3.0)) - 6*std::cos(6*_tt)*(std::sin(_tt) + std::cos(_tt)/std::sqrt(3.0)))/(18*std::pow(std::cos(3*_tt), 3));
  _aaa = -std::sin(_tt)/std::sqrt(3.0) - _bbb*std::sin(3*_tt) - _ccc*std::pow(std::sin(3*_tt), 2) + std::cos(_tt);
}
Exemple #19
0
PlenumPressureAction::PlenumPressureAction(const std::string & name, InputParameters params) :
  Action(name, params),
  _boundary(getParam<std::vector<BoundaryName> >("boundary")),
  _disp_x(getParam<NonlinearVariableName>("disp_x")),
  _disp_y(getParam<NonlinearVariableName>("disp_y")),
  _disp_z(getParam<NonlinearVariableName>("disp_z")),

  _kernel_name("Pressure"),
  _use_displaced_mesh(true)
{
  _save_in_vars.push_back(getParam<std::vector<AuxVariableName> >("save_in_disp_x"));
  _save_in_vars.push_back(getParam<std::vector<AuxVariableName> >("save_in_disp_y"));
  _save_in_vars.push_back(getParam<std::vector<AuxVariableName> >("save_in_disp_z"));

  _has_save_in_vars.push_back(params.isParamValid("save_in_disp_x"));
  _has_save_in_vars.push_back(params.isParamValid("save_in_disp_y"));
  _has_save_in_vars.push_back(params.isParamValid("save_in_disp_z"));
}
FunctionParserUtils::FunctionParserUtils(const InputParameters & parameters)
  : _enable_jit(parameters.isParamValid("enable_jit") && parameters.get<bool>("enable_jit")),
    _enable_ad_cache(parameters.get<bool>("enable_ad_cache")),
    _disable_fpoptimizer(parameters.get<bool>("disable_fpoptimizer")),
    _enable_auto_optimize(parameters.get<bool>("enable_auto_optimize") && !_disable_fpoptimizer),
    _fail_on_evalerror(parameters.get<bool>("fail_on_evalerror")),
    _nan(std::numeric_limits<Real>::quiet_NaN())
{
}
// DEPRECATED CONSTRUCTOR
GapHeatPointSourceMaster::GapHeatPointSourceMaster(const std::string & deprecated_name, InputParameters parameters)
  :DiracKernel(deprecated_name, parameters),
   _penetration_locator(getPenetrationLocator(getParam<BoundaryName>("boundary"), getParam<BoundaryName>("slave"), Utility::string_to_enum<Order>(getParam<MooseEnum>("order")))),
   _slave_flux(_sys.getVector("slave_flux"))
{
  if (parameters.isParamValid("tangential_tolerance"))
  {
    _penetration_locator.setTangentialTolerance(getParam<Real>("tangential_tolerance"));
  }
  if (parameters.isParamValid("normal_smoothing_distance"))
  {
    _penetration_locator.setNormalSmoothingDistance(getParam<Real>("normal_smoothing_distance"));
  }
  if (parameters.isParamValid("normal_smoothing_method"))
  {
    _penetration_locator.setNormalSmoothingMethod(parameters.get<std::string>("normal_smoothing_method"));
  }
}
ValueThresholdMarker::ValueThresholdMarker(const InputParameters & parameters)
  : QuadraturePointMarker(parameters),
    _coarsen_set(parameters.isParamValid("coarsen")),
    _coarsen(parameters.get<Real>("coarsen")),
    _refine_set(parameters.isParamValid("refine")),
    _refine(parameters.get<Real>("refine")),

    _invert(parameters.get<bool>("invert")),
    _third_state(getParam<MooseEnum>("third_state").getEnum<MarkerValue>()),

    _u(coupledValue("variable"))
{
  if (_refine_set && _coarsen_set)
  {
    Real diff = _refine - _coarsen;
    if ((diff > 0 && _invert) || (diff < 0 && !_invert))
      mooseError("Invalid combination of refine, coarsen, and invert values specified");
  }
}
Exemple #23
0
PressureAction::PressureAction(const InputParameters & params) :
  Action(params),
  _boundary(getParam<std::vector<BoundaryName> >("boundary")),
  _disp_x(getParam<NonlinearVariableName>("disp_x")),
  _disp_y(getParam<NonlinearVariableName>("disp_y")),
  _disp_z(getParam<NonlinearVariableName>("disp_z")),
  _factor(getParam<Real>("factor")),
  _postprocessor(getParam<PostprocessorName>("postprocessor")),
  _kernel_name("Pressure"),
  _use_displaced_mesh(true)
{
  _save_in_vars.push_back(getParam<std::vector<AuxVariableName> >("save_in_disp_x"));
  _save_in_vars.push_back(getParam<std::vector<AuxVariableName> >("save_in_disp_y"));
  _save_in_vars.push_back(getParam<std::vector<AuxVariableName> >("save_in_disp_z"));

  _has_save_in_vars.push_back(params.isParamValid("save_in_disp_x"));
  _has_save_in_vars.push_back(params.isParamValid("save_in_disp_y"));
  _has_save_in_vars.push_back(params.isParamValid("save_in_disp_z"));
}
Exemple #24
0
InterfaceDiffusion::InterfaceDiffusion(const InputParameters & parameters) :
    InterfaceKernel(parameters),
    _D(getParam<Real>("D")),
    _D_neighbor(getParam<Real>("D_neighbor"))
{
  if (!parameters.isParamValid("boundary"))
  {
    mooseError("In order to use the InterfaceDiffusion dgkernel, you must specify a boundary where it will live.");
  }
}
MechanicalContactConstraint::MechanicalContactConstraint(const InputParameters & parameters) :
    NodeFaceConstraint(parameters),
    _component(getParam<unsigned int>("component")),
    _model(contactModel(getParam<std::string>("model"))),
    _formulation(contactFormulation(getParam<std::string>("formulation"))),
    _normalize_penalty(getParam<bool>("normalize_penalty")),
    _penalty(getParam<Real>("penalty")),
    _friction_coefficient(getParam<Real>("friction_coefficient")),
    _tension_release(getParam<Real>("tension_release")),
    _capture_tolerance(getParam<Real>("capture_tolerance")),
    _update_contact_set(true),
    _residual_copy(_sys.residualGhosted()),
    _x_var(isCoupled("disp_x") ? coupled("disp_x") : libMesh::invalid_uint),
    _y_var(isCoupled("disp_y") ? coupled("disp_y") : libMesh::invalid_uint),
    _z_var(isCoupled("disp_z") ? coupled("disp_z") : libMesh::invalid_uint),
    _mesh_dimension(_mesh.dimension()),
    _vars(_x_var, _y_var, _z_var),
    _nodal_area_var(getVar("nodal_area", 0)),
    _aux_system(_nodal_area_var->sys()),
    _aux_solution(_aux_system.currentSolution()),
    _master_slave_jacobian(getParam<bool>("master_slave_jacobian")),
    _connected_slave_nodes_jacobian(getParam<bool>("connected_slave_nodes_jacobian")),
    _non_displacement_vars_jacobian(getParam<bool>("non_displacement_variables_jacobian"))
{
  _overwrite_slave_residual = false;

  if (parameters.isParamValid("tangential_tolerance"))
    _penetration_locator.setTangentialTolerance(getParam<Real>("tangential_tolerance"));

  if (parameters.isParamValid("normal_smoothing_distance"))
    _penetration_locator.setNormalSmoothingDistance(getParam<Real>("normal_smoothing_distance"));

  if (parameters.isParamValid("normal_smoothing_method"))
    _penetration_locator.setNormalSmoothingMethod(parameters.get<std::string>("normal_smoothing_method"));

  if (_model == CM_GLUED ||
      (_model == CM_COULOMB && _formulation == CF_KINEMATIC))
    _penetration_locator.setUpdate(false);

  if (_friction_coefficient < 0)
    mooseError("The friction coefficient must be nonnegative");
}
Exemple #26
0
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.");
}
Exemple #27
0
GapConductance::GapConductance(const InputParameters & parameters)
  :Material(parameters),
   _appended_property_name( getParam<std::string>("appended_property_name") ),
   _temp(coupledValue("variable")),
   _gap_geometry_params_set(false),
   _gap_geometry_type(GapConductance::PLATE),
   _quadrature(getParam<bool>("quadrature")),
   _gap_temp(0),
   _gap_distance(88888),
   _radius(0),
   _r1(0),
   _r2(0),
   _has_info(false),
   _gap_distance_value(_quadrature ? _zero : coupledValue("gap_distance")),
   _gap_temp_value(_quadrature ? _zero : coupledValue("gap_temp")),
   _gap_conductance(declareProperty<Real>("gap_conductance"+_appended_property_name)),
   _gap_conductance_dT(declareProperty<Real>("gap_conductance"+_appended_property_name+"_dT")),
   _gap_conductivity(getParam<Real>("gap_conductivity")),
   _gap_conductivity_function(isParamValid("gap_conductivity_function") ? &getFunction("gap_conductivity_function") : NULL),
   _gap_conductivity_function_variable(isCoupled("gap_conductivity_function_variable") ? &coupledValue("gap_conductivity_function_variable") : NULL),
   _stefan_boltzmann(getParam<Real>("stefan_boltzmann")),
   _emissivity( getParam<Real>("emissivity_1") != 0 && getParam<Real>("emissivity_2") != 0 ?
                1/getParam<Real>("emissivity_1") + 1/getParam<Real>("emissivity_2") - 1 : 0 ),
   _min_gap(getParam<Real>("min_gap")),
   _max_gap(getParam<Real>("max_gap")),
   _temp_var(_quadrature ? getVar("variable",0) : NULL),
   _penetration_locator(NULL),
   _serialized_solution(_quadrature ? &_temp_var->sys().currentSolution() : NULL),
   _dof_map(_quadrature ? &_temp_var->sys().dofMap() : NULL),
   _warnings(getParam<bool>("warnings"))
{
  if (_quadrature)
  {
    if (!parameters.isParamValid("paired_boundary"))
      mooseError(std::string("No 'paired_boundary' provided for ") + _name);
  }
  else
  {
    if (!isCoupled("gap_distance"))
      mooseError(std::string("No 'gap_distance' provided for ") + _name);

    if (!isCoupled("gap_temp"))
      mooseError(std::string("No 'gap_temp' provided for ") + _name);
  }


  if (_quadrature)
  {
    _penetration_locator = &_subproblem.geomSearchData().getQuadraturePenetrationLocator(parameters.get<BoundaryName>("paired_boundary"),
                                                                                         getParam<std::vector<BoundaryName> >("boundary")[0],
                                                                                         Utility::string_to_enum<Order>(parameters.get<MooseEnum>("order")));
  }

}
TensorMechanicsPlasticTensileCubic::TensorMechanicsPlasticTensileCubic(const std::string & name,
                                                         InputParameters parameters) :
    TensorMechanicsPlasticTensile(name, parameters),
    _tensile_strength0(getParam<Real>("tensile_strength")),
    _tensile_strength_residual(parameters.isParamValid("tensile_strength_residual") ? getParam<Real>("tensile_strength_residual") : _tensile_strength0),
    _tensile_strength_limit(getParam<Real>("tensile_strength_limit")),
    _half_tensile_strength_limit(0.5*_tensile_strength_limit),
    _alpha_tension((_tensile_strength0 - _tensile_strength_residual)/4.0/std::pow(_half_tensile_strength_limit, 3)),
    _beta_tension(-3.0*_alpha_tension*std::pow(_half_tensile_strength_limit, 2))
{
}
ReferenceResidualProblem::ReferenceResidualProblem(const std::string & name, InputParameters params) :
    FEProblem(name, params)
{
  _app.parser().extractParams("Problem", params);
  params.checkParams("Problem");

  if (params.isParamValid("solution_variables"))
    _solnVarNames = params.get<std::vector<std::string> >("solution_variables");
  if (params.isParamValid("reference_residual_variables"))
    _refResidVarNames = params.get<std::vector<std::string> >("reference_residual_variables");
  if (_solnVarNames.size() != _refResidVarNames.size() )
  {
    std::ostringstream err;
    err << "In ReferenceResidualProblem, size of solution_variables ("<<_solnVarNames.size()
        <<") != size of reference_residual_variables ("<<_refResidVarNames.size()<<")";
    mooseError(err.str());
  }
  _accept_mult = params.get<Real>("acceptable_multiplier");
  _accept_iters = params.get<int>("acceptable_iterations");
}
// DEPRECATED CONSTRUCTOR
TensorMechanicsPlasticTensileMulti::TensorMechanicsPlasticTensileMulti(const std::string & deprecated_name, InputParameters parameters) :
    TensorMechanicsPlasticModel(deprecated_name, parameters),
    _strength(getUserObject<TensorMechanicsHardeningModel>("tensile_strength")),
    _shift(parameters.isParamValid("shift") ? getParam<Real>("shift") : _f_tol)
{
  if (_shift < 0)
    mooseError("Value of 'shift' in TensorMechanicsPlasticTensileMulti must not be negative\n");
  if (_shift > _f_tol)
    _console << "WARNING: value of 'shift' in TensorMechanicsPlasticTensileMulti is probably set too high\n";
  MooseRandom::seed(0);
}