40 { interpolationType::RGB,
"rgb" },
41 { interpolationType::HSV,
"hsv" },
42 { interpolationType::DIVERGING,
"diverging" },
65 table_(std::move(values)),
98 return table_.first().second();
103 return table_.last().second();
110 [](
const pair_type& pr,
const scalar& val)
113 return (pr.
first() <= val);
120 return table_.first().second();
122 else if (idx == table_.size()-1)
125 return table_.last().second();
128 const scalar t0 = table_[idx].first();
129 const scalar t1 = table_[idx+1].first();
131 const scalar
s = (
x - t0)/(t1 - t0);
133 const vector& rgb0 = table_[idx].second();
134 const vector& rgb1 = table_[idx+1].second();
136 if (interp_ == DIVERGING)
140 else if (interp_ == HSV)
154 for (label i=0; i < nColours; ++i)
156 const scalar
x = scalar(i)/scalar(nColours-1);
168 os.
writeEntry(
"interpolate", interpolationTypeNames[interp_]);
Various functions to operate on Lists.
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
bool readIfPresent(const word &key, const dictionary &dict, EnumType &val) const
Find an entry if present, and assign to T val.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
virtual Ostream & endBlock()
Write end block group.
Ostream & writeEntry(const keyType &key, const T &value)
Write a keyword/value entry.
virtual Ostream & beginBlock(const keyType &kw)
Write begin block group with the given name.
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
const T1 & first() const noexcept
Return first.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Base class for generating a colour table from node points.
vector value(const scalar x) const
Return the colour at x. The input is clipped to 0-1 range.
Ostream & writeDict(Ostream &os) const
Write as dictionary format.
static const Enum< interpolationType > interpolationTypeNames
Enumeration names for interpolationType.
interpolationType
Internal interpolation type.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
Foam::dictionary writeDict() const
Write to dictionary.
List< Tuple2< scalar, List< Tuple2< scalar, Type > > > > table
Convenience typedef.
OBJstream os(runTime.globalPath()/outputName)
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
label findLower(const ListType &input, const T &val, const label start, const ComparePredicate &comp)
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)