KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
|
This class provides to Kratos a data structure for I/O based on the standard of JSON. More...
#include <kratos_parameters.h>
Public Member Functions | |
template<> | |
bool | Is () const |
Life Cycle | |
Parameters () | |
Default constructor. More... | |
Parameters (const std::string &rJsonString) | |
String constructor. It takes a string as input, which parses into a nlohmann::json class. More... | |
Parameters (std::ifstream &rStringStream) | |
File constructor. It takes a file stream as input, which parses into a nlohmann::json class. More... | |
Parameters (Parameters const &rOther) | |
Copy constructor. More... | |
Parameters (Parameters &&rOther) | |
Move constructor. More... | |
virtual | ~Parameters () |
Destructor. More... | |
Operators | |
Parameters & | operator= (Parameters const &rOther) |
Assignment operator. More... | |
Parameters | operator[] (const std::string &rEntry) |
This metrod returns the Parameter corresponding to a given key. More... | |
Parameters | operator[] (const std::string &rEntry) const |
This metrod returns the Parameter corresponding to a given key (const version) More... | |
Parameters | operator[] (const IndexType Index) |
This method allows to access to an array item with the operator []. More... | |
Parameters | operator[] (const IndexType Index) const |
This method allows to access to an array item with the operator [] (const version) More... | |
Parameters & | operator= (Parameters &&rOther) |
This is the move operator. More... | |
Operations | |
Parameters | Clone () const |
Generates a clone of the current document. More... | |
const std::string | WriteJsonString () const |
This method returns a string with the corresponding text to the equivalent *.json file. More... | |
const std::string | PrettyPrintJsonString () const |
This method returns a string with the corresponding text to the equivalent *.json file (this version is prettier, and considers tabulations) More... | |
Parameters | GetValue (const std::string &rEntry) |
This method returns the Parameter corresponding to a certain entry. More... | |
Parameters | GetValue (const std::string &rEntry) const |
This method returns the Parameter corresponding to a certain entry (const version) More... | |
void | SetValue (const std::string &rEntry, const Parameters &rOtherValue) |
This method sets an existing parameter with a given parameter. More... | |
void | AddValue (const std::string &rEntry, const Parameters &rOtherValue) |
This method sets a non-existing parameter with a given parameter. More... | |
Parameters | AddEmptyValue (const std::string &rEntry) |
This method adds an empty parameter. More... | |
bool | RemoveValue (const std::string &rEntry) |
This method removes an entry of the Parameters given a certain key. More... | |
bool | RemoveValues (const std::vector< std::string > &rEntries) |
This method removes several entries of the Parameters given a certain list of keys. More... | |
json_iteration_proxy | items () noexcept |
This method returns the items of the current parameter. More... | |
json_const_iteration_proxy | items () const noexcept |
This method returns the items of the current parameter (const) More... | |
bool | Has (const std::string &rEntry) const |
This method checks if the Parameter contains a certain entry. More... | |
bool | IsNull () const |
This method checks if the parameter is a null. More... | |
bool | IsNumber () const |
This method checks if the parameter is a number. More... | |
bool | IsDouble () const |
This method checks if the parameter is a double. More... | |
bool | IsInt () const |
This method checks if the parameter is a integer. More... | |
bool | IsBool () const |
This method checks if the parameter is a boolean. More... | |
bool | IsString () const |
This method checks if the parameter is a string. More... | |
bool | IsArray () const |
This method checks if the parameter is an array. More... | |
bool | IsStringArray () const |
This method checks if the parameter is an array of strings. More... | |
bool | IsVector () const |
This method checks if the parameter is a vector. More... | |
bool | IsMatrix () const |
This method checks if the parameter is a matrix. More... | |
template<class TValue > | |
bool | Is () const |
Templetized type checker for supported types. More... | |
bool | IsSubParameter () const |
This method checks if the parameter is a subparameter. More... | |
double | GetDouble () const |
This method returns the double contained in the current Parameter. More... | |
int | GetInt () const |
This method returns the integer contained in the current Parameter. More... | |
bool | GetBool () const |
This method returns the boolean contained in the current Parameter. More... | |
std::string | GetString () const |
This method returns the string contained in the current Parameter. More... | |
std::vector< std::string > | GetStringArray () const |
This method returns the array of strings in the current Parameter. More... | |
Vector | GetVector () const |
This method returns the vector contained in the current Parameter. More... | |
Matrix | GetMatrix () const |
This method returns the matrix contained in the current Parameter. More... | |
template<class TValue > | |
TValue | Get () const |
Templetized getter for supported types. More... | |
void | SetDouble (const double Value) |
This method sets the double contained in the current Parameter. More... | |
void | SetInt (const int Value) |
This method sets the integer contained in the current Parameter. More... | |
void | SetBool (const bool Value) |
This method sets the bool contained in the current Parameter. More... | |
void | SetString (const std::string &rValue) |
This method sets the string contained in the current Parameter. More... | |
void | SetStringArray (const std::vector< std::string > &rValue) |
This method sets the string array contained in the current Parameter. More... | |
void | SetVector (const Vector &rValue) |
This method sets the vector contained in the current Parameter. More... | |
void | SetMatrix (const Matrix &rValue) |
This method sets the matrix contained in the current Parameter. More... | |
template<class TValue > | |
void | Set (const TValue &rValue) |
Templetized setter for supported types. More... | |
void | AddDouble (const std::string &rEntry, const double Value) |
This method adds a new double Parameter. More... | |
void | AddInt (const std::string &rEntry, const int Value) |
This method adds a new integer Parameter. More... | |
void | AddBool (const std::string &rEntry, const bool Value) |
This method adds a new bool Parameter. More... | |
void | AddString (const std::string &rEntry, const std::string &rValue) |
This method adds a new string Parameter. More... | |
void | AddStringArray (const std::string &rEntry, const std::vector< std::string > &rValue) |
This method sets the string array contained in the current Parameter. More... | |
void | AddVector (const std::string &rEntry, const Vector &rValue) |
This method adds a new vector Parameter. More... | |
void | AddMatrix (const std::string &rEntry, const Matrix &rValue) |
This method adds a new matrix Parameter. More... | |
iterator | begin () |
This returns the begin iterator. More... | |
iterator | end () |
This returns the end iterator. More... | |
const_iterator | begin () const |
This returns the constant begin iterator. More... | |
const_iterator | end () const |
This returns the constant end iterator. More... | |
SizeType | size () const |
This method returns the total size of the current array parameter. More... | |
void | swap (Parameters &rOther) noexcept |
This method does a swap between two parameters. More... | |
void | Reset () noexcept |
This method resets the whole parameter (it assigns an empty parameter) More... | |
Parameters | GetArrayItem (const IndexType Index) |
This method returns an array item given an index. More... | |
Parameters | GetArrayItem (const IndexType Index) const |
This method returns an array item given an index (const version) More... | |
void | SetArrayItem (const IndexType Index, const Parameters &rOtherArrayItem) |
This method sets an array item given an index. More... | |
void | AddEmptyArray (const std::string &rEntry) |
This method add a new entry with no value assigned. More... | |
void | Append (const double Value) |
This method appends into an array a double value. More... | |
void | Append (const int Value) |
This method appends into an array a integer value. More... | |
void | Append (const bool Value) |
This method appends into an array a boolean value. More... | |
void | Append (const std::string &rValue) |
This method appends into an array a string value. More... | |
void | Append (const Vector &rValue) |
This method appends into an array a vector value. More... | |
void | Append (const Matrix &rValue) |
This method appends into an array a matrix value. More... | |
void | Append (const Parameters &rValue) |
This method appends into an array a Parameter value. More... | |
void | CopyValuesFromExistingParameters (const Parameters OriginParameters, const std::vector< std::string > &rListParametersToCopy) |
This method can be used in order to copy the values from existing Parameters object. More... | |
void | RecursivelyFindValue (const nlohmann::json &rBaseValue, const nlohmann::json &rValueToFind) const |
This method looks in a recursive way in the json structure. More... | |
bool | IsEquivalentTo (Parameters &rParameters) |
Checks if the names and values are the same, no importance to the order. More... | |
bool | HasSameKeysAndTypeOfValuesAs (Parameters &rParameters) |
Checks if the names and the type of values are the same, no importance to the order. More... | |
void | ValidateAndAssignDefaults (const Parameters &rDefaultParameters) |
This function is designed to verify that the parameters under testing match the form prescribed by the rDefaultParameters. More... | |
void | RecursivelyValidateAndAssignDefaults (const Parameters &rDefaultParameters) |
This function is designed to verify that the parameters under testing match the form prescribed by the defaults. More... | |
void | AddMissingParameters (const Parameters &rDefaultParameters) |
This function is designed to verify that the parameters under testing contain at least all parameters prescribed by the rDefaultParameters. More... | |
void | RecursivelyAddMissingParameters (const Parameters &rDefaultParameters) |
This function is designed to verify that the parameters under testing contain at least all parameters prescribed by the rDefaultParameters. More... | |
void | ValidateDefaults (const Parameters &rDefaultParameters) const |
This function is designed to verify that the all parameteters in the parameters under testing have a matching parameter prescribed by the rDefaultParameters. More... | |
void | RecursivelyValidateDefaults (const Parameters &rDefaultParameters) const |
This function is designed to verify that the all parameteters in the parameters under testing have a matching parameter prescribed by the rDefaultParameters. More... | |
Input and output | |
virtual std::string | Info () const |
Turn back information as a string. More... | |
virtual void | PrintInfo (std::ostream &rOStream) const |
Print information about this object. More... | |
virtual void | PrintData (std::ostream &rOStream) const |
Print object's data. More... | |
Type Definitions | |
typedef std::size_t | IndexType |
Index definition. More... | |
typedef std::size_t | SizeType |
Size definition. More... | |
using | iterator = iterator_adaptor |
Definition of the iterators. More... | |
using | const_iterator = const_iterator_adaptor |
typedef nlohmann::detail::iter_impl< nlohmann::json > | json_iterator |
Iterators from nlohmann::json. More... | |
typedef nlohmann::detail::iter_impl< const nlohmann::json > | json_const_iterator |
typedef nlohmann::detail::iteration_proxy< json_iterator > | json_iteration_proxy |
typedef nlohmann::detail::iteration_proxy< json_const_iterator > | json_const_iteration_proxy |
KRATOS_CLASS_POINTER_DEFINITION (Parameters) | |
Pointer definition of MmgProcess. More... | |
Static Member Variables | |
class | Serializer |
This class provides to Kratos a data structure for I/O based on the standard of JSON.
In computing, JavaScript Object Notation or JSON is an open-standard file format that uses human-readable text to transmit data objects consisting of attribute–value pairs and array data types (or any other serializable value). It is a very common data format used for asynchronous browser–server communication, including as a replacement for XML in some AJAX-style systems. More info: https://json.org/ This class uses nlohmann JSON header only library
using Kratos::Parameters::const_iterator = const_iterator_adaptor |
typedef std::size_t Kratos::Parameters::IndexType |
Index definition.
using Kratos::Parameters::iterator = iterator_adaptor |
Definition of the iterators.
typedef nlohmann::detail::iteration_proxy<json_const_iterator> Kratos::Parameters::json_const_iteration_proxy |
typedef nlohmann::detail::iter_impl<const nlohmann::json> Kratos::Parameters::json_const_iterator |
typedef nlohmann::detail::iteration_proxy<json_iterator> Kratos::Parameters::json_iteration_proxy |
typedef nlohmann::detail::iter_impl<nlohmann::json> Kratos::Parameters::json_iterator |
Iterators from nlohmann::json.
typedef std::size_t Kratos::Parameters::SizeType |
Size definition.
Kratos::Parameters::Parameters | ( | ) |
Default constructor.
It assigns null pointers to the member variables
Kratos::Parameters::Parameters | ( | const std::string & | rJsonString | ) |
String constructor. It takes a string as input, which parses into a nlohmann::json class.
rJsonString | The string to be parsed into a nlohmann::json class |
Kratos::Parameters::Parameters | ( | std::ifstream & | rStringStream | ) |
File constructor. It takes a file stream as input, which parses into a nlohmann::json class.
rStringStream | The stream to the JSON file |
Kratos::Parameters::Parameters | ( | Parameters const & | rOther | ) |
Copy constructor.
Kratos::Parameters::Parameters | ( | Parameters && | rOther | ) |
Move constructor.
|
inlinevirtual |
Destructor.
void Kratos::Parameters::AddBool | ( | const std::string & | rEntry, |
const bool | Value | ||
) |
This method adds a new bool Parameter.
rEntry | The key identifier of the parameter |
Value | The bool value |
void Kratos::Parameters::AddDouble | ( | const std::string & | rEntry, |
const double | Value | ||
) |
This method adds a new double Parameter.
rEntry | The key identifier of the parameter |
Value | The double value |
void Kratos::Parameters::AddEmptyArray | ( | const std::string & | rEntry | ) |
This method add a new entry with no value assigned.
rEntry | The key identifier of the parameter |
Parameters Kratos::Parameters::AddEmptyValue | ( | const std::string & | rEntry | ) |
This method adds an empty parameter.
rEntry | The key identifier of the parameter |
void Kratos::Parameters::AddInt | ( | const std::string & | rEntry, |
const int | Value | ||
) |
This method adds a new integer Parameter.
rEntry | The key identifier of the parameter |
Value | The integer value |
void Kratos::Parameters::AddMatrix | ( | const std::string & | rEntry, |
const Matrix & | rValue | ||
) |
This method adds a new matrix Parameter.
rEntry | The key identifier of the parameter |
Value | The matrix value |
void Kratos::Parameters::AddMissingParameters | ( | const Parameters & | rDefaultParameters | ) |
This function is designed to verify that the parameters under testing contain at least all parameters prescribed by the rDefaultParameters.
If a parameter is found in the rDefaultParameters but not in the Parameters been tested, it is copied to the parameters. This version of the function only walks one level, without descending in the branches
rDefaultParameters | Parameters of reference which we use to check |
void Kratos::Parameters::AddString | ( | const std::string & | rEntry, |
const std::string & | rValue | ||
) |
This method adds a new string Parameter.
rEntry | The key identifier of the parameter |
rValue | The string value |
void Kratos::Parameters::AddStringArray | ( | const std::string & | rEntry, |
const std::vector< std::string > & | rValue | ||
) |
This method sets the string array contained in the current Parameter.
rEntry | The key identifier of the parameter |
Value | The string array |
void Kratos::Parameters::AddValue | ( | const std::string & | rEntry, |
const Parameters & | rOtherValue | ||
) |
This method sets a non-existing parameter with a given parameter.
rEntry | The key identifier of the parameter |
rOtherValue | The value to set |
void Kratos::Parameters::AddVector | ( | const std::string & | rEntry, |
const Vector & | rValue | ||
) |
This method adds a new vector Parameter.
rEntry | The key identifier of the parameter |
rValue | The vector value |
void Kratos::Parameters::Append | ( | const bool | Value | ) |
This method appends into an array a boolean value.
Value | The boolean value to append |
void Kratos::Parameters::Append | ( | const double | Value | ) |
This method appends into an array a double value.
Value | The double value to append |
void Kratos::Parameters::Append | ( | const int | Value | ) |
This method appends into an array a integer value.
Value | The integer value to append |
void Kratos::Parameters::Append | ( | const Matrix & | rValue | ) |
This method appends into an array a matrix value.
rValue | The matrix value to append |
void Kratos::Parameters::Append | ( | const Parameters & | rValue | ) |
This method appends into an array a Parameter value.
rValue | The Parameter value to append |
void Kratos::Parameters::Append | ( | const std::string & | rValue | ) |
This method appends into an array a string value.
rValue | The string value to append |
void Kratos::Parameters::Append | ( | const Vector & | rValue | ) |
This method appends into an array a vector value.
rValue | The vector value to append |
Parameters::iterator Kratos::Parameters::begin | ( | ) |
This returns the begin iterator.
Parameters::const_iterator Kratos::Parameters::begin | ( | ) | const |
This returns the constant begin iterator.
Parameters Kratos::Parameters::Clone | ( | ) | const |
Generates a clone of the current document.
void Kratos::Parameters::CopyValuesFromExistingParameters | ( | const Parameters | OriginParameters, |
const std::vector< std::string > & | rListParametersToCopy | ||
) |
This method can be used in order to copy the values from existing Parameters object.
OriginParameters | The Parameters to be copied |
rListParametersToCopy | The list of Parameters to copy |
Parameters::iterator Kratos::Parameters::end | ( | ) |
This returns the end iterator.
Parameters::const_iterator Kratos::Parameters::end | ( | ) | const |
This returns the constant end iterator.
TValue Kratos::Parameters::Get | ( | ) | const |
Parameters Kratos::Parameters::GetArrayItem | ( | const IndexType | Index | ) |
This method returns an array item given an index.
Index | The index of the parameter to obtain |
Parameters Kratos::Parameters::GetArrayItem | ( | const IndexType | Index | ) | const |
This method returns an array item given an index (const version)
Index | The index of the parameter to obtain |
bool Kratos::Parameters::GetBool | ( | ) | const |
This method returns the boolean contained in the current Parameter.
double Kratos::Parameters::GetDouble | ( | ) | const |
This method returns the double contained in the current Parameter.
int Kratos::Parameters::GetInt | ( | ) | const |
This method returns the integer contained in the current Parameter.
Matrix Kratos::Parameters::GetMatrix | ( | ) | const |
This method returns the matrix contained in the current Parameter.
std::string Kratos::Parameters::GetString | ( | ) | const |
This method returns the string contained in the current Parameter.
std::vector< std::string > Kratos::Parameters::GetStringArray | ( | ) | const |
This method returns the array of strings in the current Parameter.
Parameters Kratos::Parameters::GetValue | ( | const std::string & | rEntry | ) |
This method returns the Parameter corresponding to a certain entry.
rEntry | The key identifier of the parameter |
Parameters Kratos::Parameters::GetValue | ( | const std::string & | rEntry | ) | const |
This method returns the Parameter corresponding to a certain entry (const version)
rEntry | The key identifier of the parameter |
Vector Kratos::Parameters::GetVector | ( | ) | const |
This method returns the vector contained in the current Parameter.
bool Kratos::Parameters::Has | ( | const std::string & | rEntry | ) | const |
This method checks if the Parameter contains a certain entry.
rEntry | The key identifier of the parameter |
bool Kratos::Parameters::HasSameKeysAndTypeOfValuesAs | ( | Parameters & | rParameters | ) |
Checks if the names and the type of values are the same, no importance to the order.
Lists have to be ordered, though! Take into account that in Kratos some physical vectors are represented with a list.
rParameters | The parameters to be checked |
|
inlinevirtual |
Turn back information as a string.
bool Kratos::Parameters::Is | ( | ) | const |
bool Kratos::Parameters::Is | ( | ) | const |
bool Kratos::Parameters::IsArray | ( | ) | const |
This method checks if the parameter is an array.
bool Kratos::Parameters::IsBool | ( | ) | const |
This method checks if the parameter is a boolean.
bool Kratos::Parameters::IsDouble | ( | ) | const |
This method checks if the parameter is a double.
bool Kratos::Parameters::IsEquivalentTo | ( | Parameters & | rParameters | ) |
Checks if the names and values are the same, no importance to the order.
Lists have to be ordered, though! Take into account that in Kratos some physical vectors are represented with a list.
rParameters | The parameters to be checked |
bool Kratos::Parameters::IsInt | ( | ) | const |
This method checks if the parameter is a integer.
bool Kratos::Parameters::IsMatrix | ( | ) | const |
This method checks if the parameter is a matrix.
bool Kratos::Parameters::IsNull | ( | ) | const |
This method checks if the parameter is a null.
bool Kratos::Parameters::IsNumber | ( | ) | const |
This method checks if the parameter is a number.
bool Kratos::Parameters::IsString | ( | ) | const |
This method checks if the parameter is a string.
bool Kratos::Parameters::IsStringArray | ( | ) | const |
This method checks if the parameter is an array of strings.
bool Kratos::Parameters::IsSubParameter | ( | ) | const |
This method checks if the parameter is a subparameter.
bool Kratos::Parameters::IsVector | ( | ) | const |
This method checks if the parameter is a vector.
|
noexcept |
This method returns the items of the current parameter (const)
|
noexcept |
This method returns the items of the current parameter.
Kratos::Parameters::KRATOS_CLASS_POINTER_DEFINITION | ( | Parameters | ) |
Pointer definition of MmgProcess.
Parameters & Kratos::Parameters::operator= | ( | Parameters && | rOther | ) |
This is the move operator.
rOther | The other parameter to compute the move |
Parameters & Kratos::Parameters::operator= | ( | Parameters const & | rOther | ) |
Assignment operator.
Parameters Kratos::Parameters::operator[] | ( | const IndexType | Index | ) |
This method allows to access to an array item with the operator [].
Index | The index of the term of interest |
Parameters Kratos::Parameters::operator[] | ( | const IndexType | Index | ) | const |
This method allows to access to an array item with the operator [] (const version)
Index | The index of the term of interest |
Parameters Kratos::Parameters::operator[] | ( | const std::string & | rEntry | ) |
This metrod returns the Parameter corresponding to a given key.
rEntry | The key identifier of the parameter |
Parameters Kratos::Parameters::operator[] | ( | const std::string & | rEntry | ) | const |
This metrod returns the Parameter corresponding to a given key (const version)
rEntry | The key identifier of the parameter |
const std::string Kratos::Parameters::PrettyPrintJsonString | ( | ) | const |
This method returns a string with the corresponding text to the equivalent *.json file (this version is prettier, and considers tabulations)
|
inlinevirtual |
Print object's data.
|
inlinevirtual |
Print information about this object.
void Kratos::Parameters::RecursivelyAddMissingParameters | ( | const Parameters & | rDefaultParameters | ) |
This function is designed to verify that the parameters under testing contain at least all parameters prescribed by the rDefaultParameters.
If a parameter is found in the rDefaultParameters but not in the Parameters been tested, it is copied to the parameters. This version walks and validates the entire json tree below the point at which the function is called
rDefaultParameters | Parameters of reference which we use to check |
void Kratos::Parameters::RecursivelyFindValue | ( | const nlohmann::json & | rBaseValue, |
const nlohmann::json & | rValueToFind | ||
) | const |
This method looks in a recursive way in the json structure.
rBaseValue | The value where to find |
rValueToFind | The value to look |
void Kratos::Parameters::RecursivelyValidateAndAssignDefaults | ( | const Parameters & | rDefaultParameters | ) |
This function is designed to verify that the parameters under testing match the form prescribed by the defaults.
If the parameters contain values that do not appear in the defaults, an error is thrown, whereas if a parameter is found in the defaults but not in the Parameters been tested, it is copied to the parameters. This version walks and validates the entire json tree below the point at which the function is called
rDefaultParameters | Parameters of reference which we use to check |
void Kratos::Parameters::RecursivelyValidateDefaults | ( | const Parameters & | rDefaultParameters | ) | const |
This function is designed to verify that the all parameteters in the parameters under testing have a matching parameter prescribed by the rDefaultParameters.
If the parameters contain values that do not appear in the defaults, an error is thrown. This version walks and validates the entire json tree below the point at which the function is called
rDefaultParameters | Parameters of reference which we use to check |
bool Kratos::Parameters::RemoveValue | ( | const std::string & | rEntry | ) |
This method removes an entry of the Parameters given a certain key.
rEntry | The key identifier of the parameter |
bool Kratos::Parameters::RemoveValues | ( | const std::vector< std::string > & | rEntries | ) |
This method removes several entries of the Parameters given a certain list of keys.
rEntries | The keys identifier of the parameters |
|
noexcept |
This method resets the whole parameter (it assigns an empty parameter)
void Kratos::Parameters::Set | ( | const TValue & | rValue | ) |
void Kratos::Parameters::SetArrayItem | ( | const IndexType | Index, |
const Parameters & | rOtherArrayItem | ||
) |
This method sets an array item given an index.
Index | The index of the parameter to set |
rOtherArrayItem | The parameter corresponding to the given index |
void Kratos::Parameters::SetBool | ( | const bool | Value | ) |
This method sets the bool contained in the current Parameter.
Value | The bool value |
void Kratos::Parameters::SetDouble | ( | const double | Value | ) |
This method sets the double contained in the current Parameter.
Value | The double value |
void Kratos::Parameters::SetInt | ( | const int | Value | ) |
This method sets the integer contained in the current Parameter.
Value | The integer value |
void Kratos::Parameters::SetMatrix | ( | const Matrix & | rValue | ) |
This method sets the matrix contained in the current Parameter.
Value | The matrix value |
void Kratos::Parameters::SetString | ( | const std::string & | rValue | ) |
This method sets the string contained in the current Parameter.
rValue | The string value |
void Kratos::Parameters::SetStringArray | ( | const std::vector< std::string > & | rValue | ) |
This method sets the string array contained in the current Parameter.
Value | The string array |
void Kratos::Parameters::SetValue | ( | const std::string & | rEntry, |
const Parameters & | rOtherValue | ||
) |
This method sets an existing parameter with a given parameter.
rEntry | The key identifier of the parameter |
rOtherValue | The value to set |
void Kratos::Parameters::SetVector | ( | const Vector & | rValue | ) |
This method sets the vector contained in the current Parameter.
rValue | The vector value |
Parameters::SizeType Kratos::Parameters::size | ( | ) | const |
This method returns the total size of the current array parameter.
|
noexcept |
This method does a swap between two parameters.
rOther | The other parameter to compute the swap |
void Kratos::Parameters::ValidateAndAssignDefaults | ( | const Parameters & | rDefaultParameters | ) |
This function is designed to verify that the parameters under testing match the form prescribed by the rDefaultParameters.
If the parameters contain values that do not appear in the rDefaultParameters, an error is thrown, whereas if a parameter is found in the rDefaultParameters but not in the Parameters been tested, it is copied to the parameters. This version of the function only walks one level, without descending in the branches
rDefaultParameters | Parameters of reference which we use to check |
void Kratos::Parameters::ValidateDefaults | ( | const Parameters & | rDefaultParameters | ) | const |
This function is designed to verify that the all parameteters in the parameters under testing have a matching parameter prescribed by the rDefaultParameters.
If the parameters contain values that do not appear in the defaults, an error is thrown. This version of the function only walks one level, without descending in the branches
rDefaultParameters | Parameters of reference which we use to check |
const std::string Kratos::Parameters::WriteJsonString | ( | ) | const |
This method returns a string with the corresponding text to the equivalent *.json file.
|
friend |