20 #include "json/json_fwd.hpp"
69 class KRATOS_API(KRATOS_CORE) iterator_adaptor
75 using iterator_category = std::forward_iterator_tag;
76 using difference_type = std::ptrdiff_t;
81 using value_iterator = nlohmann::detail::iter_impl<nlohmann::json>;
98 iterator_adaptor(
const iterator_adaptor& itValue);
109 iterator_adaptor& operator++();
117 iterator_adaptor operator++(
int);
155 inline value_iterator GetCurrentIterator()
const;
161 const std::string name();
169 std::size_t mDistance = 0;
170 nlohmann::json& mrValue;
171 std::unique_ptr<Parameters> mpParameters;
182 class KRATOS_API(KRATOS_CORE) const_iterator_adaptor
188 using iterator_category = std::forward_iterator_tag;
189 using difference_type = std::ptrdiff_t;
194 using value_iterator = nlohmann::detail::iter_impl<const nlohmann::json>;
212 const_iterator_adaptor(
const const_iterator_adaptor& itValue);
223 const_iterator_adaptor& operator++();
231 const_iterator_adaptor operator++(
int);
269 inline value_iterator GetCurrentIterator()
const;
275 const std::string name();
282 std::size_t mDistance = 0;
283 nlohmann::json& mrValue;
284 std::unique_ptr<Parameters> mpParameters;
361 Parameters operator[](
const std::string& rEntry);
368 Parameters operator[](
const std::string& rEntry)
const;
404 const std::string WriteJsonString()
const;
410 const std::string PrettyPrintJsonString()
const;
432 const std::string& rEntry,
442 const std::string& rEntry,
450 Parameters AddEmptyValue(
const std::string& rEntry);
457 bool RemoveValue(
const std::string& rEntry);
464 bool RemoveValues(
const std::vector<std::string>& rEntries);
470 json_iteration_proxy
items() noexcept;
476 json_const_iteration_proxy
items()
const noexcept;
495 bool IsNumber()
const;
501 bool IsDouble()
const;
519 bool IsString()
const;
525 bool IsArray()
const;
531 bool IsStringArray()
const;
543 bool IsMatrix()
const;
550 template <class TValue>
557 bool IsSubParameter()
const;
563 double GetDouble()
const;
575 bool GetBool()
const;
606 template <class TValue>
613 void SetDouble(
const double Value);
619 void SetInt(
const int Value);
625 void SetBool(
const bool Value);
631 void SetString(
const std::
string& rValue);
637 void SetStringArray(
const std::vector<
std::
string>& rValue);
657 template <class TValue>
769 void Reset() noexcept;
799 void AddEmptyArray(
const std::
string& rEntry);
848 void CopyValuesFromExistingParameters(
850 const std::vector<
std::
string>& rListParametersToCopy
858 void RecursivelyFindValue(
859 const nlohmann::json& rBaseValue,
860 const nlohmann::json& rValueToFind
877 bool HasSameKeysAndTypeOfValuesAs(
Parameters& rParameters);
909 void RecursivelyAddMissingParameters(
const Parameters& rDefaultParameters);
943 return this->PrettyPrintJsonString();
949 rOStream <<
"Parameters Object " <<
Info();
972 nlohmann::json* mpValue;
1012 nlohmann::json* GetUnderlyingStorage();
1019 nlohmann::json* GetUnderlyingStorage()
const;
1026 void SetUnderlyingSotrage(nlohmann::json* pNewValue);
1053 void InternalSetValue(
const Parameters& rOtherValue);
1062 void SolveIncludes(nlohmann::json& rJson,
const std::filesystem::path& rFileName, std::vector<std::filesystem::path>& rIncludeSequence);
1095 rOStream << std::endl;
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
std::string Info() const override
Turn back information as a string.
Definition: periodic_interface_process.hpp:93
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
nlohmann::detail::iteration_proxy< json_const_iterator > json_const_iteration_proxy
Definition: kratos_parameters.h:312
virtual void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: kratos_parameters.h:947
KRATOS_CLASS_POINTER_DEFINITION(Parameters)
Pointer definition of MmgProcess.
nlohmann::detail::iter_impl< const nlohmann::json > json_const_iterator
Definition: kratos_parameters.h:310
nlohmann::detail::iter_impl< nlohmann::json > json_iterator
Iterators from nlohmann::json.
Definition: kratos_parameters.h:309
std::size_t SizeType
Size definition.
Definition: kratos_parameters.h:299
std::size_t IndexType
Index definition.
Definition: kratos_parameters.h:296
virtual void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: kratos_parameters.h:953
virtual ~Parameters()
Destructor.
Definition: kratos_parameters.h:343
const_iterator_adaptor const_iterator
Definition: kratos_parameters.h:306
iterator_adaptor iterator
Definition of the iterators.
Definition: kratos_parameters.h:305
nlohmann::detail::iteration_proxy< json_iterator > json_iteration_proxy
Definition: kratos_parameters.h:311
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
std::size_t IndexType
The definition of the index type.
Definition: key_hash.h:35
end
Definition: DEM_benchmarks.py:180
string path
Definition: DEM_run_all_benchmarks_analysis.py:10
bool Has(const std::string &ModelerName)
Checks if the modeler is registered.
Definition: modeler_factory.cpp:24
void AddValue(GeometryType &rThisGeometry, const TVarType &rThisVariable, const Matrix &rThisValue)
This method adds the value.
pybind11::list items(Parameters const &self)
Definition: add_kratos_parameters_to_python.cpp:24
Parameters GetArrayItem(Parameters &rParameters, const std::size_t Index)
Definition: add_kratos_parameters_to_python.cpp:57
void Append(Parameters &rParameters, const T &obj)
Definition: add_kratos_parameters_to_python.cpp:49
Parameters GetValue(Parameters &rParameters, const std::string &rEntry)
Definition: add_kratos_parameters_to_python.cpp:53
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
Expression::Pointer operator*(const Expression::ConstPointer &rpLeft, const double Right)
std::shared_ptr< T > shared_ptr
Definition: smart_pointers.h:27
bool operator==(const Flags &Left, const Flags &Right)
Definition: flags.cpp:45
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
bool operator!=(const Flags &Left, const Flags &Right)
Definition: flags.cpp:50
def SetValue(entity, variable, value)
Definition: coupling_interface_data.py:256
rhs
Definition: generate_frictional_mortar_condition.py:297
def load(f)
Definition: ode_solve.py:307
tuple const
Definition: ode_solve.py:403
def RecursivelyValidateAndAssignDefaults(defaults, settings)
Definition: sdof_solver.py:283
def ValidateAndAssignDefaults(defaults, settings, recursive=False)
Definition: sdof_solver.py:252
namespace
Definition: array_1d.h:793
def IsVector(_X)
Definition: custom_math.py:26