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.
properties.h
Go to the documentation of this file.
1 // | / |
2 // ' / __| _` | __| _ \ __|
3 // . \ | ( | | ( |\__ \.
4 // _|\_\_| \__,_|\__|\___/ ____/
5 // Multi-Physics
6 //
7 // License: BSD License
8 // Kratos default license: kratos/license.txt
9 //
10 // Main authors: Pooyan Dadvand
11 // Riccardo Rossi
12 //
13 
14 # pragma once
15 
16 // System includes
17 #include <string>
18 #include <iostream>
19 #include <cstddef>
20 #include <unordered_map>
21 
22 // External includes
23 
24 // Project includes
25 #include "includes/define.h"
26 #include "includes/accessor.h"
27 #include "includes/node.h"
30 #include "includes/process_info.h"
31 #include "includes/table.h"
33 
34 namespace Kratos
35 {
36 
39 
43 
47 
51 
55 
68 class Properties : public IndexedObject
69 {
70 public:
73 
76 
77 #ifdef _WIN32 // work around for windows int64_t error
78  using int64_t = __int64;
79 #endif
81 
83 
85 
86  using IndexType = std::size_t;
87 
89 
90  using KeyType = IndexType;
91 
92  using AccessorPointerType = Accessor::UniquePointer;
93 
94  using AccessorsContainerType = std::unordered_map<KeyType, AccessorPointerType>;
95 
96  using TablesContainerType = std::unordered_map<std::size_t, TableType>; // This is a provisional implementation and should be changed to hash. Pooyan.
97 
100 
104 
106  explicit Properties(IndexType NewId = 0)
107  : BaseType(NewId)
108  , mData()
109  , mTables()
110  , mSubPropertiesList()
111  , mAccessors() {}
112 
114  explicit Properties(IndexType NewId, const SubPropertiesContainerType& SubPropertiesList)
115  : BaseType(NewId)
116  , mData()
117  , mTables()
118  , mSubPropertiesList(SubPropertiesList)
119  , mAccessors() {}
120 
122  Properties(const Properties& rOther)
123  : BaseType(rOther)
124  , mData(rOther.mData)
125  , mTables(rOther.mTables)
126  , mSubPropertiesList(rOther.mSubPropertiesList)
127  {
128  for (auto& r_item : rOther.mAccessors) {
129  const auto key = r_item.first;
130  const auto& rp_accessor = r_item.second;
131  mAccessors.emplace(key, rp_accessor->Clone());
132  }
133  }
134 
136  ~Properties() override {}
137 
141 
144  {
145  BaseType::operator=(rOther);
146  mData = rOther.mData;
147  mTables = rOther.mTables;
148  mSubPropertiesList = rOther.mSubPropertiesList;
149  for (auto& r_item : rOther.mAccessors) {
150  const auto key = r_item.first;
151  const auto& rp_accessor = r_item.second;
152  mAccessors.emplace(key, rp_accessor->Clone());
153  }
154  return *this;
155  }
156 
157  template<class TVariableType>
158  typename TVariableType::Type& operator()(const TVariableType& rV)
159  {
160  return GetValue(rV);
161  }
162 
163  template<class TVariableType>
164  typename TVariableType::Type const& operator()(const TVariableType& rV) const
165  {
166  return GetValue(rV);
167  }
168 
169  template<class TVariableType>
170  typename TVariableType::Type& operator[](const TVariableType& rV)
171  {
172  return GetValue(rV);
173  }
174 
175  template<class TVariableType>
176  typename TVariableType::Type const& operator[](const TVariableType& rV) const
177  {
178  return GetValue(rV);
179  }
180 
181  template<class TVariableType>
182  typename TVariableType::Type& operator()(const TVariableType& rV, Node& rThisNode)
183  {
184  return GetValue(rV, rThisNode);
185  }
186 
187  template<class TVariableType>
188  typename TVariableType::Type const& operator()(const TVariableType& rV, Node const& rThisNode) const
189  {
190  return GetValue(rV, rThisNode);
191  }
192 
193  template<class TVariableType>
194  typename TVariableType::Type& operator()(const TVariableType& rV, Node& rThisNode, IndexType SolutionStepIndex)
195  {
196  return GetValue(rV, rThisNode, SolutionStepIndex);
197  }
198 
199  template<class TVariableType>
200  typename TVariableType::Type const& operator()(const TVariableType& rV, Node const& rThisNode, IndexType SolutionStepIndex) const
201  {
202  return GetValue(rV, rThisNode, SolutionStepIndex);
203  }
204 
205  template<class TVariableType>
206  typename TVariableType::Type& operator()(const TVariableType& rV, Node& rThisNode, ProcessInfo const& rCurrentProcessInfo)
207  {
208  return GetValue(rV, rThisNode, rCurrentProcessInfo.GetSolutionStepIndex());
209  }
210 
211  template<class TVariableType>
212  typename TVariableType::Type const& operator()(const TVariableType& rV, Node const& rThisNode, ProcessInfo const& rCurrentProcessInfo) const
213  {
214  return GetValue(rV, rThisNode, rCurrentProcessInfo.GetSolutionStepIndex());
215  }
216 
220 
221  template<class TVariableType>
222  void Erase(const TVariableType& rV)
223  {
224  mData.Erase(rV);
225  }
226 
227  template<class TVariableType>
228  typename TVariableType::Type& GetValue(const TVariableType& rVariable)
229  {
230  return mData.GetValue(rVariable);
231  }
232 
233  template<class TVariableType>
234  typename TVariableType::Type const& GetValue(const TVariableType& rVariable) const
235  {
236 
237  return mData.GetValue(rVariable);
238  }
239 
240  template<class TVariableType>
241  typename TVariableType::Type& GetValue(const TVariableType& rVariable, Node& rThisNode)
242  {
243  if (mData.Has(rVariable))
244  return mData.GetValue(rVariable);
245  return rThisNode.GetValue(rVariable);
246  }
247 
248  template<class TVariableType>
249  typename TVariableType::Type const& GetValue(const TVariableType& rVariable, Node const& rThisNode) const
250  {
251  if (mData.Has(rVariable))
252  return mData.GetValue(rVariable);
253  return rThisNode.GetValue(rVariable);
254  }
255 
256  template<class TVariableType>
257  typename TVariableType::Type& GetValue(const TVariableType& rVariable, Node& rThisNode, IndexType SolutionStepIndex)
258  {
259  if (mData.Has(rVariable))
260  return mData.GetValue(rVariable);
261  return rThisNode.GetValue(rVariable, SolutionStepIndex);
262  }
263 
264  template<class TVariableType>
265  typename TVariableType::Type const& GetValue(const TVariableType& rVariable, Node const& rThisNode, IndexType SolutionStepIndex) const
266  {
267  if (mData.Has(rVariable))
268  return mData.GetValue(rVariable);
269  return rThisNode.GetValue(rVariable, SolutionStepIndex);
270  }
271 
272  /*
273  Custom GetValue in which we check the Accessor
274  */
275  template<class TVariableType>
276  typename TVariableType::Type GetValue(const TVariableType& rVariable, const GeometryType& rGeometry, const Vector& rShapeFunctionVector, const ProcessInfo& rProcessInfo) const
277  {
278  auto it_value = mAccessors.find(rVariable.Key());
279  if (it_value != mAccessors.end()) {
280  return (it_value->second)->GetValue(rVariable, *this, rGeometry, rShapeFunctionVector, rProcessInfo);
281  } else {
282  return mData.GetValue(rVariable);
283  }
284  }
285 
286  template<class TVariableType>
287  void SetValue(TVariableType const& rV, typename TVariableType::Type const& rValue)
288  {
289  mData.SetValue(rV, rValue);
290  }
291 
292  bool HasVariables() const
293  {
294  return !mData.IsEmpty();
295  }
296 
304  template <class TVariableType>
305  void SetAccessor(const TVariableType& rVariable, AccessorPointerType pAccessor)
306  {
307  mAccessors.emplace(rVariable.Key(), std::move(pAccessor));
308  }
309 
318  template <class TVariableType>
319  Accessor& GetAccessor(const TVariableType& rVariable)
320  {
321  auto it_value = mAccessors.find(rVariable.Key());
322  KRATOS_ERROR_IF(it_value == mAccessors.end())
323  << "Trying to retrieve inexisting accessor for '" << rVariable.Name() << "' in properties " << Id() << "." << std::endl;
324  return *(it_value->second);
325  }
326 
335  template <class TVariableType>
336  Accessor& GetAccessor(const TVariableType& rVariable) const
337  {
338  const auto it_value = mAccessors.find(rVariable.Key());
339  KRATOS_ERROR_IF(it_value == mAccessors.end())
340  << "Trying to retrieve inexisting accessor for '" << rVariable.Name() << "' in properties " << Id() << "." << std::endl;
341  return *(it_value->second);
342  }
343 
352  template <class TVariableType>
353  AccessorPointerType& pGetAccessor(const TVariableType& rVariable)
354  {
355  const auto it_value = mAccessors.find(rVariable.Key());
356  KRATOS_ERROR_IF(it_value == mAccessors.end())
357  << "Trying to retrieve inexisting accessor for '" << rVariable.Name() << "' in properties " << Id() << "." << std::endl;
358  return it_value->second;
359  }
360 
369  template <class TVariableType>
370  bool HasAccessor(const TVariableType& rVariable) const
371  {
372  return (mAccessors.find(rVariable.Key()) == mAccessors.end()) ? false : true;
373  }
374 
375  template<class TXVariableType, class TYVariableType>
376  TableType& GetTable(const TXVariableType& XVariable, const TYVariableType& YVariable)
377  {
378  return mTables[Key(XVariable.Key(), YVariable.Key())];
379  }
380 
381  template<class TXVariableType, class TYVariableType>
382  TableType const& GetTable(const TXVariableType& XVariable, const TYVariableType& YVariable) const
383  {
384  return mTables.at(Key(XVariable.Key(), YVariable.Key()));
385  }
386 
387  template<class TXVariableType, class TYVariableType>
388  void SetTable(const TXVariableType& XVariable, const TYVariableType& YVariable, TableType const& rThisTable)
389  {
390  mTables[Key(XVariable.Key(), YVariable.Key())] = rThisTable;
391  }
392 
393  bool HasTables() const
394  {
395  return !mTables.empty();
396  }
397 
398  bool IsEmpty() const
399  {
400  return !( HasVariables() || HasTables() );
401  }
402 
403  int64_t Key(std::size_t XKey, std::size_t YKey) const
404  {
405  int64_t result_key = XKey;
406  result_key = result_key << 32;
407  result_key |= YKey; // I know that the key is less than 2^32 so I don't need zeroing the upper part
408  return result_key;
409  }
410 
415  std::size_t NumberOfSubproperties() const
416  {
417  return mSubPropertiesList.size();
418  }
419 
424  void AddSubProperties(Properties::Pointer pNewSubProperty)
425  {
426  KRATOS_DEBUG_ERROR_IF(this->HasSubProperties(pNewSubProperty->Id())) << "SubProperties with ID: " << pNewSubProperty->Id() << " already defined" << std::endl;
427  mSubPropertiesList.insert(mSubPropertiesList.begin(), pNewSubProperty);
428  }
429 
435  bool HasSubProperties(const IndexType SubPropertyIndex) const
436  {
437  return mSubPropertiesList.find(SubPropertyIndex) != mSubPropertiesList.end();
438  }
439 
445  Properties::Pointer pGetSubProperties(const IndexType SubPropertyIndex)
446  {
447  // Looking into the database
448  auto property_iterator = mSubPropertiesList.find(SubPropertyIndex);
449  if (property_iterator != mSubPropertiesList.end()) {
450  return *(property_iterator.base());
451  } else {
452  KRATOS_ERROR << "Subproperty ID: " << SubPropertyIndex << " is not defined on the current Properties ID: " << this->Id() << " creating a new one with ID: " << SubPropertyIndex << std::endl;
453  return nullptr;
454  }
455  }
456 
462  const Properties::Pointer pGetSubProperties(const IndexType SubPropertyIndex) const
463  {
464  // Looking into the database
465  auto property_iterator = mSubPropertiesList.find(SubPropertyIndex);
466  if (property_iterator != mSubPropertiesList.end()) {
467  return *(property_iterator.base());
468  } else {
469  KRATOS_ERROR << "Subproperty ID: " << SubPropertyIndex << " is not defined on the current Properties ID: " << this->Id() << " creating a new one with ID: " << SubPropertyIndex << std::endl;
470  return nullptr;
471  }
472  }
473 
479  Properties& GetSubProperties(const IndexType SubPropertyIndex)
480  {
481  // Looking into the database
482  auto property_iterator = mSubPropertiesList.find(SubPropertyIndex);
483  if (property_iterator != mSubPropertiesList.end()) {
484  return *(property_iterator);
485  } else {
486  KRATOS_ERROR << "Subproperty ID: " << SubPropertyIndex << " is not defined on the current Properties ID: " << this->Id() << " creating a new one with ID: " << SubPropertyIndex << std::endl;
487  return *this;
488  }
489  }
490 
496  const Properties& GetSubProperties(const IndexType SubPropertyIndex) const
497  {
498  // Looking into the database
499  if (mSubPropertiesList.find(SubPropertyIndex) != mSubPropertiesList.end()) {
500  return *(mSubPropertiesList.find(SubPropertyIndex));
501  } else {
502  KRATOS_ERROR << "Subproperty ID: " << SubPropertyIndex << " is not defined on the current Properties ID: " << this->Id() << std::endl;
503  }
504  }
505 
511  {
512  return mSubPropertiesList;
513  }
514 
520  {
521  return mSubPropertiesList;
522  }
523 
529  {
530  mSubPropertiesList = rSubPropertiesList;
531  }
532 
536 
542  {
543  return mData;
544  }
545 
550  ContainerType const& Data() const
551  {
552  return mData;
553  }
554 
560  {
561  return mTables;
562  }
563 
569  {
570  return mTables;
571  }
572 
576 
577  template<class TVariableType>
578  bool Has(TVariableType const& rThisVariable) const
579  {
580  return mData.Has(rThisVariable);
581  }
582 
583  template<class TXVariableType, class TYVariableType>
584  bool HasTable(const TXVariableType& XVariable, const TYVariableType& YVariable) const
585  {
586  return (mTables.find(Key(XVariable.Key(), YVariable.Key())) != mTables.end());
587  }
588 
592 
594  std::string Info() const override
595  {
596  return "Properties";
597  }
598 
600  void PrintInfo(std::ostream& rOStream) const override
601  {
602  rOStream << "Properties";
603  }
604 
606  void PrintData(std::ostream& rOStream) const override
607  {
608  // Id
609  rOStream << "Id : " << this->Id() << "\n";
610 
611  // Data
612  mData.PrintData(rOStream);
613 
614  // Tables
615  if (mTables.size() > 0) {
616  // Print the tables
617  rOStream << "This properties contains " << mTables.size() << " tables\n";
618  for (auto& r_table : mTables) {
619  rOStream << "Table key: " << r_table.first << "\n";
620  StringUtilities::PrintDataWithIdentation(rOStream, r_table.second);
621  }
622  }
623 
624  // Subproperties
625  if (mSubPropertiesList.size() > 0) {
626  // Print the subproperties
627  rOStream << "\nThis properties contains " << mSubPropertiesList.size() << " subproperties\n";
628  for (auto& r_subprop : mSubPropertiesList) {
629  StringUtilities::PrintDataWithIdentation(rOStream, r_subprop);
630  }
631  }
632 
633  // Accessors
634  if (mAccessors.size() > 0) {
635  // Print the accessors
636  rOStream << "\nThis properties contains " << mAccessors.size() << " accessors\n";
637  for (auto& r_entry : mAccessors) {
638  rOStream << "Accessor for variable key: " << r_entry.first << "\n";
639  StringUtilities::PrintDataWithIdentation(rOStream, *r_entry.second);
640  }
641  }
642  }
643 
647 
649 protected:
652 
656 
660 
664 
668 
672 
676 
678 private:
681 
685 
686  ContainerType mData;
687 
688  TablesContainerType mTables;
689 
690  SubPropertiesContainerType mSubPropertiesList;
691 
692  AccessorsContainerType mAccessors = {};
693 
697 
701 
705 
706  friend class Serializer;
707 
708  void save(Serializer& rSerializer) const override
709  {
711  rSerializer.save("Data", mData);
712  rSerializer.save("Tables", mTables);
713  rSerializer.save("SubPropertiesList", mSubPropertiesList);
714  std::vector<std::pair<const KeyType, Accessor*>> aux_accessors_container;
715  for (auto& r_item : mAccessors) {
716  const auto key = r_item.first;
717  const auto& rp_accessor = r_item.second;
718  aux_accessors_container.push_back(std::make_pair(key, &(*rp_accessor)));
719  }
720  rSerializer.save("Accessors", aux_accessors_container);
721  }
722 
723  void load(Serializer& rSerializer) override
724  {
726  rSerializer.load("Data", mData);
727  rSerializer.load("Tables", mTables);
728  rSerializer.load("SubPropertiesList", mSubPropertiesList);
729  std::vector<std::pair<const KeyType, Accessor*>> aux_accessors_container;
730  rSerializer.load("Accessors", aux_accessors_container);
731  for (auto& r_item : aux_accessors_container) {
732  const auto key = r_item.first;
733  const auto& rp_accessor = r_item.second;
734  mAccessors.emplace(key, rp_accessor->Clone());
735  }
736  }
737 
741 
745 
749 
751 
752 }; // Class Properties
753 
755 
758 
762 
764 inline std::istream& operator >> (std::istream& rIStream,
765  Properties& rThis);
766 
768 inline std::ostream& operator << (std::ostream& rOStream,
769  const Properties& rThis)
770 {
771  rThis.PrintInfo(rOStream);
772  rOStream << std::endl;
773  rThis.PrintData(rOStream);
774 
775  return rOStream;
776 }
778 
779 } // namespace Kratos.
This class defines the way a certain property is accessed.
Definition: accessor.h:43
Container for storing data values associated with variables.
Definition: data_value_container.h:63
bool Has(const Variable< TDataType > &rThisVariable) const
Checks if the data container has a value associated with a given variable.
Definition: data_value_container.h:382
void Erase(const Variable< TDataType > &rThisVariable)
Erases the value associated with a given variable.
Definition: data_value_container.h:339
void SetValue(const Variable< TDataType > &rThisVariable, TDataType const &rValue)
Sets the value for a given variable.
Definition: data_value_container.h:320
virtual void PrintData(std::ostream &rOStream) const
Outputs the detailed data contents of the data value container to a given stream.
Definition: data_value_container.h:423
TDataType & GetValue(const Variable< TDataType > &rThisVariable)
Gets the value associated with a given variable.
Definition: data_value_container.h:268
bool IsEmpty() const
Checks if the data container is empty.
Definition: data_value_container.h:391
Geometry base class.
Definition: geometry.h:71
This object defines an indexed object.
Definition: indexed_object.h:54
IndexedObject & operator=(IndexedObject const &rOther)
Assignment operator.
Definition: indexed_object.h:86
IndexedObject(IndexType NewId=0)
Default constructor.
Definition: indexed_object.h:73
std::size_t IndexType
The definition of the index type.
Definition: indexed_object.h:63
IndexType Id() const
Definition: indexed_object.h:107
This class defines the node.
Definition: node.h:65
TVariableType::Type & GetValue(const TVariableType &rThisVariable)
Definition: node.h:466
size_type size() const
Returns the number of elements in the container.
Definition: pointer_vector_set.h:502
iterator insert(iterator Position, const TPointerType pData)
Inserts a pointer at the specified position.
Definition: pointer_vector_set.h:569
iterator begin()
Returns an iterator pointing to the beginning of the container.
Definition: pointer_vector_set.h:278
iterator find(const key_type &Key)
Find an element with the specified key.
Definition: pointer_vector_set.h:678
iterator end()
Returns an iterator pointing to the end of the container.
Definition: pointer_vector_set.h:314
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
IndexType GetSolutionStepIndex() const
Definition: process_info.h:277
Properties encapsulates data shared by different Elements or Conditions. It can store any type of dat...
Definition: properties.h:69
Properties & GetSubProperties(const IndexType SubPropertyIndex)
This method gets the subproperty from the index corresponding to the property id.
Definition: properties.h:479
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: properties.h:600
TVariableType::Type & GetValue(const TVariableType &rVariable)
Definition: properties.h:228
TablesContainerType const & Tables() const
This method returns the tables (constant)
Definition: properties.h:568
ContainerType & Data()
This method returns the whole data container.
Definition: properties.h:541
TVariableType::Type & operator()(const TVariableType &rV, Node &rThisNode, IndexType SolutionStepIndex)
Definition: properties.h:194
~Properties() override
Destructor.
Definition: properties.h:136
Properties::Pointer pGetSubProperties(const IndexType SubPropertyIndex)
This method gets the subproperty from the index corresponding to the property id.
Definition: properties.h:445
SubPropertiesContainerType & GetSubProperties()
This method returns the whole list of subproperties.
Definition: properties.h:510
TVariableType::Type & operator()(const TVariableType &rV)
Definition: properties.h:158
void SetSubProperties(SubPropertiesContainerType &rSubPropertiesList)
This method set the whole list of subproperties.
Definition: properties.h:528
Properties(IndexType NewId, const SubPropertiesContainerType &SubPropertiesList)
Default of properties with subproperties.
Definition: properties.h:114
void AddSubProperties(Properties::Pointer pNewSubProperty)
This method insert a new property into the list of subproperties.
Definition: properties.h:424
std::size_t IndexType
Definition: properties.h:86
std::string Info() const override
Turn back information as a string.
Definition: properties.h:594
std::size_t NumberOfSubproperties() const
This method returns the number of subproperties.
Definition: properties.h:415
Properties(IndexType NewId=0)
Default constructor.
Definition: properties.h:106
void SetAccessor(const TVariableType &rVariable, AccessorPointerType pAccessor)
Set the Accessor object This method sets a variable-accessor pair in current properties accessor cont...
Definition: properties.h:305
IndexType KeyType
Definition: properties.h:90
SubPropertiesContainerType const & GetSubProperties() const
This method returns the whole list of subproperties.
Definition: properties.h:519
TVariableType::Type const & GetValue(const TVariableType &rVariable) const
Definition: properties.h:234
Properties(const Properties &rOther)
Copy constructor.
Definition: properties.h:122
bool Has(TVariableType const &rThisVariable) const
Definition: properties.h:578
int64_t Key(std::size_t XKey, std::size_t YKey) const
Definition: properties.h:403
const Properties & GetSubProperties(const IndexType SubPropertyIndex) const
This method gets the subproperty from the index corresponding to the property id (constant version)
Definition: properties.h:496
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: properties.h:606
TVariableType::Type & GetValue(const TVariableType &rVariable, Node &rThisNode)
Definition: properties.h:241
Accessor::UniquePointer AccessorPointerType
Definition: properties.h:92
Accessor & GetAccessor(const TVariableType &rVariable)
Get the Accessor object If exists, this method returns a pointer to the requested variable accessor I...
Definition: properties.h:319
bool IsEmpty() const
Definition: properties.h:398
void SetTable(const TXVariableType &XVariable, const TYVariableType &YVariable, TableType const &rThisTable)
Definition: properties.h:388
TableType const & GetTable(const TXVariableType &XVariable, const TYVariableType &YVariable) const
Definition: properties.h:382
TVariableType::Type & GetValue(const TVariableType &rVariable, Node &rThisNode, IndexType SolutionStepIndex)
Definition: properties.h:257
bool HasVariables() const
Definition: properties.h:292
TVariableType::Type const & GetValue(const TVariableType &rVariable, Node const &rThisNode, IndexType SolutionStepIndex) const
Definition: properties.h:265
TVariableType::Type & operator[](const TVariableType &rV)
Definition: properties.h:170
bool HasTables() const
Definition: properties.h:393
const Properties::Pointer pGetSubProperties(const IndexType SubPropertyIndex) const
This method gets the subproperty from the index corresponding to the property id (constant version)
Definition: properties.h:462
bool HasSubProperties(const IndexType SubPropertyIndex) const
This method checks if the subproperty exists from the index corresponding to the property id.
Definition: properties.h:435
void Erase(const TVariableType &rV)
Definition: properties.h:222
TVariableType::Type const & operator()(const TVariableType &rV, Node const &rThisNode, IndexType SolutionStepIndex) const
Definition: properties.h:200
PointerVectorSet< Properties, IndexedObject > SubPropertiesContainerType
Properties container. A vector set of properties with their Id's as key.
Definition: properties.h:99
TVariableType::Type const & operator()(const TVariableType &rV, Node const &rThisNode, ProcessInfo const &rCurrentProcessInfo) const
Definition: properties.h:212
KRATOS_CLASS_POINTER_DEFINITION(Properties)
Pointer definition of Properties.
TVariableType::Type const & operator()(const TVariableType &rV) const
Definition: properties.h:164
AccessorPointerType & pGetAccessor(const TVariableType &rVariable)
Get the Accessor object If exists, this method returns a pointer to the requested variable accessor I...
Definition: properties.h:353
bool HasTable(const TXVariableType &XVariable, const TYVariableType &YVariable) const
Definition: properties.h:584
Accessor & GetAccessor(const TVariableType &rVariable) const
Get the Accessor object If exists, this method returns a pointer to the requested variable accessor I...
Definition: properties.h:336
void SetValue(TVariableType const &rV, typename TVariableType::Type const &rValue)
Definition: properties.h:287
Properties & operator=(const Properties &rOther)
Assignment operator.
Definition: properties.h:143
std::unordered_map< KeyType, AccessorPointerType > AccessorsContainerType
Definition: properties.h:94
TablesContainerType & Tables()
This method returns the tables.
Definition: properties.h:559
TableType & GetTable(const TXVariableType &XVariable, const TYVariableType &YVariable)
Definition: properties.h:376
TVariableType::Type const & operator()(const TVariableType &rV, Node const &rThisNode) const
Definition: properties.h:188
TVariableType::Type GetValue(const TVariableType &rVariable, const GeometryType &rGeometry, const Vector &rShapeFunctionVector, const ProcessInfo &rProcessInfo) const
Definition: properties.h:276
friend class Serializer
Definition: properties.h:706
TVariableType::Type & operator()(const TVariableType &rV, Node &rThisNode, ProcessInfo const &rCurrentProcessInfo)
Definition: properties.h:206
bool HasAccessor(const TVariableType &rVariable) const
Check if current properties have an accessor This method checks if current properties have an accesso...
Definition: properties.h:370
TVariableType::Type & operator()(const TVariableType &rV, Node &rThisNode)
Definition: properties.h:182
TVariableType::Type const & operator[](const TVariableType &rV) const
Definition: properties.h:176
std::unordered_map< std::size_t, TableType > TablesContainerType
Definition: properties.h:96
ContainerType const & Data() const
This method returns the whole data container (constant)
Definition: properties.h:550
TVariableType::Type const & GetValue(const TVariableType &rVariable, Node const &rThisNode) const
Definition: properties.h:249
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
void save(std::string const &rTag, std::array< TDataType, TDataSize > const &rObject)
Definition: serializer.h:545
#define KRATOS_SERIALIZE_SAVE_BASE_CLASS(Serializer, BaseType)
Definition: define.h:812
#define KRATOS_SERIALIZE_LOAD_BASE_CLASS(Serializer, BaseType)
Definition: define.h:815
#define KRATOS_ERROR
Definition: exception.h:161
#define KRATOS_ERROR_IF(conditional)
Definition: exception.h:162
#define KRATOS_DEBUG_ERROR_IF(conditional)
Definition: exception.h:171
static void PrintDataWithIdentation(std::ostream &rOStream, const TClass &rThisClass, const std::string Identation="\t")
Prints the data of an object of type TClass to the given output stream with indentation.
Definition: string_utilities.h:129
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
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
def load(f)
Definition: ode_solve.py:307
Configure::ContainerType ContainerType
Definition: transfer_utility.h:247