コード例 #1
0
InputParameters validParams<MaterialPointSource>()
{
  InputParameters params = validParams<DiracKernel>();
  params.addRequiredParam<Point>("point", "The x,y,z coordinates of the point");
  params.declareControllable("point");
  return params;
}
コード例 #2
0
ファイル: DiracKernel.C プロジェクト: tophmatthews/moose
InputParameters validParams<DiracKernel>()
{
    InputParameters params = validParams<MooseObject>();
    params += validParams<MaterialPropertyInterface>();
    params.addRequiredParam<NonlinearVariableName>("variable",
            "The name of the variable that this kernel operates on");

    params.addParam<bool>("use_displaced_mesh",
                          false,
                          "Whether or not this object should use the displaced mesh for computation. "
                          "Note that in the case this is true but no displacements are provided in "
                          "the Mesh block the undisplaced mesh will still be used.");

    params.addParam<bool>("drop_duplicate_points",
                          true,
                          "By default points added to a DiracKernel are dropped if a point at the same location"
                          "has been added before. If this option is set to false duplicate points are retained"
                          "and contribute to residual and Jacobian.");

    params.addParamNamesToGroup("use_displaced_mesh drop_duplicate_points", "Advanced");

    params.declareControllable("enable");
    params.registerBase("DiracKernel");

    return params;
}
コード例 #3
0
ファイル: AuxKernel.C プロジェクト: AhmedAly83/moose
InputParameters validParams<AuxKernel>()
{
  InputParameters params = validParams<MooseObject>();
  params += validParams<BlockRestrictable>();
  params += validParams<BoundaryRestrictable>();
  params += validParams<RandomInterface>();
  params += validParams<MeshChangedInterface>();
  params += validParams<MaterialPropertyInterface>();

  // Add the SetupInterface parameter, 'execute_on', the default is 'linear'
  params += validParams<SetupInterface>();

  params.addRequiredParam<AuxVariableName>("variable", "The name of the variable that this object applies to");

  params.addParam<bool>("use_displaced_mesh", false, "Whether or not this object should use the displaced mesh for computation.  Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.");
  params.addParamNamesToGroup("use_displaced_mesh", "Advanced");

  // This flag is set to true if the AuxKernel is being used on a boundary
  params.addPrivateParam<bool>("_on_boundary", false);

  params.declareControllable("enable"); // allows Control to enable/disable this type of object
  params.registerBase("AuxKernel");

  return params;
}
コード例 #4
0
ファイル: ConstantFunction.C プロジェクト: zachmprince/moose
InputParameters
validParams<ConstantFunction>()
{
  InputParameters params = validParams<Function>();
  params.addParam<Real>("value", 0.0, "The constant value");
  params.declareControllable("value");
  return params;
}
コード例 #5
0
ファイル: NeumannBC.C プロジェクト: zachmprince/moose
InputParameters
validParams<NeumannBC>()
{
  InputParameters params = validParams<IntegratedBC>();
  params.addParam<Real>("value", 0.0, "The value of the gradient on the boundary.");
  params.declareControllable("value");
  params.addClassDescription("Imposes the integrated boundary condition "
                             "$\\frac{\\partial u}{\\partial n}=h$, "
                             "where $h$ is a constant, controllable value.");
  return params;
}
コード例 #6
0
InputParameters
validParams<PenaltyDirichletBC>()
{
  InputParameters params = validParams<IntegratedBC>();
  params.addRequiredParam<Real>("penalty", "Penalty scalar");
  params.addParam<Real>("value", 0.0, "Boundary value of the variable");
  params.declareControllable("value");
  params.addClassDescription("Enforces a Dirichlet boundary condition "
                             "in a weak sense by penalizing differences between the current "
                             "solution and the Dirichlet data.");
  return params;
}
コード例 #7
0
InputParameters
validParams<IterationAdaptiveDT>()
{
  InputParameters params = validParams<TimeStepper>();
  params.addClassDescription("Adjust the timestep based on the number of iterations");
  params.addParam<int>("optimal_iterations",
                       "The target number of nonlinear iterations for adaptive timestepping");
  params.addParam<int>("iteration_window",
                       "Attempt to grow/shrink timestep if the iteration count "
                       "is below/above 'optimal_iterations plus/minus "
                       "iteration_window' (default = optimal_iterations/5).");
  params.addParam<unsigned>("linear_iteration_ratio",
                            "The ratio of linear to nonlinear iterations "
                            "to determine target linear iterations and "
                            "window for adaptive timestepping (default = "
                            "25)");
  params.addParam<PostprocessorName>("postprocessor_dtlim",
                                     "If specified, the postprocessor value "
                                     "is used as an upper limit for the "
                                     "current time step length");
  params.addParam<FunctionName>("timestep_limiting_function",
                                "A 'PiecewiseBase' type function used to control the timestep by "
                                "limiting the change in the function over a timestep");
  params.addParam<Real>(
      "max_function_change",
      "The absolute value of the maximum change in timestep_limiting_function over a timestep");
  params.addParam<bool>("force_step_every_function_point",
                        false,
                        "Forces the timestepper to take "
                        "a step that is consistent with "
                        "points defined in the function");
  params.addRequiredParam<Real>("dt", "The default timestep size between solves");
  params.addParam<std::vector<Real>>("time_t", "The values of t");
  params.addParam<std::vector<Real>>("time_dt", "The values of dt");
  params.addParam<Real>("growth_factor",
                        2.0,
                        "Factor to apply to timestep if easy convergence (if "
                        "'optimal_iterations' is specified) or if recovering "
                        "from failed solve");
  params.addParam<Real>("cutback_factor",
                        0.5,
                        "Factor to apply to timestep if difficult "
                        "convergence (if 'optimal_iterations' is specified) "
                        "or if solution failed");

  params.declareControllable("growth_factor cutback_factor");

  return params;
}
コード例 #8
0
ファイル: MaterialPointSource.C プロジェクト: FHilty/moose
InputParameters
validParams<MaterialPointSource>()
{
  InputParameters params = validParams<DiracKernel>();
  params.addRequiredParam<Point>("point", "The x,y,z coordinates of the point");
  params.addParam<MaterialPropertyName>(
      "material_prop", "matp", "the name of the material property for the coefficient");

  MooseEnum prop_state("current old older", "current");
  params.addParam<MooseEnum>(
      "prop_state", prop_state, "Declares which property state we should retrieve");

  params.declareControllable("point");
  return params;
}
コード例 #9
0
ファイル: Transfer.C プロジェクト: jwpeterson/moose
InputParameters validParams<Transfer>()
{
    InputParameters params = validParams<MooseObject>();
    params.addParam<bool>("use_displaced_mesh", false, "Whether or not this object should use the displaced mesh for computation.  Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.");
    // Add the SetupInterface parameter, 'execute_on', and set it to a default of 'timestep_begin'
    params += validParams<SetupInterface>();
    params.set<MultiMooseEnum>("execute_on") = "timestep_begin";

    params.registerBase("Transfer");

    params.addParamNamesToGroup("use_displaced_mesh", "Advanced");

    params.declareControllable("enable");
    return params;
}
コード例 #10
0
ファイル: Constraint.C プロジェクト: AhmedAly83/moose
InputParameters validParams<Constraint>()
{
  InputParameters params = validParams<MooseObject>();
  // Add the SetupInterface parameter, 'execute_on', default is 'linear'
  params += validParams<SetupInterface>();

  params.addRequiredParam<NonlinearVariableName>("variable", "The name of the variable that this constraint is applied to.");
  params.addParam<bool>("use_displaced_mesh", false, "Whether or not this object should use the displaced mesh for computation.  Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.");
  params.addParamNamesToGroup("use_displaced_mesh", "Advanced");

  params.declareControllable("enable");
  params.registerBase("Constraint");

  return params;
}
コード例 #11
0
ファイル: BoundaryCondition.C プロジェクト: gnsteve/moose
InputParameters validParams<BoundaryCondition>()
{
  InputParameters params = validParams<MooseObject>();
  params += validParams<TransientInterface>();
  params += validParams<BoundaryRestrictableRequired>();

  params.addRequiredParam<NonlinearVariableName>("variable", "The name of the variable that this boundary condition applies to");
  params.addParam<bool>("use_displaced_mesh", false, "Whether or not this object should use the displaced mesh for computation.  Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.");
  params.addParamNamesToGroup("use_displaced_mesh", "Advanced");

  params.declareControllable("enable");
  params.registerBase("BoundaryCondition");

  return params;
}
コード例 #12
0
ファイル: Output.C プロジェクト: mangerij/moose
InputParameters
validParams<Output>()
{
  // Get the parameters from the parent object
  InputParameters params = validParams<MooseObject>();

  // Displaced Mesh options
  params.addParam<bool>(
      "use_displaced", false, "Enable/disable the use of the displaced mesh for outputting");

  // Output intervals and timing
  params.addParam<unsigned int>(
      "interval", 1, "The interval at which time steps are output to the solution file");
  params.addParam<std::vector<Real>>("sync_times",
                                     "Times at which the output and solution is forced to occur");
  params.addParam<bool>("sync_only", false, "Only export results at sync times");
  params.addParam<Real>("start_time", "Time at which this output object begins to operate");
  params.addParam<Real>("end_time", "Time at which this output object stop operating");
  params.addParam<Real>(
      "time_tolerance", 1e-14, "Time tolerance utilized checking start and end times");

  // Add the 'execute_on' input parameter for users to set
  params.addParam<MultiMooseEnum>("execute_on",
                                  Output::getExecuteOptions("initial timestep_end"),
                                  "Set to "
                                  "(none|initial|linear|nonlinear|timestep_end|timestep_begin|"
                                  "final|failed|custom) to execute only at that moment");

  // Add ability to append to the 'execute_on' list
  params.addParam<MultiMooseEnum>("additional_execute_on",
                                  Output::getExecuteOptions(),
                                  "This list of output flags is added to the existing flags "
                                  "(initial|linear|nonlinear|timestep_end|timestep_begin|final|"
                                  "failed|custom) to execute only at that moment");

  // 'Timing' group
  params.addParamNamesToGroup("time_tolerance interval sync_times sync_only start_time end_time ",
                              "Timing");

  // Add a private parameter for indicating if it was created with short-cut syntax
  params.addPrivateParam<bool>("_built_by_moose", false);

  // Register this class as base class
  params.declareControllable("enable");
  params.registerBase("Output");

  return params;
}
コード例 #13
0
ファイル: InputParametersTest.C プロジェクト: laizy/moose
void
InputParametersTest::checkControlParamValidError()
{
    try
    {
        InputParameters params = emptyInputParameters();
        params.declareControllable("not_valid");
        params.checkParams("");
        CPPUNIT_ASSERT( false ); // shouldn't get here
    }
    catch(const std::exception & e)
    {
        std::string msg(e.what());
        CPPUNIT_ASSERT( msg.find("The parameter 'not_valid'") != std::string::npos );
    }
}
コード例 #14
0
TEST(InputParameters, checkControlParamValidError)
{
  try
  {
    InputParameters params = emptyInputParameters();
    params.declareControllable("not_valid");
    params.checkParams("");
    FAIL() << "checkParams failed to catch invalid control param";
  }
  catch (const std::exception & e)
  {
    std::string msg(e.what());
    ASSERT_TRUE(msg.find("The parameter 'not_valid'") != std::string::npos)
        << "failed with unexpected error: " << msg;
  }
}
コード例 #15
0
ファイル: InputParametersTest.C プロジェクト: laizy/moose
void
InputParametersTest::checkControlParamPrivateError()
{
    try
    {
        InputParameters params = emptyInputParameters();
        params.addPrivateParam<Real>("private", 1);
        params.declareControllable("private");
        params.checkParams("");
        CPPUNIT_ASSERT( false ); // shouldn't get here
    }
    catch(const std::exception & e)
    {
        std::string msg(e.what());
        CPPUNIT_ASSERT( msg.find("is a private parameter") != std::string::npos );
    }
}
コード例 #16
0
ファイル: InputParametersTest.C プロジェクト: laizy/moose
void
InputParametersTest::checkControlParamTypeError()
{
    try
    {
        InputParameters params = emptyInputParameters();
        params.addParam<PostprocessorName>("pp_name", "make_it_valid", "Some doc");
        params.declareControllable("pp_name");
        params.checkParams("");
        CPPUNIT_ASSERT( false ); // shouldn't get here
    }
    catch(const std::exception & e)
    {
        std::string msg(e.what());
        CPPUNIT_ASSERT( msg.find("cannot be marked as controllable because its type") != std::string::npos );
    }
}
コード例 #17
0
TEST(InputParameters, checkControlParamPrivateError)
{
  try
  {
    InputParameters params = emptyInputParameters();
    params.addPrivateParam<Real>("private", 1);
    params.declareControllable("private");
    params.checkParams("");
    FAIL() << "checkParams failed to catch private control param";
  }
  catch (const std::exception & e)
  {
    std::string msg(e.what());
    ASSERT_TRUE(msg.find("is a private param") != std::string::npos)
        << "failed with unexpected error: " << msg;
  }
}
コード例 #18
0
ファイル: MultiApp.C プロジェクト: Biyss/moose
InputParameters validParams<MultiApp>()
{
  InputParameters params = validParams<MooseObject>();
  params += validParams<SetupInterface>();

  params.addParam<bool>("use_displaced_mesh", false, "Whether or not this object should use the displaced mesh for computation.  Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.");
  params.addParamNamesToGroup("use_displaced_mesh", "Advanced");

  std::ostringstream app_types_strings;
  registeredMooseAppIterator it = AppFactory::instance().registeredObjectsBegin();
  for ( ; it != AppFactory::instance().registeredObjectsEnd(); ++it)
    app_types_strings << it->first << " ";
  MooseEnum app_types_options(app_types_strings.str(), "", true);

  params.addParam<MooseEnum>("app_type", app_types_options, "The type of application to build (applications not registered can be loaded with dynamic libraries. Master application type will be used if not provided.");
  params.addParam<std::string>("library_path", "", "Path to search for dynamic libraries (please avoid committing absolute paths in addition to MOOSE_LIBRARY_PATH)");
  params.addParam<std::vector<Point> >("positions", "The positions of the App locations.  Each set of 3 values will represent a Point.  This and 'positions_file' cannot be both supplied. If this and 'positions_file' are not supplied, a single position (0,0,0) will be used");
  params.addParam<std::vector<FileName> >("positions_file", "A filename that should be looked in for positions. Each set of 3 values in that file will represent a Point.  This and 'positions' cannot be both supplied");

  params.addRequiredParam<std::vector<FileName> >("input_files", "The input file for each App.  If this parameter only contains one input file it will be used for all of the Apps.  When using 'positions_from_file' it is also admissable to provide one input_file per file.");
  params.addParam<Real>("bounding_box_inflation", 0.01, "Relative amount to 'inflate' the bounding box of this MultiApp.");

  params.addPrivateParam<MPI_Comm>("_mpi_comm");

  // Set the default execution time
  params.set<MultiMooseEnum>("execute_on") = "timestep_begin";

  params.addParam<unsigned int>("max_procs_per_app", std::numeric_limits<unsigned int>::max(), "Maximum number of processors to give to each App in this MultiApp.  Useful for restricting small solves to just a few procs so they don't get spread out");

  params.addParam<bool>("output_in_position", false, "If true this will cause the output from the MultiApp to be 'moved' by its position vector");

  params.addParam<Real>("reset_time", std::numeric_limits<Real>::max(), "The time at which to reset Apps given by the 'reset_apps' parameter.  Resetting an App means that it is destroyed and recreated, possibly modeling the insertion of 'new' material for that app.");

  params.addParam<std::vector<unsigned int> >("reset_apps", "The Apps that will be reset when 'reset_time' is hit.  These are the App 'numbers' starting with 0 corresponding to the order of the App positions.  Resetting an App means that it is destroyed and recreated, possibly modeling the insertion of 'new' material for that app.");

  params.addParam<Real>("move_time", std::numeric_limits<Real>::max(), "The time at which Apps designated by move_apps are moved to move_positions.");

  params.addParam<std::vector<unsigned int> >("move_apps", "Apps, designated by their 'numbers' starting with 0 corresponding to the order of the App positions, to be moved at move_time to move_positions");

  params.addParam<std::vector<Point> >("move_positions", "The positions corresponding to each move_app.");

  params.declareControllable("enable");
  params.registerBase("MultiApp");

  return params;
}
コード例 #19
0
TEST(InputParameters, checkControlParamTypeError)
{
  try
  {
    InputParameters params = emptyInputParameters();
    params.addParam<PostprocessorName>("pp_name", "make_it_valid", "Some doc");
    params.declareControllable("pp_name");
    params.checkParams("");
    FAIL() << "checkParams failed to catch invalid control param type";
  }
  catch (const std::exception & e)
  {
    std::string msg(e.what());
    ASSERT_TRUE(msg.find("cannot be marked as controllable because its type") != std::string::npos)
        << "failed with unexpected error:" << msg;
  }
}
コード例 #20
0
ファイル: DiracKernel.C プロジェクト: Biyss/moose
InputParameters validParams<DiracKernel>()
{
  InputParameters params = validParams<MooseObject>();
  params += validParams<MaterialPropertyInterface>();
  params.addRequiredParam<NonlinearVariableName>("variable",
                                                 "The name of the variable that this kernel operates on");

  params.addParam<bool>("use_displaced_mesh",
                        false,
                        "Whether or not this object should use the displaced mesh for computation. "
                        "Note that in the case this is true but no displacements are provided in "
                        "the Mesh block the undisplaced mesh will still be used.");

  params.addParamNamesToGroup("use_displaced_mesh", "Advanced");

  params.declareControllable("enable");
  params.registerBase("DiracKernel");

  return params;
}
コード例 #21
0
ファイル: KernelBase.C プロジェクト: JosephCor/moose
InputParameters validParams<KernelBase>()
{
  InputParameters params = validParams<MooseObject>();
  params += validParams<TransientInterface>();
  params += validParams<BlockRestrictable>();
  params += validParams<RandomInterface>();
  params += validParams<MeshChangedInterface>();
  params += validParams<MaterialPropertyInterface>();

  params.addRequiredParam<NonlinearVariableName>("variable", "The name of the variable that this Kernel operates on");
  params.addParam<std::vector<AuxVariableName> >("save_in", "The name of auxiliary variables to save this Kernel's residual contributions to.  Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.)");
  params.addParam<std::vector<AuxVariableName> >("diag_save_in", "The name of auxiliary variables to save this Kernel's diagonal Jacobian contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.)");

  params.addParam<bool>("use_displaced_mesh", false, "Whether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.");
  params.addParamNamesToGroup("use_displaced_mesh", "Advanced");

  params.addParamNamesToGroup("diag_save_in save_in", "Advanced");

  params.declareControllable("enable");
  return params;
}
コード例 #22
0
ファイル: NodalKernel.C プロジェクト: aashiquear/moose
InputParameters
validParams<NodalKernel>()
{
  InputParameters params = validParams<MooseObject>();
  params += validParams<TransientInterface>();
  params += validParams<BlockRestrictable>();
  params += validParams<BoundaryRestrictable>();
  params += validParams<RandomInterface>();
  params += validParams<TaggingInterface>();

  params.addRequiredParam<NonlinearVariableName>(
      "variable", "The name of the variable that this boundary condition applies to");

  params.addParam<std::vector<AuxVariableName>>(
      "save_in",
      "The name of auxiliary variables to save this BC's residual contributions to.  "
      "Everything about that variable must match everything about this variable (the "
      "type, what blocks it's on, etc.)");

  params.addParam<std::vector<AuxVariableName>>(
      "diag_save_in",
      "The name of auxiliary variables to save this BC's diagonal jacobian "
      "contributions to.  Everything about that variable must match everything "
      "about this variable (the type, what blocks it's on, etc.)");

  params.addParam<bool>("use_displaced_mesh",
                        false,
                        "Whether or not this object should use the "
                        "displaced mesh for computation.  Note that "
                        "in the case this is true but no "
                        "displacements are provided in the Mesh block "
                        "the undisplaced mesh will still be used.");
  params.addParamNamesToGroup("use_displaced_mesh", "Advanced");

  params.declareControllable("enable");

  params.registerBase("NodalKernel");

  return params;
}