33 t0_ = coeffs.lookupOrDefault<scalar>(
"t0", 0);
34 markSpace_ = coeffs.lookupOrDefault<scalar>(
"markSpace", 1);
45 const word& entryName,
61 markSpace_(se.markSpace_),
62 amplitude_(se.amplitude_, false),
63 frequency_(se.frequency_, false),
64 scale_(se.scale_, false),
65 level_(se.level_, false)
82 scalar waves = frequency_->value(t)*(t - t0_);
88 scalar waveFrac = std::modf(waves, &nWaves);
91 scalar markFrac = markSpace_/(1.0 + markSpace_);
95 *(waveFrac < markFrac ? 1 : -1)
110 amplitude_->writeData(os);
111 frequency_->writeData(os);
112 scale_->writeData(os);
113 level_->writeData(os);
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
const word & name() const
Return the name of the entry.
Ostream & indent(Ostream &os)
Indent stream.
Square(const word &entryName, const dictionary &dict, const word &ext="Coeffs")
Construct from entry name and dictionary.
A list of keyword definitions, which are a keyword followed by any number of values (e...
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual ~Square()
Destructor.
virtual void writeData(Ostream &os) const
Write in dictionary format.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
bool read(const char *, int32_t &)
A class for handling words, derived from string.
virtual void writeData(Ostream &os) const
Write in dictionary format.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
Ostream & writeKeyword(const keyType &)
Write the keyword followed by an appropriate indentation.
Type value(const scalar t) const
Return value for time t.
Templated square-wave function with support for an offset level.
Ostream & incrIndent(Ostream &os)
Increment the indent level.