Skip to content

Commit

Permalink
Revert "Merge pull request #14437 from aeslaughter/stm-parallel-type-…
Browse files Browse the repository at this point in the history
…14410"

This reverts commit 6d8ca4f, reversing
changes made to 1d11e95.
  • Loading branch information
permcody committed Dec 9, 2019
1 parent 6d8ca4f commit 815487e
Show file tree
Hide file tree
Showing 154 changed files with 1,013 additions and 1,934 deletions.
1 change: 0 additions & 1 deletion framework/include/utils/MooseTypes.h
Expand Up @@ -541,7 +541,6 @@ typedef VectorVariableTestSecond ADVectorVariableTestSecond;

namespace Moose
{
extern const processor_id_type INVALID_PROCESSOR_ID;
extern const SubdomainID ANY_BLOCK_ID;
extern const SubdomainID INVALID_BLOCK_ID;
extern const BoundaryID ANY_BOUNDARY_ID;
Expand Down
4 changes: 2 additions & 2 deletions framework/src/base/Moose.C
Expand Up @@ -290,10 +290,10 @@ addActionTypes(Syntax & syntax)
"(setup_variable_complete)"
"(setup_quadrature)"
"(add_function)"
"(add_periodic_bc)"
"(add_user_object)"
"(add_distribution)"
"(add_sampler)"
"(add_periodic_bc)"
"(add_user_object)"
"(setup_function_complete)"
"(setup_adaptivity)"
"(set_adaptivity_options)"
Expand Down
1 change: 0 additions & 1 deletion framework/src/utils/MooseTypes.C
Expand Up @@ -13,7 +13,6 @@

namespace Moose
{
const processor_id_type INVALID_PROCESSOR_ID = libMesh::DofObject::invalid_processor_id;
const SubdomainID ANY_BLOCK_ID = libMesh::Elem::invalid_subdomain_id - 1;
const SubdomainID INVALID_BLOCK_ID = libMesh::Elem::invalid_subdomain_id;
const BoundaryID ANY_BOUNDARY_ID = static_cast<BoundaryID>(-1);
Expand Down
Expand Up @@ -52,7 +52,7 @@ creates and runs a sub-application for each sample provided by the sampler objec

!listing modules/stochastic_tools/test/tests/transfers/monte_carlo/monte_carlo.i block=MultiApps

Finally, the [SamplerParameterTransfer](/SamplerParameterTransfer.md) is utilized to communicate the
Finally, the [SamplerTransfer](/SamplerTransfer.md) is utilized to communicate the
sampler data to the sub-application. The 'parameters' input lists the parameters on the
sub-applications to perturb and the 'to_control' specifies the
[SamplerReceiver](/SamplerReceiver.md) object in the sub-application.
Expand Down

This file was deleted.

@@ -0,0 +1,13 @@
# SamplerTransfer

The SamplerTransfer works in union with the [Samplers] and [Controls] systems to transfer data to
sub-applications to perform stochastic simulations.

The use of this object is explained in detail in stochastic_tools module
example: [Monte Carlo Example](stochastic_tools/examples/monte_carlo.md).

!syntax parameters /Transfers/SamplerTransfer

!syntax inputs /Transfers/SamplerTransfer

!syntax children /Transfers/SamplerTransfer
2 changes: 1 addition & 1 deletion modules/stochastic_tools/examples/batch/full_solve.i
Expand Up @@ -39,7 +39,7 @@

[Transfers]
[runner]
type = SamplerParameterTransfer
type = SamplerTransfer
multi_app = runner
parameters = 'BCs/left/value BCs/right/value'
to_control = receiver
Expand Down
2 changes: 1 addition & 1 deletion modules/stochastic_tools/examples/batch/transient.i
Expand Up @@ -41,7 +41,7 @@

[Transfers]
[runner]
type = SamplerParameterTransfer
type = SamplerTransfer
multi_app = runner
parameters = 'BCs/left/value BCs/right/value'
to_control = receiver
Expand Down
2 changes: 0 additions & 2 deletions modules/stochastic_tools/include/base/StochasticToolsApp.h
Expand Up @@ -19,8 +19,6 @@ InputParameters validParams<StochasticToolsApp>();
class StochasticToolsApp : public MooseApp
{
public:
static InputParameters validParams();

StochasticToolsApp(InputParameters parameters);
virtual ~StochasticToolsApp();

Expand Down
Expand Up @@ -29,8 +29,6 @@ InputParameters validParams<MultiAppCommandLineControl>();
class MultiAppCommandLineControl : public Control, public SamplerInterface
{
public:
static InputParameters validParams();

MultiAppCommandLineControl(const InputParameters & parameters);

/**
Expand Down
7 changes: 3 additions & 4 deletions modules/stochastic_tools/include/controls/SamplerReceiver.h
Expand Up @@ -25,8 +25,6 @@ InputParameters validParams<SamplerReceiver>();
class SamplerReceiver : public Control
{
public:
static InputParameters validParams();

SamplerReceiver(const InputParameters & parameters);
virtual void execute() override;

Expand All @@ -42,7 +40,8 @@ class SamplerReceiver : public Control
/// Values to use when modifying parameters
std::vector<Real> _values;

/// Allows the SamplerParameterTransfer to call the transfer method, which
/// Allows the SamplerTransfer to call the transfer method, which
/// should only be called by that object so making it public is dangerous.
friend class SamplerParameterTransfer;
friend class SamplerTransfer;
};

Expand Up @@ -23,8 +23,6 @@ class BoostLognormalDistribution
: public BoostDistribution<boost::math::lognormal_distribution<Real>>
{
public:
static InputParameters validParams();

BoostLognormalDistribution(const InputParameters & parameters);
};

Expand Up @@ -22,8 +22,6 @@ InputParameters validParams<BoostNormalDistribution>();
class BoostNormalDistribution : public BoostDistribution<boost::math::normal_distribution<Real>>
{
public:
static InputParameters validParams();

BoostNormalDistribution(const InputParameters & parameters);
};

Expand Up @@ -22,8 +22,6 @@ InputParameters validParams<BoostWeibullDistribution>();
class BoostWeibullDistribution : public BoostDistribution<boost::math::weibull_distribution<Real>>
{
public:
static InputParameters validParams();

BoostWeibullDistribution(const InputParameters & parameters);
};

Expand Up @@ -22,20 +22,27 @@ InputParameters validParams<JohnsonSBDistribution>();
class JohnsonSBDistribution : public NormalDistribution
{
public:
static InputParameters validParams();

JohnsonSBDistribution(const InputParameters & parameters);

virtual Real pdf(const Real & x) const override;
virtual Real cdf(const Real & x) const override;
virtual Real quantile(const Real & p) const override;

static Real
pdf(const Real & x, const Real & a, const Real & b, const Real & alpha_1, const Real & alpha_2);
static Real
cdf(const Real & x, const Real & a, const Real & b, const Real & alpha_1, const Real & alpha_2);
static Real quantile(
const Real & p, const Real & a, const Real & b, const Real & alpha_1, const Real & alpha_2);
Real pdf(const Real & x,
const Real & a,
const Real & b,
const Real & alpha_1,
const Real & alpha_2) const;
Real cdf(const Real & x,
const Real & a,
const Real & b,
const Real & alpha_1,
const Real & alpha_2) const;
Real quantile(const Real & p,
const Real & a,
const Real & b,
const Real & alpha_1,
const Real & alpha_2) const;

protected:
/// The lower location parameter, a
Expand All @@ -50,3 +57,4 @@ class JohnsonSBDistribution : public NormalDistribution
/// The second shape parameter, alpha_2
const Real & _alpha_2;
};

Expand Up @@ -22,17 +22,15 @@ InputParameters validParams<LogisticDistribution>();
class LogisticDistribution : public Distribution
{
public:
static InputParameters validParams();

LogisticDistribution(const InputParameters & parameters);

virtual Real pdf(const Real & x) const override;
virtual Real cdf(const Real & x) const override;
virtual Real quantile(const Real & p) const override;

static Real pdf(const Real & x, const Real & location, const Real & shape);
static Real cdf(const Real & x, const Real & location, const Real & shape);
static Real quantile(const Real & p, const Real & location, const Real & shape);
Real pdf(const Real & x, const Real & location, const Real & shape) const;
Real cdf(const Real & x, const Real & location, const Real & shape) const;
Real quantile(const Real & p, const Real & location, const Real & shape) const;

protected:
/// The location or mean of the distribution (alpha or mu)
Expand All @@ -41,3 +39,4 @@ class LogisticDistribution : public Distribution
/// The shape of the distribution (beta or s)
const Real & _shape;
};

Expand Up @@ -22,24 +22,24 @@ InputParameters validParams<NormalDistribution>();
class NormalDistribution : public Distribution
{
public:
static InputParameters validParams();

NormalDistribution(const InputParameters & parameters);

virtual Real pdf(const Real & x) const override;
virtual Real cdf(const Real & x) const override;
virtual Real quantile(const Real & p) const override;

static Real pdf(const Real & x, const Real & mean, const Real & std_dev);
static Real cdf(const Real & x, const Real & mean, const Real & std_dev);
static Real quantile(const Real & p, const Real & mean, const Real & std_dev);
Real pdf(const Real & x, const Real & mean, const Real & std_dev) const;
Real cdf(const Real & x, const Real & mean, const Real & std_dev) const;
Real quantile(const Real & p, const Real & mean, const Real & std_dev) const;

protected:
///@{
/// Coefficients for the rational function used to approximate the quantile
static const std::array<Real, 6> _a;
const std::vector<Real> _a = {
-0.322232431088, -1.0, -0.342242088547, -0.0204231210245, -0.0000453642210148};

static const std::array<Real, 6> _b;
const std::vector<Real> _b = {
0.099348462606, 0.588581570495, 0.531103462366, 0.10353775285, 0.0038560700634};
///@}

/// The mean (or expectation) of the distribution (mu)
Expand All @@ -48,3 +48,4 @@ class NormalDistribution : public Distribution
/// The standard deviation of the distribution (sigma)
const Real & _standard_deviation;
};

Expand Up @@ -22,29 +22,27 @@ InputParameters validParams<TruncatedNormalDistribution>();
class TruncatedNormalDistribution : public NormalDistribution
{
public:
static InputParameters validParams();

TruncatedNormalDistribution(const InputParameters & parameters);

virtual Real pdf(const Real & x) const override;
virtual Real cdf(const Real & x) const override;
virtual Real quantile(const Real & p) const override;

static Real pdf(const Real & x,
const Real & mean,
const Real & std_dev,
const Real & lower_bound,
const Real & upper_bound);
static Real cdf(const Real & x,
const Real & mean,
const Real & std_dev,
const Real & lower_bound,
const Real & upper_bound);
static Real quantile(const Real & p,
const Real & mean,
const Real & std_dev,
const Real & lower_bound,
const Real & upper_bound);
Real pdf(const Real & x,
const Real & mean,
const Real & std_dev,
const Real & lower_bound,
const Real & upper_bound) const;
Real cdf(const Real & x,
const Real & mean,
const Real & std_dev,
const Real & lower_bound,
const Real & upper_bound) const;
Real quantile(const Real & p,
const Real & mean,
const Real & std_dev,
const Real & lower_bound,
const Real & upper_bound) const;

protected:
/// The lower bound for the distribution
Expand All @@ -53,3 +51,4 @@ class TruncatedNormalDistribution : public NormalDistribution
/// The upper bound for the distribution
const Real & _upper_bound;
};

Expand Up @@ -21,13 +21,11 @@ InputParameters validParams<UniformDistribution>();
class UniformDistribution : public Distribution
{
public:
static InputParameters validParams();

UniformDistribution(const InputParameters & parameters);

static Real pdf(const Real & x, const Real & lower_bound, const Real & upper_bound);
static Real cdf(const Real & x, const Real & lower_bound, const Real & upper_bound);
static Real quantile(const Real & y, const Real & lower_bound, const Real & upper_bound);
Real pdf(const Real & x, const Real & lower_bound, const Real & upper_bound) const;
Real cdf(const Real & x, const Real & lower_bound, const Real & upper_bound) const;
Real quantile(const Real & y, const Real & lower_bound, const Real & upper_bound) const;

virtual Real pdf(const Real & x) const override;
virtual Real cdf(const Real & x) const override;
Expand All @@ -40,3 +38,4 @@ class UniformDistribution : public Distribution
/// The upper bound for the uniform distribution
const Real & _upper_bound;
};

Expand Up @@ -22,18 +22,16 @@ InputParameters validParams<WeibullDistribution>();
class WeibullDistribution : public Distribution
{
public:
static InputParameters validParams();

WeibullDistribution(const InputParameters & parameters);

virtual Real pdf(const Real & x) const override;
virtual Real cdf(const Real & x) const override;
virtual Real quantile(const Real & p) const override;

static Real pdf(const Real & x, const Real & location, const Real & scale, const Real & shape);
static Real cdf(const Real & x, const Real & location, const Real & scale, const Real & shape);
static Real
quantile(const Real & p, const Real & location, const Real & scale, const Real & shape);
Real pdf(const Real & x, const Real & location, const Real & scale, const Real & shape) const;
Real cdf(const Real & x, const Real & location, const Real & scale, const Real & shape) const;
Real
quantile(const Real & p, const Real & location, const Real & scale, const Real & shape) const;

protected:
/// The location parameter (a or low)
Expand All @@ -45,3 +43,4 @@ class WeibullDistribution : public Distribution
/// The shape parameter (c or k)
const Real & _c;
};

Expand Up @@ -25,10 +25,13 @@ InputParameters validParams<SamplerFullSolveMultiApp>();
class SamplerFullSolveMultiApp : public FullSolveMultiApp, public SamplerInterface
{
public:
static InputParameters validParams();

SamplerFullSolveMultiApp(const InputParameters & parameters);

/**
* Return the Sampler object for this MultiApp.
*/
Sampler & getSampler() const { return _sampler; }

virtual bool solveStep(Real dt, Real target_time, bool auto_advance = true) override;

protected:
Expand Down
Expand Up @@ -25,10 +25,13 @@ InputParameters validParams<SamplerTransientMultiApp>();
class SamplerTransientMultiApp : public TransientMultiApp, public SamplerInterface
{
public:
static InputParameters validParams();

SamplerTransientMultiApp(const InputParameters & parameters);

/**
* Return the Sampler object for this MultiApp.
*/
Sampler & getSampler() const { return _sampler; }

/**
* Override solveStep to allow for batch execution.
*/
Expand Down
2 changes: 0 additions & 2 deletions modules/stochastic_tools/include/samplers/MonteCarloSampler.h
Expand Up @@ -21,8 +21,6 @@ InputParameters validParams<MonteCarloSampler>();
class MonteCarloSampler : public Sampler
{
public:
static InputParameters validParams();

MonteCarloSampler(const InputParameters & parameters);

protected:
Expand Down

0 comments on commit 815487e

Please sign in to comment.