diff --git a/applications/SystemIdentificationApplication/CMakeLists.txt b/applications/SystemIdentificationApplication/CMakeLists.txt index 37bc85c95fb8..79ca045d7c8d 100644 --- a/applications/SystemIdentificationApplication/CMakeLists.txt +++ b/applications/SystemIdentificationApplication/CMakeLists.txt @@ -24,14 +24,14 @@ endif(${KRATOS_BUILD_TESTING} MATCHES ON) ## SystemIdentification python interface sources file(GLOB_RECURSE KRATOS_DIGITAL_TWIN_APPLICATION_PYTHON_INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/custom_python/*.cpp) -add_library(KratosDigitalTwinCore SHARED ${KRATOS_DIGITAL_TWIN_APPLICATION_CORE} ${KRATOS_DIGITAL_TWIN_APPLICATION_TESTING_SOURCES}) -target_link_libraries(KratosDigitalTwinCore PUBLIC KratosCore) -set_target_properties(KratosDigitalTwinCore PROPERTIES COMPILE_DEFINITIONS "DIGITAL_TWIN_APPLICATION=EXPORT,API") +add_library(KratosSystemIdentificationCore SHARED ${KRATOS_DIGITAL_TWIN_APPLICATION_CORE} ${KRATOS_DIGITAL_TWIN_APPLICATION_TESTING_SOURCES}) +target_link_libraries(KratosSystemIdentificationCore PUBLIC KratosCore) +set_target_properties(KratosSystemIdentificationCore PROPERTIES COMPILE_DEFINITIONS "DIGITAL_TWIN_APPLICATION=EXPORT,API") ############################################################### ## define library Kratos which defines the basic python interface pybind11_add_module(KratosSystemIdentificationApplication MODULE THIN_LTO ${KRATOS_DIGITAL_TWIN_APPLICATION_PYTHON_INTERFACE}) -target_link_libraries(KratosSystemIdentificationApplication PRIVATE KratosDigitalTwinCore) +target_link_libraries(KratosSystemIdentificationApplication PRIVATE KratosSystemIdentificationCore) set_target_properties(KratosSystemIdentificationApplication PROPERTIES PREFIX "") # changing the .dll suffix to .pyd (Windows) @@ -65,9 +65,9 @@ if(${INSTALL_TESTING_FILES} MATCHES ON ) endif(${INSTALL_TESTING_FILES} MATCHES ON) # Install targets -install(TARGETS KratosDigitalTwinCore DESTINATION libs ) +install(TARGETS KratosSystemIdentificationCore DESTINATION libs ) install(TARGETS KratosSystemIdentificationApplication DESTINATION libs ) # Define custom targets -set(KRATOS_KERNEL "${KRATOS_KERNEL};KratosDigitalTwinCore" PARENT_SCOPE) +set(KRATOS_KERNEL "${KRATOS_KERNEL};KratosSystemIdentificationCore" PARENT_SCOPE) set(KRATOS_PYTHON_INTERFACE "${KRATOS_PYTHON_INTERFACE};KratosSystemIdentificationApplication" PARENT_SCOPE) \ No newline at end of file diff --git a/applications/SystemIdentificationApplication/tests/auxiliary_files/system_identification/optimization_parameters.json b/applications/SystemIdentificationApplication/tests/auxiliary_files/system_identification/optimization_parameters.json index f193c3e2df52..3b146e15bf00 100644 --- a/applications/SystemIdentificationApplication/tests/auxiliary_files/system_identification/optimization_parameters.json +++ b/applications/SystemIdentificationApplication/tests/auxiliary_files/system_identification/optimization_parameters.json @@ -13,12 +13,16 @@ } }, { - "type": "connectivity_preserving_model_part_duplication_controller", + "type": "connectivity_preserving_model_part_controller", "settings": { - "source_model_part_name": "AdjointStructure", - "destination_model_part_name": "Structure", - "destination_element_name": "ShellThinElement3D3N", - "destination_condition_name": "LineLoadCondition3D2N" + "transformation_settings": [ + { + "source_model_part_name": "AdjointStructure", + "destination_model_part_name": "Structure", + "destination_element_name": "ShellThinElement3D3N", + "destination_condition_name": "LineLoadCondition3D2N" + } + ] } } ], @@ -77,8 +81,12 @@ 0.0, 30000000000.0 ], - "filtering": { - "filter_type": "entity_nodal_entity_filter" + "filter_settings": { + "filter_type": "explicit_filter", + "filter_radius_settings": { + "filter_radius": 5.0, + "filter_radius_type": "constant" + } } } } @@ -89,7 +97,7 @@ "echo_level": 0, "line_search": { "type": "const_step", - "init_step": 1e+8, + "init_step": 0.01, "gradient_scaling": "inf_norm" }, "conv_settings": { diff --git a/applications/SystemIdentificationApplication/tests/auxiliary_files/system_identification/primal_material_properties.json b/applications/SystemIdentificationApplication/tests/auxiliary_files/system_identification/primal_material_properties.json index fce99c727d1d..bdec18cc9592 100644 --- a/applications/SystemIdentificationApplication/tests/auxiliary_files/system_identification/primal_material_properties.json +++ b/applications/SystemIdentificationApplication/tests/auxiliary_files/system_identification/primal_material_properties.json @@ -10,7 +10,7 @@ "Variables": { "THICKNESS": 0.25, "DENSITY": 1.0, - "YOUNG_MODULUS": 30000000000.0, + "YOUNG_MODULUS": 10000000000.0, "POISSON_RATIO": 0.29 }, "Tables": {} diff --git a/applications/SystemIdentificationApplication/tests/auxiliary_files/system_identification_summary_ref.csv b/applications/SystemIdentificationApplication/tests/auxiliary_files/system_identification_summary_ref.csv index 8c886aa785a5..a9af07ae3494 100644 --- a/applications/SystemIdentificationApplication/tests/auxiliary_files/system_identification_summary_ref.csv +++ b/applications/SystemIdentificationApplication/tests/auxiliary_files/system_identification_summary_ref.csv @@ -5,16 +5,16 @@ # --------------- Initial values ---------------- # algorithm: # damage_response: -# initial_value: 2.656339179e-06 +# initial_value: 7.924977798e-04 # ------------ End of initial values ------------ # ----------------------------------------------- # ------------ Start of step values ------------- # Headers: # STEP, algorithm:std_obj_value, algorithm:rel_obj[%], algorithm:abs_obj[%], damage_response:value - 0, 2.656339179e-06, 0.000000000e+00, 0.000000000e+00, 2.656339179e-06 - 1, 2.600481313e-06, -2.102813744e+00, -2.102813744e+00, 2.600481313e-06 - 2, 2.545141620e-06, -2.128055802e+00, -4.186120496e+00, 2.545141620e-06 - 3, 2.490320702e-06, -2.153943721e+00, -6.249897537e+00, 2.490320702e-06 - 4, 2.436020847e-06, -2.180436222e+00, -8.294058729e+00, 2.436020847e-06 - 5, 2.382244381e-06, -2.207553591e+00, -1.031851653e+01, 2.382244381e-06 + 0, 7.924977798e-04, 0.000000000e+00, 0.000000000e+00, 7.924977798e-04 + 1, 7.578660731e-04, -4.369943684e+00, -4.369943684e+00, 7.578660731e-04 + 2, 7.244679939e-04, -4.406857674e+00, -8.584224159e+00, 7.244679939e-04 + 3, 6.922659748e-04, -4.444919496e+00, -1.264758180e+01, 6.922659748e-04 + 4, 6.612241594e-04, -4.484087994e+00, -1.656454110e+01, 6.612241594e-04 + 5, 6.313082950e-04, -4.524315075e+00, -2.033942414e+01, 6.313082950e-04 # End of file \ No newline at end of file diff --git a/applications/SystemIdentificationApplication/tests/test_SystemIdentificationApplication.py b/applications/SystemIdentificationApplication/tests/test_SystemIdentificationApplication.py index 9fea184b2099..a26bc08e2c0e 100644 --- a/applications/SystemIdentificationApplication/tests/test_SystemIdentificationApplication.py +++ b/applications/SystemIdentificationApplication/tests/test_SystemIdentificationApplication.py @@ -14,7 +14,7 @@ def AssembleTestSuites(): smallSuite.addTests(KratosUnittest.TestLoader().loadTestsFromTestCases([test_adjoint_sensors.TestStrainSensor])) smallSuite.addTests(KratosUnittest.TestLoader().loadTestsFromTestCases([test_sensor_output_process.TestSensorOutputProcess])) smallSuite.addTests(KratosUnittest.TestLoader().loadTestsFromTestCases([test_smooth_clamper.TestSmoothClamper])) - # smallSuite.addTests(KratosUnittest.TestLoader().loadTestsFromTestCases([test_system_identification.TestSystemIdentification])) + smallSuite.addTests(KratosUnittest.TestLoader().loadTestsFromTestCases([test_system_identification.TestSystemIdentification])) nightSuite = suites['nightly'] nightSuite.addTests(smallSuite) diff --git a/applications/SystemIdentificationApplication/tests/test_system_identification.py b/applications/SystemIdentificationApplication/tests/test_system_identification.py index 87f0f6db2d52..5e33fc473660 100644 --- a/applications/SystemIdentificationApplication/tests/test_system_identification.py +++ b/applications/SystemIdentificationApplication/tests/test_system_identification.py @@ -18,7 +18,7 @@ def test_DamagedSystem(self): data = numpy.loadtxt("auxiliary_files/damaged_problem/measured_data.csv", comments="#", usecols=[0,3,4,5,6], delimiter=",") ref_data = numpy.loadtxt("auxiliary_files/damaged_problem/measured_data_ref.csv", comments="#", usecols=[0,3,4,5,6], delimiter=",") - self.assertMatrixAlmostEqual(data, ref_data, 9) + self.assertTrue(numpy.allclose(data, ref_data, 1e-12, 1e-12)) def test_SystemIdentification(self): model = Kratos.Model()