[Kratos] error using serialization

Pooyan pooyan en cimne.upc.edu
Mie Dic 5 15:57:06 CET 2012


Hi,

 

The mismatch in tags is typically due to the different order of calls in save and load and not depend to the serializer itself. In example forgetting to call the base class save or load in the derived one. 

 

Bests,

 

Pooyan.

 

From: Hoang Giang Bui [mailto:hgbk2008 en gmail.com] 
Sent: 05 December 2012 00:44
To: Pooyan
Cc: kratos
Subject: Fwd: [Kratos] error using serialization

 


Hi

After checking out and recompile, the serializer could write to the restart file. However when I tried to load, it caused some errors


The loading script is simply like this:

import sys
import os
kratos_root_path=os.environ['KRATOS_ROOT_PATH']
##################################################################
##################################################################
#importing Kratos modules
from KratosMultiphysics import *
from KratosMultiphysics.StructuralApplication import *
from KratosMultiphysics.EkateAuxiliaryApplication import *
kernel = Kernel()   #defining kernel

model_part = ModelPart("ekate_simulation")

input_file_name = "consolidation_test_0.0009"
#serializer = Serializer(input_file_name)
serializer = Serializer(input_file_name,SERIALIZER_TRACE_ERROR)
serializer.Load("ekate_simulation", model_part)
serializer = 0

the error was:



Traceback (most recent call last):

  File "test_load.py", line 17, in <module>
    serializer.Load("ekate_simulation", model_part)
ValueError: in bool Kratos::Serializer::load_trace_point(const std::basic_string<char, std::char_traits<char>, std::allocator<char>> &) [ /home/hbui/kratos_bcn1/kratos/includes/serializer.h , Line 584 ]

with subject    :  In line 2 the trace tag is not the expected one:
    Tag found : TIME
    Tag given : BaseClass

This is the link for .rest file in case you need more information.

https://docs.google.com/open?id=0Bw8Hmu0-YGQXa2NLWU5tOTlQMFk

BR
Giang Bui





On Mon, Nov 26, 2012 at 11:20 AM, Pooyan <pooyan en cimne.upc.edu> wrote:

Hi,

I've made some changes in the synchronization of the serializer which must
solve the problem you got. Please inform us about the result.

Bests,


Pooyan.

-----Original Message-----
From: kratos-bounces en listas.cimne.upc.edu
[mailto:kratos-bounces en listas.cimne.upc.edu] On Behalf Of Hoang Giang Bui
Sent: 09 November 2012 15:45
To: kratos en listas.cimne.upc.edu
Subject: [Kratos] error using serialization

Hi

I got an error in using serialization to save the model part as below

Traceback (most recent call last):
   File "consolidation_test.py", line 59, in <module>
     model.WriteRestartFile( time )
   File
"/home/hbui/kratos_janosch/consolidation_test_benchmark/125_mkl/consolidatio
n_test.gid/consolidation_test_include.py",
line 305, in WriteRestartFile
     serializer.Save("ModelPart", self.model_part);
RuntimeError: in void Kratos::Serializer::SavePointer(const
std::basic_string<char, std::char_traits<char>, std::allocator<char>> &,
const TDataType *) [with TDataType = Kratos::ConstitutiveLaw] [
/home/hbui/kratos_bcn1/kratos/includes/serializer.h , Line 742 ]

with subject    :  There is no object registered in Kratos with type id
:  N6Kratos11Isotropic3DE

The script to use the serialization is

def WriteRestartFile( self, time ):
         fn = self.path+self.problem_name
         serializer = Serializer(fn + '_' + str(time))
         serializer.Save("ModelPart", self.model_part);

model.WriteRestartFile(time)

May I know the root cause/solution ?

BR
Giang Bui

_______________________________________________
Kratos mailing list
Kratos en listas.cimne.upc.edu
http://listas.cimne.upc.edu/cgi-bin/mailman/listinfo/kratos








-- 
With Best Regards !
Giang Bui

To learn and to excel

 

------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: http://listas.cimne.upc.edu/pipermail/kratos/attachments/20121205/2f826745/attachment.htm 


Más información sobre la lista de distribución Kratos