Skip to content

Commit

Permalink
Merge pull request idaholab#38 from jessecarterMOOSE/property_name_in…
Browse files Browse the repository at this point in the history
…_MaterialDiffusivity_21

Property name in MaterialDiffusion, closes idaholab#21
  • Loading branch information
jessecarterMOOSE authored Sep 15, 2016
2 parents 3f28687 + 1b96d73 commit 11c4309
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
2 changes: 2 additions & 0 deletions include/kernels/MaterialDiffusion.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ class MaterialDiffusion : public Diffusion
virtual Real computeQpResidual();
virtual Real computeQpJacobian();

std::string _diffusivity_name;

/**
* This MooseArray will hold the reference we need to our
* material property from the Material class
Expand Down
7 changes: 5 additions & 2 deletions src/kernels/MaterialDiffusion.C
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,17 @@ template<>
InputParameters validParams<MaterialDiffusion>()
{
InputParameters params = validParams<Diffusion>();
params.addRequiredParam<MaterialPropertyName>("diffusivity_name", "Name of the material property for diffusion coefficient");
return params;
}


MaterialDiffusion::MaterialDiffusion(const InputParameters & parameters) :
Diffusion(parameters),
_diffusivity(getMaterialProperty<Real>("diffusivity"))
{}
_diffusivity_name(getParam<MaterialPropertyName>("diffusivity_name")),
_diffusivity(getMaterialProperty<Real>(_diffusivity_name))
{
}

Real
MaterialDiffusion::computeQpResidual()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
[./diff]
type = MaterialDiffusion
variable = u
prop_name = diffusivity
diffusivity_name = diffusivity
[../]
[]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
[./mat_diff]
type = MaterialDiffusion
variable = u
prop_name = diffusivity
diffusivity_name = diffusivity
[../]

[./event_inserter_source]
Expand Down

0 comments on commit 11c4309

Please sign in to comment.