Skip to content

Commit

Permalink
Merge pull request #13363 from dschwen/phase_field_tests_2975
Browse files Browse the repository at this point in the history
Fixing phase field tests in parallel
  • Loading branch information
permcody committed May 8, 2019
2 parents e784580 + 628abb4 commit 713b4b5
Show file tree
Hide file tree
Showing 69 changed files with 309 additions and 870 deletions.
5 changes: 2 additions & 3 deletions modules/phase_field/include/ics/PFCFreezingIC.h
Expand Up @@ -9,7 +9,7 @@

#pragma once

#include "InitialCondition.h"
#include "RandomICBase.h"

// Forward Declarations
class PFCFreezingIC;
Expand All @@ -24,7 +24,7 @@ InputParameters validParams<PFCFreezingIC>();
* \todo For the FCC this returns 0. This cannot be right, yet it satisfies the (probably bogus)
* test.
*/
class PFCFreezingIC : public InitialCondition
class PFCFreezingIC : public RandomICBase
{
public:
PFCFreezingIC(const InputParameters & parameters);
Expand Down Expand Up @@ -52,4 +52,3 @@ class PFCFreezingIC : public InitialCondition

unsigned int _icdim;
};

5 changes: 2 additions & 3 deletions modules/phase_field/include/ics/PolycrystalRandomIC.h
Expand Up @@ -9,7 +9,7 @@

#pragma once

#include "InitialCondition.h"
#include "RandomICBase.h"

// Forward Declarations
class PolycrystalRandomIC;
Expand All @@ -20,7 +20,7 @@ InputParameters validParams<PolycrystalRandomIC>();
/**
* Random initial condition for a polycrystalline material
*/
class PolycrystalRandomIC : public InitialCondition
class PolycrystalRandomIC : public RandomICBase
{
public:
PolycrystalRandomIC(const InputParameters & parameters);
Expand All @@ -32,4 +32,3 @@ class PolycrystalRandomIC : public InitialCondition
const unsigned int _op_index;
const unsigned int _random_type;
};

