Commit 62f2f0dd authored by Santiago Ospina's avatar Santiago Ospina

rename StochasticPart alias to StochasticPartType

parent 12977e86
......@@ -24,7 +24,7 @@ namespace Dune {
template<typename Traits>
class RandomFieldMatrix
{
using StochasticPart = StochasticPart<Traits,RandomFieldMatrix>;
using StochasticPartType = StochasticPart<Traits,RandomFieldMatrix>;
using RF = typename Traits::RF;
enum {dim = Traits::dim};
......@@ -96,9 +96,9 @@ namespace Dune {
/**
* @brief Multiply random field with covariance matrix
*/
StochasticPart operator*(const StochasticPart& input) const
StochasticPartType operator*(const StochasticPartType& input) const
{
StochasticPart output(input);
StochasticPartType output(input);
multiplyExtended(output.dataVector,output.dataVector);
......@@ -110,9 +110,9 @@ namespace Dune {
/**
* @brief Multiply random field with root of covariance matrix (up to boundary effects)
*/
StochasticPart multiplyRoot(const StochasticPart& input) const
StochasticPartType multiplyRoot(const StochasticPartType& input) const
{
StochasticPart output(input);
StochasticPartType output(input);
multiplyRootExtended(output.dataVector,output.dataVector);
......@@ -124,9 +124,9 @@ namespace Dune {
/**
* @brief Multiply random field with inverse of covariance matrix
*/
StochasticPart multiplyInverse(const StochasticPart& input) const
StochasticPartType multiplyInverse(const StochasticPartType& input) const
{
StochasticPart output(input);
StochasticPartType output(input);
bool fieldZero = true;
for (unsigned int i = 0; i < localDomainSize; i++)
......@@ -147,7 +147,7 @@ namespace Dune {
/**
* @brief Generate random field based on covariance matrix
*/
void generateField(unsigned int seed, StochasticPart& stochasticPart) const
void generateField(unsigned int seed, StochasticPartType& stochasticPart) const
{
if (fftTransformedMatrix == NULL)
......@@ -192,7 +192,7 @@ namespace Dune {
/**
* @brief Generate uncorrelated random field (i.e. noise)
*/
void generateUncorrelatedField(unsigned int seed, StochasticPart& stochasticPart) const
void generateUncorrelatedField(unsigned int seed, StochasticPartType& stochasticPart) const
{
// initialize pseudo-random generator
seed += rank; // different seed for each processor
......@@ -208,7 +208,7 @@ namespace Dune {
/**
* @brief Create field that represents the local variance
*/
void setVarianceAsField(StochasticPart& stochasticPart) const
void setVarianceAsField(StochasticPartType& stochasticPart) const
{
for (unsigned int index = 0; index < localDomainSize; index++)
stochasticPart.dataVector[index] = variance;
......
......@@ -30,9 +30,9 @@ namespace Dune {
{
protected:
using Traits = RandomFieldTraits<GridTraits,Matrix>;
using StochasticPart = StochasticPart<Traits,Matrix>;
using RF = typename Traits::RF;
using Traits = RandomFieldTraits<GridTraits,Matrix>;
using StochasticPartType = StochasticPart<Traits,Matrix>;
using RF = typename Traits::RF;
// to allow reading in constructor
class ParamTreeHelper
......@@ -62,10 +62,10 @@ namespace Dune {
std::shared_ptr<Traits> traits;
std::shared_ptr<Matrix<Traits> > matrix;
TrendPart<Traits> trendPart;
StochasticPart stochasticPart;
mutable std::shared_ptr<StochasticPart> invMatvecPart;
StochasticPartType stochasticPart;
mutable std::shared_ptr<StochasticPartType> invMatvecPart;
mutable bool invMatvecValid;
mutable std::shared_ptr<StochasticPart> invRootMatvecPart;
mutable std::shared_ptr<StochasticPartType> invRootMatvecPart;
mutable bool invRootMatvecValid;
public:
......@@ -80,10 +80,10 @@ namespace Dune {
invMatvecValid(false), invRootMatvecValid(false)
{
if ((*traits).cacheInvMatvec)
invMatvecPart = std::shared_ptr<StochasticPart>(new StochasticPart(stochasticPart));
invMatvecPart = std::shared_ptr<StochasticPartType>(new StochasticPartType(stochasticPart));
if ((*traits).cacheInvRootMatvec)
invRootMatvecPart = std::shared_ptr<StochasticPart>(new StochasticPart(stochasticPart));
invRootMatvecPart = std::shared_ptr<StochasticPartType>(new StochasticPartType(stochasticPart));
}
/**
......@@ -96,10 +96,10 @@ namespace Dune {
invMatvecValid(false), invRootMatvecValid(false)
{
if ((*traits).cacheInvMatvec)
invMatvecPart = std::shared_ptr<StochasticPart>(new StochasticPart(stochasticPart));
invMatvecPart = std::shared_ptr<StochasticPartType>(new StochasticPartType(stochasticPart));
if ((*traits).cacheInvRootMatvec)
invRootMatvecPart = std::shared_ptr<StochasticPart>(new StochasticPart(stochasticPart));
invRootMatvecPart = std::shared_ptr<StochasticPartType>(new StochasticPartType(stochasticPart));
}
/**
......@@ -111,10 +111,10 @@ namespace Dune {
invMatvecValid(false), invRootMatvecValid(false)
{
if ((*traits).cacheInvMatvec)
invMatvecPart = std::shared_ptr<StochasticPart>(new StochasticPart(stochasticPart));
invMatvecPart = std::shared_ptr<StochasticPartType>(new StochasticPartType(stochasticPart));
if ((*traits).cacheInvRootMatvec)
invRootMatvecPart = std::shared_ptr<StochasticPart>(new StochasticPart(stochasticPart));
invRootMatvecPart = std::shared_ptr<StochasticPartType>(new StochasticPartType(stochasticPart));
}
#if HAVE_DUNE_PDELAB
......@@ -128,10 +128,10 @@ namespace Dune {
invMatvecValid(false), invRootMatvecValid(false)
{
if ((*traits).cacheInvMatvec)
invMatvecPart = std::shared_ptr<StochasticPart>(new StochasticPart(stochasticPart));
invMatvecPart = std::shared_ptr<StochasticPartType>(new StochasticPartType(stochasticPart));
if ((*traits).cacheInvRootMatvec)
invRootMatvecPart = std::shared_ptr<StochasticPart>(new StochasticPart(stochasticPart));
invRootMatvecPart = std::shared_ptr<StochasticPartType>(new StochasticPartType(stochasticPart));
}
/**
......@@ -144,10 +144,10 @@ namespace Dune {
invMatvecValid(false), invRootMatvecValid(false)
{
if ((*traits).cacheInvMatvec)
invMatvecPart = std::shared_ptr<StochasticPart>(new StochasticPart(stochasticPart));
invMatvecPart = std::shared_ptr<StochasticPartType>(new StochasticPartType(stochasticPart));
if ((*traits).cacheInvRootMatvec)
invRootMatvecPart = std::shared_ptr<StochasticPart>(new StochasticPart(stochasticPart));
invRootMatvecPart = std::shared_ptr<StochasticPartType>(new StochasticPartType(stochasticPart));
}
#endif // HAVE_DUNE_PDELAB
......@@ -160,10 +160,10 @@ namespace Dune {
invMatvecValid(other.invMatvecValid), invRootMatvecValid(other.invRootMatvecValid)
{
if ((*traits).cacheInvMatvec && (*(other.traits)).cacheInvMatvec)
invMatvecPart = std::shared_ptr<StochasticPart>(new StochasticPart(*(other.invMatvecPart)));
invMatvecPart = std::shared_ptr<StochasticPartType>(new StochasticPartType(*(other.invMatvecPart)));
if ((*traits).cacheInvRootMatvec && (*(other.traits)).cacheInvRootMatvec)
invRootMatvecPart = std::shared_ptr<StochasticPart>(new StochasticPart(*(other.invRootMatvecPart)));
invRootMatvecPart = std::shared_ptr<StochasticPartType>(new StochasticPartType(*(other.invRootMatvecPart)));
}
/**
......@@ -182,13 +182,13 @@ namespace Dune {
if ((*traits).cacheInvMatvec)
{
invMatvecPart = std::shared_ptr<StochasticPart>(new StochasticPart(*(other.invMatvecPart)));
invMatvecPart = std::shared_ptr<StochasticPartType>(new StochasticPartType(*(other.invMatvecPart)));
invMatvecValid = other.invMatvecValid;
}
if ((*traits).cacheInvRootMatvec)
{
invRootMatvecPart = std::shared_ptr<StochasticPart>(new StochasticPart(*(other.invRootMatvecPart)));
invRootMatvecPart = std::shared_ptr<StochasticPartType>(new StochasticPartType(*(other.invRootMatvecPart)));
invRootMatvecValid = other.invRootMatvecValid;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment