Exemple #1
0
 def test_VariableIO_GetSettingsWithNonTerminalPrefix(self):
     input_settings = ParametersWrapper('''
         {
             "prefix": "/ModelData/<model_part_name>/<time>",
             "time_format": "0.2f"
         }
         ''')
     variable_io = operations.VariableIO(input_settings)
     settings = variable_io.GetSettings(_SurrogateModelPart())
     self.assertEqual(settings['prefix'], '/ModelData/model_part/1.23')
Exemple #2
0
 def test_VariableIO_Settings(self):
     settings1 = ParametersWrapper()
     variable_io = operations.VariableIO(settings1)
     settings2 = variable_io.GetSettings(_SurrogateModelPart())
     for settings in [settings1, settings2]:
         self.assertTrue(settings.Has('prefix'))
         self.assertTrue(settings.Has('list_of_variables'))
         self.assertEqual(settings['prefix'], '/ResultsData')
         self.assertTrue(settings['list_of_variables'].IsArray())
         self.assertEqual(len(settings['list_of_variables']), 0)
Exemple #3
0
 def test_VariableIO_Settings(self):
     settings1 = KratosMultiphysics.Parameters()
     variable_io = operations.VariableIO(settings1)
     settings2 = variable_io.GetSettings(_SurrogateModelPart())
     for settings in [settings1, settings2]:
         self.assertTrue(settings.Has('prefix'))
         self.assertTrue(settings.Has('list_of_variables'))
         self.assertEqual(settings['prefix'].GetString(), '/ResultsData')
         self.assertTrue(settings['list_of_variables'].IsArray())
         self.assertEqual(settings['list_of_variables'].size(), 0)
Exemple #4
0
 def test_VariableIO_GetSettingsWithNonTerminalPrefix(self):
     input_settings = KratosMultiphysics.Parameters('''
         {
             "prefix": "/ModelData/<identifier>/<time>",
             "time_format": "0.2f"
         }
         ''')
     variable_io = operations.VariableIO(input_settings)
     settings = variable_io.GetSettings(_SurrogateModelPart())
     self.assertEqual(settings['prefix'].GetString(),
                      '/ModelData/model_part/1.23')