7 changes: 4 additions & 3 deletions modules/phase_field/src/action/BicrystalBoundingBoxICAction.C
Expand Up @@ -19,7 +19,8 @@ InputParameters
validParams<BicrystalBoundingBoxICAction>()
{
InputParameters params = validParams<Action>();
params.addClassDescription("Bicrystal using a bounding box");
params.addClassDescription("Constructs a bicrystal, where one grain is on the inside of "
"the box and the other grain is the outside of the box");
params.addRequiredParam<std::string>("var_name_base", "specifies the base name of the variables");
params.addRequiredParam<unsigned int>("op_num", "Number of grains, should be 2");
params.addRequiredParam<Real>("x1", "The x coordinate of the lower left-hand corner of the box");
Expand All @@ -37,7 +38,7 @@ BicrystalBoundingBoxICAction::BicrystalBoundingBoxICAction(const InputParameters
_op_num(getParam<unsigned int>("op_num"))
{
if (_op_num != 2)
paramError("op_num", "op_num must equal 2 for bicrystal ICs");
paramError("op_num", "Must equal 2 for bicrystal ICs");
}

void
Expand All @@ -59,7 +60,7 @@ BicrystalBoundingBoxICAction::act()
poly_params.set<VariableName>("variable") = var_name;
if (op == 0)
{
// Values for bounding box
// Values for bounding box grain
poly_params.set<Real>("inside") = 1.0;
poly_params.set<Real>("outside") = 0.0;
}
Expand Down
10 changes: 3 additions & 7 deletions modules/phase_field/src/ics/PFCFreezingIC.C
Expand Up @@ -16,7 +16,7 @@ template <>
InputParameters
validParams<PFCFreezingIC>()
{
InputParameters params = validParams<InitialCondition>();
InputParameters params = validParams<RandomICBase>();
params.addRequiredParam<Real>("x1",
"The x coordinate of the lower left-hand corner of the frozen box");
params.addRequiredParam<Real>("y1",
Expand All @@ -38,13 +38,11 @@ validParams<PFCFreezingIC>()
params.addParam<MooseEnum>(
"crystal_structure", crystal_structures, "The type of crystal structure");

params.addParam<unsigned int>("seed", 0, "Seed value for the random number generator");

return params;
}

PFCFreezingIC::PFCFreezingIC(const InputParameters & parameters)
: InitialCondition(parameters),
: RandomICBase(parameters),
_x1(getParam<Real>("x1")),
_y1(getParam<Real>("y1")),
_z1(getParam<Real>("z1")),
Expand All @@ -67,8 +65,6 @@ PFCFreezingIC::PFCFreezingIC(const InputParameters & parameters)
for (unsigned int i = 0; i < LIBMESH_DIM; i++)
mooseAssert(_range(i) >= 0.0, "x1, y1 or z1 is not less than x2, y2 or z2");

MooseRandom::seed(getParam<unsigned int>("seed"));

if (_range(1) == 0.0)
_icdim = 1;
else if (_range(2) < 1.0e-10 * _range(0))
Expand All @@ -83,7 +79,7 @@ PFCFreezingIC::value(const Point & p)
// If out of bounds, set random value
for (unsigned int i = 0; i < LIBMESH_DIM; i++)
if (p(i) < _bottom_left(i) || p(i) > _top_right(i))
return _min + _val_range * MooseRandom::rand();
return _min + _val_range * generateRandom();

// If in bounds, set sinusoid IC to make atoms
Real val = 0.0;
Expand Down
9 changes: 4 additions & 5 deletions modules/phase_field/src/ics/PolycrystalRandomIC.C
Expand Up @@ -16,17 +16,16 @@ template <>
InputParameters
validParams<PolycrystalRandomIC>()
{
InputParameters params = validParams<InitialCondition>();
InputParameters params = validParams<RandomICBase>();
params.addClassDescription("Random initial condition for a polycrystalline material");
params.addRequiredParam<unsigned int>("op_num", "Number of order parameters");
params.addRequiredParam<unsigned int>("op_index", "The index for the current order parameter");
params.addRequiredParam<unsigned int>("random_type",
"Type of random grain structure (formerly called 'typ')");
params.addRequiredParam<unsigned int>("random_type", "Type of random grain structure");
return params;
}

PolycrystalRandomIC::PolycrystalRandomIC(const InputParameters & parameters)
: InitialCondition(parameters),
: RandomICBase(parameters),
_op_num(getParam<unsigned int>("op_num")),
_op_index(getParam<unsigned int>("op_index")),
_random_type(getParam<unsigned int>("random_type"))
Expand All @@ -37,7 +36,7 @@ Real
PolycrystalRandomIC::value(const Point & p)
{
Point cur_pos = p;
Real val = MooseRandom::rand();
Real val = generateRandom();

switch (_random_type)
{
Expand Down
2 changes: 1 addition & 1 deletion modules/phase_field/src/materials/GBAnisotropyBase.C
Expand Up @@ -31,7 +31,7 @@ validParams<GBAnisotropyBase>()
"Name of the file containing: 1)GB mobility prefactor; 2) GB "
"migration activation energy; 3)GB energy");
params.addRequiredParam<bool>("inclination_anisotropy",
"The GB anisotropy ininclination would be considered if true");
"The GB anisotropy inclination would be considered if true");
params.addRequiredCoupledVarWithAutoBuild(
"v", "var_name_base", "op_num", "Array of coupled variables");
return params;
Expand Down
6 changes: 3 additions & 3 deletions modules/phase_field/src/materials/GBEvolutionBase.C
Expand Up @@ -69,14 +69,14 @@ GBEvolutionBase::computeQpProperties()
{
const Real length_scale4 = _length_scale * _length_scale * _length_scale * _length_scale;

// Convert to lengthscale^4/(eV*timescale);
Real M0 = _GBmob0 * _time_scale / (_JtoeV * length_scale4);

// GB mobility Derivative
Real dM_GBdT;

if (_GBMobility < 0)
{
// Convert to lengthscale^4/(eV*timescale);
const Real M0 = _GBmob0 * _time_scale / (_JtoeV * length_scale4);

_M_GB[_qp] = M0 * std::exp(-_Q / (_kb * _T[_qp]));
dM_GBdT = _M_GB[_qp] * _Q / (_kb * _T[_qp] * _T[_qp]);
}
Expand Down
Expand Up @@ -25,7 +25,7 @@ validParams<MultiBarrierFunctionMaterial>()
false,
"Make the g zero in [0:1] so it only contributes to "
"enforcing the eta range and not to the phase "
"transformation berrier.");
"transformation barrier.");
params.addRequiredCoupledVar("etas", "eta_i order parameters, one for each h");
return params;
}
Expand Down Expand Up @@ -62,7 +62,6 @@ MultiBarrierFunctionMaterial::computeQpProperties()

if (_well_only && n >= 0.0 && n <= 1.0)
{
_prop_g[_qp] = 0.0;
(*_prop_dg[i])[_qp] = 0.0;
(*_prop_d2g[i])[_qp] = 0.0;
continue;
Expand Down
163 changes: 0 additions & 163 deletions modules/phase_field/test/tests/CahnHilliardFluxBC/anisotropic.i

This file was deleted.

0 comments on commit 713b4b5

Please sign in to comment.