24 #include <unordered_map>
25 #include <unordered_set>
36 #define KRATOS_SERIALIZATION_DIRECT_LOAD(type) \
37 void load(std::string const & rTag, type& rValue) \
39 load_trace_point(rTag); \
42 void load(std::string const & rTag, type const& rValue) \
44 load_trace_point(rTag); \
45 read(const_cast<type&>(rValue)); \
48 void load_base(std::string const & rTag, type& rValue) \
50 load_trace_point(rTag); \
54 #define KRATOS_SERIALIZATION_DIRECT_SAVE(type) \
55 void save(std::string const & rTag, type const & rValue) \
57 save_trace_point(rTag); \
61 void save_base(std::string const & rTag, type const & rValue) \
63 save_trace_point(rTag); \
67 #define KRATOS_SERIALIZATION_DIRECT_CREATE(type) \
68 void* create(std::string const & rTag, type* prototype) \
70 type* p_new = new type; \
75 #define KRATOS_SERIALIZER_MODE_BINARY \
77 #define KRATOS_SERIALIZER_MODE_ASCII \
79 #define KRATOS_SERIALIZER_MODE_END \
86 template <
class TDataType>
class Variable;
128 enum PointerType {SP_INVALID_POINTER, SP_BASE_CLASS_POINTER, SP_DERIVED_CLASS_POINTER};
129 enum TraceType {SERIALIZER_NO_TRACE=0, SERIALIZER_TRACE_ERROR=1, SERIALIZER_TRACE_ALL=2};
143 typedef void* (*ObjectFactoryType)();
161 mpBuffer(pBuffer), mTrace(rTrace), mNumberOfLines(0)
191 template<
class TDataType>
194 return new TDataType;
197 template<
class TDataType>
198 static void Register(std::string
const & rName, TDataType
const& pPrototype)
200 msRegisteredObjects.insert(RegisteredObjectsContainerType::value_type(rName,Create<TDataType>));
201 msRegisteredObjectsName.insert(RegisteredObjectsNameContainerType::value_type(
typeid(TDataType).name(), rName));
206 template<
class TDataType>
207 void load(std::string
const & rTag, TDataType& rObject)
209 load_trace_point(rTag);
213 template<
class TDataType>
220 if(pointer_type != SP_INVALID_POINTER)
223 LoadedPointersContainerType::iterator i_pointer = mLoadedPointers.find(p_pointer);
224 if(i_pointer == mLoadedPointers.end())
226 if(pointer_type == SP_BASE_CLASS_POINTER)
232 else if(pointer_type == SP_DERIVED_CLASS_POINTER)
234 std::string object_name;
236 typename RegisteredObjectsContainerType::iterator i_prototype = msRegisteredObjects.find(object_name);
239 <<
"There is no object registered in Kratos with name : "
240 << object_name << std::endl;
248 mLoadedPointers[p_pointer]=&pValue;
258 template<
class TDataType>
259 void load(std::string
const & rTag, Kratos::intrusive_ptr<TDataType>& pValue)
265 if(pointer_type != SP_INVALID_POINTER)
268 LoadedPointersContainerType::iterator i_pointer = mLoadedPointers.find(p_pointer);
269 if(i_pointer == mLoadedPointers.end())
271 if(pointer_type == SP_BASE_CLASS_POINTER)
274 pValue = Kratos::intrusive_ptr<TDataType>(
new TDataType);
277 else if(pointer_type == SP_DERIVED_CLASS_POINTER)
279 std::string object_name;
281 typename RegisteredObjectsContainerType::iterator i_prototype = msRegisteredObjects.find(object_name);
284 <<
"There is no object registered in Kratos with name : "
285 << object_name << std::endl;
288 pValue = Kratos::intrusive_ptr<TDataType>(
static_cast<TDataType*
>((i_prototype->second)()));
293 mLoadedPointers[p_pointer]=&pValue;
298 pValue = *
static_cast<Kratos::intrusive_ptr<TDataType>*
>((i_pointer->second));
303 template<
class TDataType>
310 if(pointer_type != SP_INVALID_POINTER)
313 LoadedPointersContainerType::iterator i_pointer = mLoadedPointers.find(p_pointer);
314 if(i_pointer == mLoadedPointers.end())
316 if(pointer_type == SP_BASE_CLASS_POINTER)
322 else if(pointer_type == SP_DERIVED_CLASS_POINTER)
324 std::string object_name;
326 typename RegisteredObjectsContainerType::iterator i_prototype = msRegisteredObjects.find(object_name);
329 <<
"There is no object registered in Kratos with name : "
330 << object_name << std::endl;
338 mLoadedPointers[p_pointer]=pValue.get();
348 template<
class TDataType>
349 void load(std::string
const & rTag, TDataType*& pValue)
355 if(pointer_type != SP_INVALID_POINTER)
358 LoadedPointersContainerType::iterator i_pointer = mLoadedPointers.find(p_pointer);
359 if(i_pointer == mLoadedPointers.end())
361 if(pointer_type == SP_BASE_CLASS_POINTER)
364 pValue =
new TDataType;
367 else if(pointer_type == SP_DERIVED_CLASS_POINTER)
369 std::string object_name;
371 typename RegisteredObjectsContainerType::iterator i_prototype = msRegisteredObjects.find(object_name);
374 <<
"There is no object registered in Kratos with name : "
375 << object_name << std::endl;
378 pValue =
static_cast<TDataType*
>((i_prototype->second)());
384 mLoadedPointers[p_pointer]=&pValue;
389 pValue = *
static_cast<TDataType**
>((i_pointer->second));
401 template<
class TDataType>
409 template<
class TDataType>
417 template<
class TDataType>
420 load_trace_point(rTag);
425 template<
class TDataType, std::
size_t TDataSize>
426 void load(std::string
const & rTag, std::array<TDataType, TDataSize>& rObject)
428 load_trace_point(rTag);
430 load(
"E", rObject[
i]);
433 template<
class TDataType>
434 void load(std::string
const & rTag, std::vector<TDataType>& rObject)
436 load_trace_point(rTag);
441 rObject.resize(size);
444 load(
"E", rObject[
i]);
448 template<
class TDataType>
451 load_trace_point(rTag);
456 rObject.
resize(size,
false);
459 load(
"E", rObject[
i]);
464 template<
class TKeyType,
class TDataType>
465 void load(std::string
const & rTag, std::map<TKeyType, TDataType>& rObject)
467 load_associative_container(rTag, rObject);
470 template<
class TKeyType,
class TDataType>
471 void load(std::string
const & rTag, std::unordered_map<TKeyType, TDataType>& rObject)
473 load_associative_container(rTag, rObject);
476 template<
class TDataType>
477 void load(std::string
const & rTag, std::set<TDataType>& rObject)
479 load_associative_container(rTag, rObject);
482 template<
class TDataType>
483 void load(std::string
const & rTag, std::unordered_set<TDataType>& rObject)
485 load_associative_container(rTag, rObject);
488 template<
class TDataType, std::
size_t TDimension>
491 load_trace_point(rTag);
494 load(
"E", rObject[
i]);
498 template<
class TFirstType,
class TSecondType>
499 void load(std::string
const & rTag, std::pair<TFirstType, TSecondType>& rObject)
501 load_trace_point(rTag);
502 load(
"First", rObject.first);
503 load(
"Second", rObject.second);
506 template<
class TDataType, std::
size_t TDimension>
509 load_trace_point(rTag);
512 load(
"E", rObject[
i]);
516 template<
class TDataType, std::
size_t TDimension1, std::
size_t TDimension2>
519 load_trace_point(rTag);
544 template<
class TDataType, std::
size_t TDataSize>
545 void save(std::string
const & rTag, std::array<TDataType, TDataSize>
const& rObject)
547 save_trace_point(rTag);
549 save(
"E", rObject[
i]);
552 template<
class TDataType>
553 void save(std::string
const & rTag, std::vector<TDataType>
const& rObject)
555 save_trace_point(rTag);
564 using SaveType = std::conditional_t<
571 save(
"E", SaveType(rObject[
i]));
575 template<
class TDataType>
578 save_trace_point(rTag);
584 save(
"E", rObject[
i]);
588 template<
class TDataType, std::
size_t TDimension>
591 save_trace_point(rTag);
593 save(
"E", rObject[
i]);
598 template<
class TKeyType,
class TDataType>
599 void save(std::string
const & rTag, std::map<TKeyType, TDataType>
const& rObject)
601 save_associative_container(rTag, rObject);
604 template<
class TKeyType,
class TDataType>
605 void save(std::string
const & rTag, std::unordered_map<TKeyType, TDataType>
const& rObject)
607 save_associative_container(rTag, rObject);
610 template<
class TDataType>
611 void save(std::string
const & rTag, std::set<TDataType>
const& rObject)
613 save_associative_container(rTag, rObject);
616 template<
class TDataType>
617 void save(std::string
const & rTag, std::unordered_set<TDataType>
const& rObject)
619 save_associative_container(rTag, rObject);
622 template<
class TDataType>
623 void save(std::string
const & rTag, TDataType
const& rObject)
625 save_trace_point(rTag);
629 template<
class TDataType>
632 save_trace_point(rTag);
633 write(pVariable->
Name());
637 template<
class TDataType>
640 save(rTag, pValue.get());
643 template<
class TDataType>
644 void save(std::string
const & rTag, Kratos::intrusive_ptr<TDataType> pValue)
646 save(rTag, pValue.get());
650 template<
class TDataType>
653 save(rTag, pValue.get());
656 template<
class TDataType>
657 void save(std::string
const & rTag,
const TDataType * pValue)
661 if(IsDerived(pValue))
662 write(SP_DERIVED_CLASS_POINTER);
664 write(SP_BASE_CLASS_POINTER);
666 SavePointer(rTag,pValue);
670 write(SP_INVALID_POINTER);
674 template<
class TDataType>
677 if (strcmp(
typeid(TDataType).name(),
typeid(*pValue).name()) != 0) {
689 template<
class TDataType>
690 void save(std::string
const & rTag, TDataType * pValue)
694 if(IsDerived(pValue))
696 write(SP_DERIVED_CLASS_POINTER);
700 write(SP_BASE_CLASS_POINTER);
703 SavePointer(rTag,pValue);
707 write(SP_INVALID_POINTER);
711 template<
class TDataType>
719 template<
class TDataType>
727 template<
class TDataType>
733 save(rTag, pValue.get());
736 void save(std::string
const & rTag,
const char * pValue)
738 save_trace_point(rTag);
739 write(std::string(pValue));
743 template<
class TFirstType,
class TSecondType>
744 void save(std::string
const & rTag, std::pair<TFirstType, TSecondType> rObject)
746 save_trace_point(rTag);
747 save(
"First", rObject.first);
748 save(
"Second", rObject.second);
751 template<
class TDataType, std::
size_t TDimension>
754 save_trace_point(rTag);
757 save(
"E", rObject[
i]);
761 template<
class TDataType, std::
size_t TDimension1, std::
size_t TDimension2>
764 save_trace_point(rTag);
768 save(
"E", rObject(
i,
j));
790 template<
class TDataType>
791 void load_base(std::string
const & rTag, TDataType& rObject)
793 load_trace_point(rTag);
794 rObject.TDataType::load(*
this);
798 template<
class TDataType>
799 void load_base(std::string
const & rTag, std::vector<TDataType>& rObject)
801 load_trace_point(rTag);
805 template<
class TDataType>
808 load_trace_point(rTag);
812 template<
class TDataType, std::
size_t TDimension>
815 load_trace_point(rTag);
819 template<
class TDataType>
820 void save_base(std::string
const & rTag, std::vector<TDataType>
const& rObject)
822 save_trace_point(rTag);
826 template<
class TDataType>
829 save_trace_point(rTag);
833 template<
class TDataType, std::
size_t TDimension>
836 save_trace_point(rTag);
840 template<
class TDataType>
841 void save_base(std::string
const & rTag, TDataType
const& rObject)
843 save_trace_point(rTag);
844 rObject.TDataType::save(*
this);
857 if(mTrace == SERIALIZER_TRACE_ERROR)
859 std::string read_tag;
865 std::stringstream buffer;
866 buffer <<
"In line " << mNumberOfLines;
867 buffer <<
" the trace tag is not the expected one:" << std::endl;
868 buffer <<
" Tag found : " << read_tag << std::endl;
869 buffer <<
" Tag given : " << rTag << std::endl;
873 else if(mTrace == SERIALIZER_TRACE_ALL)
875 std::string read_tag;
879 KRATOS_INFO(
"Serializer") <<
"In line " << mNumberOfLines <<
" loading " << rTag <<
" as expected" << std::endl;
884 std::stringstream buffer;
885 buffer <<
"In line " << mNumberOfLines;
886 buffer <<
" the trace tag is not the expected one:" << std::endl;
887 buffer <<
" Tag found : " << read_tag << std::endl;
888 buffer <<
" Tag given : " << rTag << std::endl;
913 template<
class TDataType>
915 mSavedPointers.insert(pValue);
924 mLoadedPointers[pStoredPointer]=pAllocatedPosition;
929 return msRegisteredObjects;
934 return msRegisteredObjectsName;
939 mFlags.Set(ThisFlag);
948 return mFlags.Is(rOtherFlag);
956 virtual std::string
Info()
const
1018 static RegisteredObjectsContainerType msRegisteredObjects;
1019 static RegisteredObjectsNameContainerType msRegisteredObjectsName;
1027 BufferType* mpBuffer;
1031 SavedPointersContainerType mSavedPointers;
1032 LoadedPointersContainerType mLoadedPointers;
1044 template<
class TDataType>
1045 void SavePointer(std::string
const & rTag,
const TDataType * pValue)
1048 if (mSavedPointers.find(pValue) == mSavedPointers.end())
1050 mSavedPointers.insert(pValue);
1051 if (IsDerived(pValue))
1053 typename RegisteredObjectsNameContainerType::iterator i_name = msRegisteredObjectsName.find(
typeid (*pValue).name());
1055 if (i_name == msRegisteredObjectsName.end()) {
1056 KRATOS_ERROR <<
"There is no object registered in Kratos with type id : "
1057 <<
typeid (*pValue).name() << std::endl;
1059 write(i_name->second);
1063 save(rTag, *pValue);
1067 VariableData* GetVariableData(std::string
const & VariableName);
1069 template<
class TMapType>
1070 void load_associative_container(std::string
const & rTag, TMapType& rObject)
1072 load_trace_point(rTag);
1078 typename TMapType::value_type
temp;
1080 rObject.insert(
temp);
1085 template<
class TMapType>
1086 void save_associative_container(std::string
const & rTag, TMapType
const& rObject)
1088 save_trace_point(rTag);
1093 for(
auto&
i : rObject)
1123 void read(PointerType& rValue)
1128 mpBuffer->read((
char *)(&
temp),
sizeof(PointerType));
1129 rValue = PointerType(
temp);
1135 rValue = PointerType(
temp);
1141 void write(PointerType
const& rValue)
1145 int ptr = (
int)rValue;
1146 const char *
data =
reinterpret_cast<const char*
>(&ptr);
1147 mpBuffer->write(
data,
sizeof(PointerType));
1151 *mpBuffer <<
int(rValue) << std::endl;
1156 void read(std::string& rValue)
1161 mpBuffer->read((
char *)(&size),
sizeof(
SizeType));
1162 rValue.resize(size);
1164 mpBuffer->read(rValue.data(), size);
1170 std::getline( *mpBuffer,rValue,
'\"');
1172 std::getline( *mpBuffer,rValue,
'\"');
1178 void write(std::string
const& rValue)
1182 const char *
data = rValue.c_str();
1183 SizeType rData_size = rValue.length() *
sizeof(char);
1185 const char * data1 =
reinterpret_cast<const char *
>(&rData_size);
1187 mpBuffer->write(data1,
sizeof(
SizeType));
1188 mpBuffer->write(
data,rData_size);
1192 *mpBuffer <<
"\"" << rValue <<
"\"" << std::endl;
1197 template<
class TDataType>
1198 void read(TDataType& rData)
1202 mpBuffer->read((
char *)(&rData),
sizeof(TDataType));
1212 template<
class TDataType>
1213 void write(TDataType
const& rData)
1217 const char *
data =
reinterpret_cast<const char*
>(&rData);
1218 mpBuffer->write(
data,
sizeof(TDataType));
1222 *mpBuffer << rData << std::endl;
1227 template<
class TDataType>
1228 void read(std::vector<TDataType>& rData)
1233 mpBuffer->read((
char *)(&size),
sizeof(
SizeType));
1237 read(rData.begin(), rData.end(),
sizeof(TDataType));
1246 read(rData.begin(), rData.end());
1251 template<
class TDataType>
1252 void write(std::vector<TDataType>
const& rData)
1256 SizeType rData_size = rData.size();
1258 const char *
data =
reinterpret_cast<const char *
>(&rData_size);
1261 write(rData.begin(), rData.end(),
sizeof(TDataType));
1265 *mpBuffer << rData.size() << std::endl;
1266 write(rData.begin(), rData.end());
1300 template<
class TDataType>
1301 void read(DenseMatrix<TDataType>& rData)
1308 mpBuffer->read((
char *)(&size1),
sizeof(
SizeType));
1309 mpBuffer->read((
char *)(&size2),
sizeof(
SizeType));
1311 rData.resize(size1,size2);
1313 read(rData.data().begin(), rData.data().end(),
sizeof(TDataType));
1325 rData.resize(size1,size2);
1327 read(rData.data().begin(), rData.data().end(),0);
1332 template<
class TDataType>
1333 void write(DenseMatrix<TDataType>
const& rData)
1337 SizeType rData_size1 = rData.size1();
1338 SizeType rData_size2 = rData.size2();
1340 const char * data1 =
reinterpret_cast<const char *
>(&rData_size1);
1341 const char * data2 =
reinterpret_cast<const char *
>(&rData_size2);
1343 mpBuffer->write(data1,
sizeof(
SizeType));
1344 mpBuffer->write(data2,
sizeof(
SizeType));
1346 write(rData.data().begin(), rData.data().end(),
sizeof(TDataType));
1350 *mpBuffer << rData.size1() << std::endl;
1351 *mpBuffer << rData.size2() << std::endl;
1353 write(rData.data().begin(), rData.data().end(),0);
1358 template<
class TIteratorType>
1359 void read(TIteratorType First, TIteratorType Last,
SizeType size)
1363 for(; First != Last ; First++)
1365 mpBuffer->read((
char *)First,
sizeof(size));
1370 for(; First != Last ; First++)
1372 *mpBuffer >> *First;
1379 template<
class TIteratorType>
1380 void write(TIteratorType First, TIteratorType Last,
SizeType size)
1384 for(; First != Last ; First++)
1386 const char *
data =
reinterpret_cast<const char *
>(First);
1387 mpBuffer->write(
data,
sizeof(size));
1392 for(; First != Last ; First++)
1393 *mpBuffer << *First << std::endl;
1400 typedef char BlockType;
1426 Serializer&
operator=(Serializer
const& rOther);
1429 Serializer(Serializer
const& rOther);
1480 #undef KRATOS_SERIALIZER_MODE_BINARY
1481 #undef KRATOS_SERIALIZER_MODE_ASCII
1482 #undef KRATOS_SERIALIZER_MODE_END
1484 #undef KRATOS_SERIALIZATION_DIRECT_LOAD
1485 #undef KRATOS_SERIALIZATION_DIRECT_SAVE
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
Definition: amatrix_interface.h:41
void resize(std::size_t NewSize1, std::size_t NewSize2, bool preserve=0)
Definition: amatrix_interface.h:224
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
std::map< std::string, std::string > RegisteredObjectsNameContainerType
Definition: serializer.h:149
void load(std::string const &rTag, TDataType &rObject)
Definition: serializer.h:207
void save(std::string const &rTag, const char *pValue)
Definition: serializer.h:736
PointerType
Definition: serializer.h:128
void load(std::string const &rTag, Kratos::weak_ptr< TDataType > &pValue)
Definition: serializer.h:402
virtual ~Serializer()
Destructor.
Definition: serializer.h:166
void load(std::string const &rTag, std::vector< TDataType > &rObject)
Definition: serializer.h:434
void load(std::string const &rTag, array_1d< TDataType, TDimension > &rObject)
Definition: serializer.h:489
void load(std::string const &rTag, std::unordered_set< TDataType > &rObject)
Definition: serializer.h:483
void save(std::string const &rTag, array_1d< TDataType, TDimension > const &rObject)
Definition: serializer.h:589
void load(std::string const &rTag, BoundedMatrix< TDataType, TDimension1, TDimension2 > &rObject)
Definition: serializer.h:517
TraceType
Definition: serializer.h:129
void load(std::string const &rTag, DenseVector< TDataType > &rObject)
Definition: serializer.h:449
virtual void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: serializer.h:962
bool Is(Flags const &rOtherFlag) const
Definition: serializer.h:946
static void * Create()
Definition: serializer.h:192
KRATOS_DEFINE_LOCAL_FLAG(MPI)
void save(std::string const &rTag, Kratos::unique_ptr< TDataType > const &pValue)
Definition: serializer.h:651
std::map< std::string, ObjectFactoryType > RegisteredObjectsContainerType
Definition: serializer.h:147
void save(std::string const &rTag, const TDataType *pValue)
Definition: serializer.h:657
TraceType GetTraceType() const
Definition: serializer.h:184
std::size_t SizeType
Definition: serializer.h:141
void load_base(std::string const &rTag, TDataType &rObject)
Definition: serializer.h:791
void save(std::string const &rTag, Kratos::intrusive_ptr< TDataType > pValue)
Definition: serializer.h:644
void save_base(std::string const &rTag, DenseVector< TDataType > const &rObject)
Definition: serializer.h:827
void load(std::string const &rTag, std::map< TKeyType, TDataType > &rObject)
Definition: serializer.h:465
void load(std::string const &rTag, std::pair< TFirstType, TSecondType > &rObject)
Definition: serializer.h:499
void save(std::string const &rTag, TDataType const &rObject)
Definition: serializer.h:623
void RedirectLoadingPointer(void *pStoredPointer, void *pAllocatedPosition)
Definition: serializer.h:923
void load_base(std::string const &rTag, array_1d< TDataType, TDimension > &rObject)
Definition: serializer.h:813
void save(std::string const &rTag, std::array< TDataType, TDataSize > const &rObject)
Definition: serializer.h:545
void load(std::string const &rTag, std::array< TDataType, TDataSize > &rObject)
Definition: serializer.h:426
void load(std::string const &rTag, TDataType *&pValue)
Definition: serializer.h:349
void save(std::string const &rTag, std::map< TKeyType, TDataType > const &rObject)
Definition: serializer.h:599
void save(std::string const &rTag, DenseVector< TDataType > const &rObject)
Definition: serializer.h:576
void save_base(std::string const &rTag, std::vector< TDataType > const &rObject)
Definition: serializer.h:820
BufferType * pGetBuffer()
Definition: serializer.h:903
void Set(const Flags ThisFlag)
Definition: serializer.h:937
virtual std::string Info() const
Turn back information as a string.
Definition: serializer.h:956
void load_base(std::string const &rTag, std::vector< TDataType > &rObject)
Definition: serializer.h:799
void load(std::string const &rTag, Kratos::shared_ptr< TDataType > &pValue)
Definition: serializer.h:214
void load(std::string const &rTag, BoundedVector< TDataType, TDimension > &rObject)
Definition: serializer.h:507
void save(std::string const &rTag, TDataType *pValue)
Definition: serializer.h:690
void save(std::string const &rTag, std::unordered_map< TKeyType, TDataType > const &rObject)
Definition: serializer.h:605
void save(std::string const &rTag, Kratos::WeakPointerVector< TDataType > pValue)
Definition: serializer.h:720
static RegisteredObjectsNameContainerType & GetRegisteredObjectsName()
Definition: serializer.h:932
void AddToSavedPointers(const TDataType &pValue)
Definition: serializer.h:914
KRATOS_DEFINE_LOCAL_FLAG(SHALLOW_GLOBAL_POINTERS_SERIALIZATION)
void load(std::string const &rTag, const Variable< TDataType > *)
Definition: serializer.h:418
void SetBuffer(BufferType *pBuffer)
Definition: serializer.h:186
void save(std::string const &rTag, std::set< TDataType > const &rObject)
Definition: serializer.h:611
Serializer(BufferType *pBuffer, TraceType const &rTrace=SERIALIZER_NO_TRACE)
Default constructor.
Definition: serializer.h:160
std::iostream BufferType
Definition: serializer.h:153
KRATOS_CLASS_POINTER_DEFINITION(Serializer)
Pointer definition of Serializer.
bool load_trace_point(std::string const &rTag)
Definition: serializer.h:855
void load(std::string const &rTag, std::set< TDataType > &rObject)
Definition: serializer.h:477
void save(std::string const &rTag, std::pair< TFirstType, TSecondType > rObject)
Definition: serializer.h:744
void save(std::string const &rTag, Kratos::shared_ptr< TDataType > pValue)
Definition: serializer.h:638
void load(std::string const &rTag, std::unordered_map< TKeyType, TDataType > &rObject)
Definition: serializer.h:471
void load_base(std::string const &rTag, DenseVector< TDataType > &rObject)
Definition: serializer.h:806
void save(std::string const &rTag, const Variable< TDataType > *pVariable)
Definition: serializer.h:630
void save_trace_point(std::string const &rTag)
Definition: serializer.h:847
std::map< void *, void * > LoadedPointersContainerType
Definition: serializer.h:145
void load(std::string const &rTag, Kratos::unique_ptr< TDataType > &pValue)
Definition: serializer.h:304
static RegisteredObjectsContainerType & GetRegisteredObjects()
Definition: serializer.h:927
void save(std::string const &rTag, BoundedMatrix< TDataType, TDimension1, TDimension2 > const &rObject)
Definition: serializer.h:762
void save(std::string const &rTag, std::unordered_set< TDataType > const &rObject)
Definition: serializer.h:617
virtual void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: serializer.h:966
void save_base(std::string const &rTag, TDataType const &rObject)
Definition: serializer.h:841
void save(std::string const &rTag, Kratos::shared_ptr< const TDataType > pValue)
Definition: serializer.h:728
void save(std::string const &rTag, BoundedVector< TDataType, TDimension > const &rObject)
Definition: serializer.h:752
void save(std::string const &rTag, Kratos::weak_ptr< TDataType > pValue)
Definition: serializer.h:712
void load(std::string const &rTag, Kratos::intrusive_ptr< TDataType > &pValue)
Definition: serializer.h:259
bool IsDerived(TDataType *pValue)
Definition: serializer.h:675
void save_base(std::string const &rTag, array_1d< TDataType, TDimension > const &rObject)
Definition: serializer.h:834
void load(std::string const &rTag, WeakPointerVector< TDataType > &pValue)
Definition: serializer.h:410
void save(std::string const &rTag, std::vector< TDataType > const &rObject)
Definition: serializer.h:553
std::set< const void * > SavedPointersContainerType
Definition: serializer.h:151
static void Register(std::string const &rName, TDataType const &pPrototype)
Definition: serializer.h:198
const std::string & Name() const
Definition: variable_data.h:201
Variable class contains all information needed to store and retrive data from a data container.
Definition: variable.h:63
WeakPointerVector is a container like stl vector but using a vector to store pointers to its data.
Definition: weak_pointer_vector.h:67
Short class definition.
Definition: array_1d.h:61
#define KRATOS_ERROR
Definition: exception.h:161
#define KRATOS_ERROR_IF(conditional)
Definition: exception.h:162
#define KRATOS_INFO(label)
Definition: logger.h:250
Kratos::ModelPart ModelPart
Definition: kratos_wrapper.h:31
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
std::weak_ptr< T > weak_ptr
Definition: smart_pointers.h:30
REACTION_CHECK_STIFFNESS_FACTOR INNER_LOOP_ITERATION DISTANCE_THRESHOLD ACTIVE_CHECK_FACTOR AUXILIAR_COORDINATES NORMAL_GAP WEIGHTED_GAP WEIGHTED_SCALAR_RESIDUAL bool
Definition: contact_structural_mechanics_application_variables.h:93
std::shared_ptr< T > shared_ptr
Definition: smart_pointers.h:27
std::unique_ptr< T > unique_ptr
Definition: smart_pointers.h:33
std::size_t SizeType
The definition of the size type.
Definition: mortar_classes.h:43
REACTION_CHECK_STIFFNESS_FACTOR int
Definition: contact_structural_mechanics_application_variables.h:75
type
Definition: generate_gid_list_file.py:35
int block_size
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:16
data
Definition: mesh_to_mdpa_converter.py:59
def load(f)
Definition: ode_solve.py:307
int j
Definition: quadrature.py:648
float temp
Definition: rotating_cone.py:85
integer i
Definition: TensorModule.f:17
#define KRATOS_SERIALIZER_MODE_ASCII
Definition: serializer.h:77
#define KRATOS_SERIALIZER_MODE_BINARY
Definition: serializer.h:75
#define KRATOS_SERIALIZATION_DIRECT_SAVE(type)
Definition: serializer.h:54
#define KRATOS_SERIALIZER_MODE_END
Definition: serializer.h:79
#define KRATOS_SERIALIZATION_DIRECT_LOAD(type)
Definition: serializer.h:36