Archivein error

13 views
Skip to first unread message

sjkc...@ue-eng.co.kr

unread,
Jul 24, 2022, 8:29:04 AM7/24/22
to ProjectChrono
Dear chrono users.

I'm almost new to chrono project.
after finishing ChSystemNSC, I saved data as binary archive file.
and then i read it again into ChSystemNSC, but i got an runtime error.
Please refer to below code snippet.

//set up archive out file
std::string binfile = out_dir + "/foo_archive.dat";
ChStreamOutBinaryFile mfileo(binfile.c_str());
ChArchiveOutBinary marchiveoutbinary(mfileo);

// save data into binary file
my_system.ArchiveOUT(marchiveoutbinary);

//then read it again into my_system.
//but, i got an runtime error.
ChStreamInBinaryFile mfilei(binfile.c_str());
ChArchiveInBinary binin(mfilei);
my_system.ArchiveIN(binin);

Thank you.


alessand...@unipr.it

unread,
Jul 25, 2022, 3:03:53 AM7/25/22
to projec...@googlegroups.com

dear user,

the serialization/deserialization of Chrono transient structures via ChArchiveIn/ChArchiveOut classes is not yet 100% functional. There are some missing parts, for example the collision data structures cannot be easily archived because they embed some 3rd party Bullet data structures, so this would require some intermediate layer of conversion and I had no time to do this. At the moment I am using the ChArchiveJSON or ChArchiveXML out serialization to dump the ChSystem to disk for checking and debugging, as it is ascii, human-readable, but de-serializing via corresponding ChArchiveIn classes is not in my priority right now. It is panned for future releases, though.

Alessandro Tasora

--
You received this message because you are subscribed to the Google Groups "ProjectChrono" group.
To unsubscribe from this group and stop receiving emails from it, send an email to projectchron...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/projectchrono/3c62019a-edbc-45fe-abee-61f490bdf6c5n%40googlegroups.com.

Firma il tuo 5xmille all’Università di Parma, aiutaci a essere sempre più accoglienti e inclusivi verso le nostre studentesse e i nostri studenti - Indica 00308780345 nella tua denuncia dei redditi.
Reply all
Reply to author
Forward
0 new messages