https://mooseframework.inl.gov
Loading...
Searching...
No Matches
RampIC.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#include "RampIC.h"
11#include "FEProblem.h"
12#include "MooseMesh.h"
13
14registerMooseObject("PhaseFieldApp", RampIC);
15
18{
21 "Linear ramp along the x-axis with given values at the left and right extreme points.");
22 params.addRequiredParam<Real>("value_left", "The value on left (xmin) boundary.");
23 params.addRequiredParam<Real>("value_right", "The value on right (xmax) boundary.");
24 return params;
25}
26
28 : InitialCondition(parameters),
29 _xlength(_fe_problem.mesh().dimensionWidth(0)),
30 _xmin(_fe_problem.mesh().getMinInDimension(0)),
31 _value_left(getParam<Real>("value_left")),
32 _value_right(getParam<Real>("value_right"))
33{
34}
35
36Real
37RampIC::value(const Point & p)
38{
39 return (_value_right - _value_left) / _xlength * (p(0) - _xmin) + _value_left;
40}
41
42RealGradient
43RampIC::gradient(const Point & /*p*/)
44{
46}
const Real p
registerMooseObject("PhaseFieldApp", RampIC)
static InputParameters validParams()
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
Makes initial condition which creates a linear ramp of the given variable on the x-axis with specifie...
Definition RampIC.h:19
const Real _xlength
Definition RampIC.h:29
const Real _value_left
Definition RampIC.h:31
const Real _xmin
Definition RampIC.h:30
const Real _value_right
Definition RampIC.h:32
static InputParameters validParams()
Definition RampIC.C:17
virtual RealGradient gradient(const Point &)
Definition RampIC.C:43
RampIC(const InputParameters &parameters)
Definition RampIC.C:27
virtual Real value(const Point &p)
Definition RampIC.C:37
MeshBase & mesh