Compare commits

...

18 Commits

Author SHA1 Message Date
iasonmanolas b58ae0e13b CG first Submission state 2021-10-14 14:58:34 +03:00
iasonmanolas f949c2d793 Refactoring. Added kinetic energy as a convergence criterion for the full pattern simulations 2021-07-20 16:30:41 +03:00
iasonmanolas 19d9fe434a Added code for exporting 2021-07-14 17:47:47 +03:00
iasonmanolas 006f4a122f Refactoring.Missing exporting of max magnitudes 2021-07-14 17:13:46 +03:00
iasonmanolas fe7ecbcd38 Exporting internal potential energy in the results json. Exporting the full pattern scenarios. 2021-07-07 18:19:59 +03:00
iasonmanolas 408d1e8c38 Reset to previous version 2021-07-01 02:50:11 +03:00
iasonmanolas 0863db658d Added max iterations on all drm simulations.using global optimizer for dome magnitude.Added bool variable for success in force magnitude search. 2021-06-30 10:24:54 +03:00
iasonmanolas a9c5ca3fc6 skipping folders which exist in crashed folder. 2021-06-30 10:21:32 +03:00
iasonmanolas 56844f1f99 The simulation in the optimization of the full pattern scenario magnitudes uses the kinetic energy as a convergence criterion 2021-06-24 09:55:04 +03:00
iasonmanolas e7e6971296 Changed the magnitude of the simulation scenarios 2021-06-03 12:29:19 +03:00
iasonmanolas 03c7d63e5b Refactoring 2021-05-24 14:18:36 +03:00
iasonmanolas 3cd5bcf13d Windows refactoring 2021-05-03 19:13:52 +03:00
iasonmanolas 795257d53e Changed reduced pattern in test set 2021-04-30 12:58:22 +03:00
iasonmanolas d8871cab17 Refactoring 2021-04-30 12:47:50 +03:00
iasonmanolas 62ce79d959 Computation of the max force for each base simulation scenario based on a desired displacement. 2021-04-16 11:41:40 +03:00
iasonmanolas b54662be9e Refactoring.Addded multiple simulation scenarios 2021-04-08 20:55:56 +03:00
iasonmanolas 49494ccef8 Replaced NumberOfSimulationScenarios with a variable calld totalNumberOfSimulationScenarios.This var will hold the number of base sim scenarios times the sub-sim scenarios for each case. 2021-04-05 12:41:05 +03:00
iasonmanolas d7d1951be6 Refactoring 2021-03-30 19:30:49 +03:00
59 changed files with 1267 additions and 2074 deletions

View File

@ -1,5 +1,8 @@
cmake_minimum_required(VERSION 2.8)
project(ReducedModelOptimization)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
message(STATUS "The compiler ${CMAKE_CXX_COMPILER}")
#Add the project cmake scripts to the module path
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
@ -12,7 +15,14 @@ else()
set(UPDATE_DISCONNECTED_IF_AVAILABLE "UPDATE_DISCONNECTED 1")
endif()
set(EXTERNAL_DEPS_DIR "/home/iason/Coding/build/external dependencies")
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
set(EXTERNAL_DEPS_DIR "C:/Users/iason/Downloads/ReducedModelOptimization/build/externalDependencies/")
else()
set(EXTERNAL_DEPS_DIR "/home/iason/Coding/build/external dependencies/")
endif()
##Create directory for the external libraries
file(MAKE_DIRECTORY ${EXTERNAL_DEPS_DIR})

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
1 5
3 6
5 6

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
2 6
3 6
4 6

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
1 5
2 5
3 4

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
1 5
2 3
2 5

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
1 5
1 6
3 6

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
2 6
3 4
4 6

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
2 6
3 4
3 6

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
1 4
1 5
3 4

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
1 4
1 5
2 3

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
1 3
3 6
5 6

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
1 3
1 6
5 6

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
1 3
1 5
3 5

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
1 3
1 4
2 3

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
2 5
3 4
3 5

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
1 2
2 5
3 5

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
1 2
2 5
3 4

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
1 2
2 3
3 5

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
1 2
2 3
2 5

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
1 2
1 5
3 4

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
1 2
1 5
2 3

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
1 2
1 4
3 4

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
1 2
1 4
2 3

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
1 2
1 3
3 4

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
1 2
1 3
1 4

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
0 6
3 4
4 6

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
0 6
2 6
3 4

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
2 4
3 6
4 6

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
0 6
2 3
4 6

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
0 6
2 3
2 6

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
0 6
1 3
5 6

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
0 6
1 3
1 6

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
2 4
2 6
3 6

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
0 3
2 3
3 4

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
0 3
1 3
3 5

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
0 3
0 6
3 6

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
0 1
3 6
5 6

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
0 1
2 5
3 4

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
2 3
3 6
4 6

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
0 1
2 3
2 5

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
0 1
1 6
3 6

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
0 1
1 5
3 5

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
0 1
1 4
3 4

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
0 1
1 4
2 3

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
0 1
1 3
3 5

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
0 1
1 3
1 5

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
0 1
1 2
3 4

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
0 1
1 2
2 3

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
0 1
0 3
3 5

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
0 1
0 3
1 3

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
2 3
2 6
4 6

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
2 3
2 4
3 4

View File

@ -1,27 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 3
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
1 6
3 6
5 6

View File

@ -1,26 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 2
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
1 5
3 1

View File

@ -1,26 +0,0 @@
ply
format ascii 1.0
comment VCGLIB generated
element vertex 7
property double x
property double y
property double z
property uchar red
property uchar green
property uchar blue
property uchar alpha
element face 0
property list uchar int vertex_indices
element edge 2
property int vertex1
property int vertex2
end_header
0 0 0 255 255 255 255
-0.1666666666666666 -0.2886751345948129 0 255 255 255 255
-0.3333333333333333 -0.5773502691896257 0 255 255 255 255
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
1 5
3 5

View File

@ -21,5 +21,5 @@ end_header
0 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255
0.1 -0.5773502691896258 0 255 255 255 255
0 3
0 -0.3333333 0 255 255 255 255
0 3

View File

@ -1,5 +1,5 @@
#include "drmsimulationmodel.hpp"
#include "csvfile.hpp"
#include "drmsimulationmodel.hpp"
#include "edgemesh.hpp"
#include "reducedmodeloptimizer.hpp"
#include "simulationhistoryplotter.hpp"
@ -30,83 +30,113 @@ int main(int argc, char *argv[]) {
////Full pattern
const std::string filepath_fullPattern = argv[1];
PatternGeometry fullPattern(filepath_fullPattern);
fullPattern.setLabel(
std::filesystem::path(filepath_fullPattern).stem().string());
fullPattern.scale(0.03,interfaceNodeIndex);
// fullPattern.prependToLabel(std::to_string(fullPattern.EN()) + "#");
fullPattern.scale(0.03, interfaceNodeIndex);
////Reduced pattern
const std::string filepath_reducedPattern = argv[2];
PatternGeometry reducedPattern(filepath_reducedPattern);
reducedPattern.setLabel(std::filesystem::path(filepath_reducedPattern).stem().string());
reducedPattern.scale(0.03, interfaceNodeIndex);
// Set the optization settings
ReducedModelOptimization::xRange beamE{"E", 0.001, 1000};
ReducedModelOptimization::xRange beamA{"A", 0.001, 1000};
ReducedModelOptimization::xRange beamI2{"I2", 0.001, 1000};
ReducedModelOptimization::xRange beamI3{"I3", 0.001, 1000};
ReducedModelOptimization::xRange beamJ{"J", 0.001, 1000};
ReducedModelOptimization::xRange innerHexagonSize{"HexSize", 0.05, 0.95};
ReducedModelOptimization::xRange innerHexagonAngle{"HexAngle", -30.0, 30.0};
ReducedModelOptimization::Settings settings_optimization;
ReducedPatternOptimization::xRange beamE{"E", 0.001, 1000};
ReducedPatternOptimization::xRange beamA{"A", 0.001, 1000};
ReducedPatternOptimization::xRange beamI2{"I2", 0.001, 1000};
ReducedPatternOptimization::xRange beamI3{"I3", 0.001, 1000};
ReducedPatternOptimization::xRange beamJ{"J", 0.001, 1000};
ReducedPatternOptimization::xRange innerHexagonSize{"HexSize", 0.05, 0.95};
ReducedPatternOptimization::xRange innerHexagonAngle{"HexAngle", -30.0, 30.0};
ReducedPatternOptimization::Settings settings_optimization;
settings_optimization.xRanges = {beamE,beamA,beamJ,beamI2,beamI3,
innerHexagonSize, innerHexagonAngle};
const bool input_numberOfFunctionCallsDefined = argc >= 4;
settings_optimization.numberOfFunctionCalls =
input_numberOfFunctionCallsDefined ? std::atoi(argv[3]) : 100;
settings_optimization.normalizationStrategy
= ReducedModelOptimization::Settings::NormalizationStrategy::Epsilon;
= ReducedPatternOptimization::Settings::NormalizationStrategy::Epsilon;
settings_optimization.normalizationParameter = 0.0003;
settings_optimization.solutionAccuracy = 0.001;
settings_optimization.solverAccuracy = 0.001;
settings_optimization.objectiveWeights.translational = std::atof(argv[4]);
settings_optimization.objectiveWeights.rotational = 2 - std::atof(argv[4]);
// Optimize pair
const std::string pairName =
fullPattern.getLabel() + "@" + reducedPattern.getLabel();
const std::vector<size_t> numberOfNodesPerSlot{1, 0, 0, 2, 1, 2, 1};
assert(interfaceNodeIndex==numberOfNodesPerSlot[0]+numberOfNodesPerSlot[3]);
ReducedModelOptimizer optimizer(numberOfNodesPerSlot);
optimizer.initializePatterns(fullPattern, reducedPattern, {},settings_optimization.xRanges.size());
ReducedModelOptimization::Results optimizationResults =
optimizer.optimize(settings_optimization);
// Export results
const bool input_resultDirectoryDefined = argc >= 5;
std::string optimizationResultsDirectory =
input_resultDirectoryDefined ? argv[4] : std::filesystem::current_path().append("OptimizationResults");
const std::string pairName = fullPattern.getLabel() + "@" + reducedPattern.getLabel();
const std::string optimizationName = pairName + "("
+ std::to_string(settings_optimization.numberOfFunctionCalls)
+ "_"
+ to_string_with_precision(
settings_optimization.objectiveWeights.translational)
+ ")";
const bool input_resultDirectoryDefined = argc >= 6;
const std::string optimizationResultsDirectory = input_resultDirectoryDefined
? argv[5]
: std::filesystem::current_path().append(
"OptimizationResults").string();
std::string resultsOutputDir;
if (optimizationResults.numberOfSimulationCrashes != 0) {
const auto crashedJobsDirPath =
std::filesystem::path(optimizationResultsDirectory)
.append("CrashedJobs")
.append(pairName);
std::filesystem::create_directories(crashedJobsDirPath);
resultsOutputDir = crashedJobsDirPath.string();
} else {
std::filesystem::path convergedJobsDirPath(
std::filesystem::path(optimizationResultsDirectory)
.append("ConvergedJobs")
.append(pairName));
std::filesystem::create_directories(convergedJobsDirPath);
resultsOutputDir = convergedJobsDirPath.string();
bool optimizationResultFolderExists = false;
const std::filesystem::path crashedJobsDirPath(std::filesystem::path(optimizationResultsDirectory)
.append("CrashedJobs")
.append(optimizationName));
if (std::filesystem::exists(crashedJobsDirPath)) {
resultsOutputDir = crashedJobsDirPath.string();
optimizationResultFolderExists = true;
}
const std::filesystem::path convergedJobsDirPath(
std::filesystem::path(optimizationResultsDirectory)
.append("ConvergedJobs")
.append(optimizationName));
if (std::filesystem::exists(convergedJobsDirPath)) {
resultsOutputDir = convergedJobsDirPath.string();
optimizationResultFolderExists = true;
}
ReducedPatternOptimization::Results optimizationResults;
bool optimizationAlreadyComputed = optimizationResultFolderExists;
// bool optimizationAlreadyComputed = false;
// if (optimizationResultFolderExists) {
// const bool resultsWereSuccessfullyLoaded = optimizationResults.load(resultsOutputDir);
// if (resultsWereSuccessfullyLoaded && optimizationResults.settings == settings_optimization) {
// }
// }
if (!optimizationAlreadyComputed) {
auto start = std::chrono::system_clock::now();
const std::vector<size_t> numberOfNodesPerSlot{1, 0, 0, 2, 1, 2, 1};
assert(interfaceNodeIndex == numberOfNodesPerSlot[0] + numberOfNodesPerSlot[3]);
ReducedModelOptimizer optimizer(numberOfNodesPerSlot);
optimizer.initializePatterns(fullPattern,
reducedPattern,
settings_optimization.xRanges.size());
optimizer.optimize(settings_optimization, optimizationResults);
optimizationResults.label = optimizationName;
optimizationResults.baseTriangleFullPattern.copy(fullPattern);
optimizationResults.settings = settings_optimization;
auto end = std::chrono::system_clock::now();
auto elapsed = std::chrono::duration_cast<std::chrono::milliseconds>(end - start);
optimizationResults.time = elapsed.count() / 1000.0;
if (optimizationResults.wasSuccessful) {
resultsOutputDir = convergedJobsDirPath.string();
csvFile csv_results({}, false);
// csvFile csv_results(std::filesystem::path(resultsOutputDir).append("optimizationDistances.csv"), false);
csv_results << "Name";
optimizationResults.writeHeaderTo(csv_results);
settings_optimization.writeHeaderTo(csv_results);
csv_results << endrow;
csv_results << std::to_string(fullPattern.EN()) + "#" + pairName;
optimizationResults.writeResultsTo(settings_optimization, csv_results);
settings_optimization.writeSettingsTo(csv_results);
csv_results << endrow;
} else {
resultsOutputDir = crashedJobsDirPath.string();
}
optimizationResults.save(resultsOutputDir, true);
}
optimizationResults.save(resultsOutputDir);
// Write results in csv
csvFile csv_results({}, false);
// csvFile csv_results(std::filesystem::path(dirPath_thisOptimization)
// .append("results.csv")
// .string(),
// false);
csv_results << "Name";
optimizationResults.writeHeaderTo(csv_results);
settings_optimization.writeHeaderTo(csv_results);
csv_results << endrow;
csv_results << pairName;
optimizationResults.writeResultsTo(settings_optimization, csv_results);
settings_optimization.writeSettingsTo(csv_results);
csv_results << endrow;
#ifdef POLYSCOPE_DEFINED
optimizationResults.draw();
// optimizationResults.saveMeshFiles();
optimizationResults.draw();
#endif
return 0;
}

File diff suppressed because it is too large Load Diff

View File

@ -9,6 +9,8 @@
#include "reducedmodeloptimizer_structs.hpp"
#include "simulationmesh.hpp"
#include <Eigen/Dense>
#include <dlib/global_optimization.h>
#include <dlib/optimization.h>
#ifdef POLYSCOPE_DEFINED
#include "polyscope/color_management.h"
@ -22,106 +24,193 @@ class ReducedModelOptimizer
std::shared_ptr<SimulationMesh> m_pFullPatternSimulationMesh;
std::unordered_map<FullPatternVertexIndex, ReducedPatternVertexIndex>
m_fullToReducedInterfaceViMap;
std::unordered_map<FullPatternVertexIndex, FullPatternVertexIndex>
m_fullPatternOppositeInterfaceViMap;
std::vector<std::pair<FullPatternVertexIndex, FullPatternVertexIndex>>
m_fullPatternOppositeInterfaceViPairs;
std::unordered_map<size_t, size_t> nodeToSlot;
std::unordered_map<size_t, std::unordered_set<size_t>> slotToNode;
#ifdef POLYSCOPE_DEFINED
#endif // POLYSCOPE_DEFINED
std::string optimizationNotes;
std::vector<std::function<
void(const double &,
const std::vector<std::pair<FullPatternVertexIndex, FullPatternVertexIndex>> &,
SimulationJob &)>>
constructBaseScenarioFunctions;
std::vector<bool> scenarioIsSymmetrical;
int fullPatternNumberOfEdges;
public:
inline static int fanSize{6};
inline static VectorType patternPlaneNormal{0, 0, 1};
ReducedModelOptimization::Results optimize(
const ReducedModelOptimization::Settings &xRanges,
const std::vector<ReducedModelOptimization::SimulationScenario> &simulationScenarios
= std::vector<ReducedModelOptimization::SimulationScenario>());
double operator()(const Eigen::VectorXd &x, Eigen::VectorXd &) const;
constexpr static std::array<int, 5> simulationScenariosResolution = {11, 11, 20, 20, 20};
// constexpr static std::array<int, 5> simulationScenariosResolution = {3, 3, 3, 3, 3};
inline static int totalNumberOfSimulationScenarios
= std::accumulate(simulationScenariosResolution.begin(),
simulationScenariosResolution.end(),
0);
inline static int fanSize{6};
inline static double initialHexagonSize{0.3};
inline static VectorType patternPlaneNormal{0, 0, 1};
void optimize(
const ReducedPatternOptimization::Settings &xRanges,
ReducedPatternOptimization::Results &results,
const std::vector<ReducedPatternOptimization::BaseSimulationScenario> &simulationScenarios
= std::vector<ReducedPatternOptimization::BaseSimulationScenario>(
{ReducedPatternOptimization::Axial,
ReducedPatternOptimization::Shear,
ReducedPatternOptimization::Bending,
ReducedPatternOptimization::Dome,
ReducedPatternOptimization::Saddle}));
double operator()(const Eigen::VectorXd &x, Eigen::VectorXd &) const;
ReducedModelOptimizer(const std::vector<size_t> &numberOfNodesPerSlot);
static void computeReducedModelSimulationJob(
const SimulationJob &simulationJobOfFullModel,
const std::unordered_map<size_t, size_t> &fullToReducedMap,
SimulationJob &simulationJobOfReducedModel);
ReducedModelOptimizer(const std::vector<size_t> &numberOfNodesPerSlot);
static void computeReducedModelSimulationJob(
const SimulationJob &simulationJobOfFullModel,
const std::unordered_map<size_t, size_t> &fullToReducedMap,
SimulationJob &simulationJobOfReducedModel);
SimulationJob
getReducedSimulationJob(const SimulationJob &fullModelSimulationJob);
SimulationJob getReducedSimulationJob(const SimulationJob &fullModelSimulationJob);
void initializePatterns(PatternGeometry &fullPattern, PatternGeometry &reducedPatterm,
const std::unordered_set<size_t> &reducedModelExcludedEges, const int &optimizationParameters);
void initializePatterns(PatternGeometry &fullPattern,
PatternGeometry &reducedPatterm,
const int &optimizationParameters);
static void runSimulation(const std::string &filename,
std::vector<double> &x);
static void runSimulation(const std::string &filename, std::vector<double> &x);
static double objective(double x2, double A, double J, double I2, double I3, double x3,
double innerHexagonRotationAngle);
static double objective(double b, double r, double E);
static double objective(double x2,
double A,
double J,
double I2,
double I3,
double x3,
double innerHexagonRotationAngle);
static double objective(double b, double r, double E);
static std::vector<std::shared_ptr<SimulationJob>>
createScenarios(const std::shared_ptr<SimulationMesh> &pMesh,
const std::unordered_map<size_t, size_t>
&fullPatternOppositeInterfaceViMap);
static std::vector<std::shared_ptr<SimulationJob>> createFullPatternSimulationJobs(
const std::shared_ptr<SimulationMesh> &pMesh,
const std::unordered_map<size_t, size_t> &fullPatternOppositeInterfaceViMap);
static void createSimulationMeshes(
PatternGeometry &fullModel, PatternGeometry &reducedModel,
std::shared_ptr<SimulationMesh> &pFullPatternSimulationMesh,
std::shared_ptr<SimulationMesh> &pReducedPatternSimulationMesh);
static void computeMaps(
const std::unordered_set<size_t> &reducedModelExcludedEdges,
const std::unordered_map<size_t, std::unordered_set<size_t>> &slotToNode,
PatternGeometry &fullPattern, PatternGeometry &reducedPattern,
std::unordered_map<ReducedPatternVertexIndex, FullPatternVertexIndex>
&reducedToFullInterfaceViMap,
std::unordered_map<FullPatternVertexIndex, ReducedPatternVertexIndex>
&fullToReducedInterfaceViMap,
std::unordered_map<FullPatternVertexIndex, ReducedPatternVertexIndex>
&fullPatternOppositeInterfaceViMap);
static void visualizeResults(
const std::vector<std::shared_ptr<SimulationJob>> &fullPatternSimulationJobs,
const std::vector<std::shared_ptr<SimulationJob>> &reducedPatternSimulationJobs,
const std::vector<ReducedModelOptimization::SimulationScenario> &simulationScenarios,
const std::unordered_map<ReducedPatternVertexIndex, FullPatternVertexIndex>
&reducedToFullInterfaceViMap);
static void registerResultsForDrawing(
const std::shared_ptr<SimulationJob> &pFullPatternSimulationJob,
const std::shared_ptr<SimulationJob> &pReducedPatternSimulationJob,
const std::unordered_map<ReducedPatternVertexIndex,
FullPatternVertexIndex>
&reducedToFullInterfaceViMap);
static void createSimulationMeshes(
PatternGeometry &fullModel,
PatternGeometry &reducedModel,
std::shared_ptr<SimulationMesh> &pFullPatternSimulationMesh,
std::shared_ptr<SimulationMesh> &pReducedPatternSimulationMesh);
static void computeMaps(const std::unordered_map<size_t, std::unordered_set<size_t>> &slotToNode,
PatternGeometry &fullPattern,
PatternGeometry &reducedPattern,
std::unordered_map<ReducedPatternVertexIndex, FullPatternVertexIndex>
&reducedToFullInterfaceViMap,
std::unordered_map<FullPatternVertexIndex, ReducedPatternVertexIndex>
&fullToReducedInterfaceViMap,
std::vector<std::pair<FullPatternVertexIndex, ReducedPatternVertexIndex>>
&fullPatternOppositeInterfaceViMap);
static void visualizeResults(
const std::vector<std::shared_ptr<SimulationJob>> &fullPatternSimulationJobs,
const std::vector<std::shared_ptr<SimulationJob>> &reducedPatternSimulationJobs,
const std::vector<ReducedPatternOptimization::BaseSimulationScenario> &simulationScenarios,
const std::unordered_map<ReducedPatternVertexIndex, FullPatternVertexIndex>
&reducedToFullInterfaceViMap);
static void registerResultsForDrawing(
const std::shared_ptr<SimulationJob> &pFullPatternSimulationJob,
const std::shared_ptr<SimulationJob> &pReducedPatternSimulationJob,
const std::unordered_map<ReducedPatternVertexIndex, FullPatternVertexIndex>
&reducedToFullInterfaceViMap);
static double computeRawDisplacementError(
const std::vector<Vector6d> &reducedPatternDisplacements,
const std::vector<Vector6d> &fullPatternDisplacements,
const std::unordered_map<ReducedPatternVertexIndex, FullPatternVertexIndex>
&reducedToFullInterfaceViMap);
static double computeRawTranslationalError(
const std::vector<Vector6d> &fullPatternDisplacements,
const std::vector<Vector6d> &reducedPatternDisplacements,
const std::unordered_map<ReducedPatternVertexIndex, FullPatternVertexIndex>
&reducedToFullInterfaceViMap);
static double computeDisplacementError(
const std::vector<Vector6d> &reducedPatternDisplacements,
const std::vector<Vector6d> &fullPatternDisplacements,
const std::unordered_map<ReducedPatternVertexIndex, FullPatternVertexIndex>
&reducedToFullInterfaceViMap,
const double &normalizationFactor);
static double computeDisplacementError(
const std::vector<Vector6d> &fullPatternDisplacements,
const std::vector<Vector6d> &reducedPatternDisplacements,
const std::unordered_map<ReducedPatternVertexIndex, FullPatternVertexIndex>
&reducedToFullInterfaceViMap,
const double &normalizationFactor);
static double objective(double E, double A, double innerHexagonSize, double innerHexagonRotationAngle);
private:
static void computeDesiredReducedModelDisplacements(
const SimulationResults &fullModelResults,
const std::unordered_map<size_t, size_t> &displacementsReducedToFullMap,
Eigen::MatrixX3d &optimalDisplacementsOfReducedModel);
static ReducedModelOptimization::Results runOptimization(
const ReducedModelOptimization::Settings &settings);
std::vector<std::shared_ptr<SimulationJob>> createScenarios(
const std::shared_ptr<SimulationMesh> &pMesh);
void computeMaps(PatternGeometry &fullModel,
PatternGeometry &reducedPattern,
const std::unordered_set<size_t> &reducedModelExcludedEges);
void createSimulationMeshes(PatternGeometry &fullModel, PatternGeometry &reducedModel);
static void initializeOptimizationParameters(const std::shared_ptr<SimulationMesh> &mesh,
const int &optimizationParamters);
static double objective(double E,
double A,
double innerHexagonSize,
double innerHexagonRotationAngle);
static double computeRawRotationalError(
const std::vector<Eigen::Quaternion<double>> &rotatedQuaternion_fullPattern,
const std::vector<Eigen::Quaternion<double>> &rotatedQuaternion_reducedPattern,
const std::unordered_map<ReducedPatternVertexIndex, FullPatternVertexIndex>
&reducedToFullInterfaceViMap);
static double objective(long n, const double *x);
DRMSimulationModel simulator;
void computeObjectiveValueNormalizationFactors();
static double computeRotationalError(
const std::vector<Eigen::Quaternion<double>> &rotatedQuaternion_fullPattern,
const std::vector<Eigen::Quaternion<double>> &rotatedQuaternion_reducedPattern,
const std::unordered_map<ReducedPatternVertexIndex, FullPatternVertexIndex>
&reducedToFullInterfaceViMap,
const double &normalizationFactor);
static double computeError(
const SimulationResults &simulationResults_fullPattern,
const SimulationResults &simulationResults_reducedPattern,
const std::unordered_map<ReducedPatternVertexIndex, FullPatternVertexIndex>
&reducedToFullInterfaceViMap,
const double &normalizationFactor_translationalDisplacement,
const double &normalizationFactor_rotationalDisplacement);
static void constructAxialSimulationScenario(
const double &forceMagnitude,
const std::vector<std::pair<FullPatternVertexIndex, FullPatternVertexIndex>>
&oppositeInterfaceViPairs,
SimulationJob &job);
static void constructShearSimulationScenario(
const double &forceMagnitude,
const std::vector<std::pair<FullPatternVertexIndex, FullPatternVertexIndex>>
&oppositeInterfaceViPairs,
SimulationJob &job);
static void constructBendingSimulationScenario(
const double &forceMagnitude,
const std::vector<std::pair<FullPatternVertexIndex, FullPatternVertexIndex>>
&oppositeInterfaceViPairs,
SimulationJob &job);
static void constructDomeSimulationScenario(
const double &forceMagnitude,
const std::vector<std::pair<FullPatternVertexIndex, FullPatternVertexIndex>>
&oppositeInterfaceViPairs,
SimulationJob &job);
static void constructSaddleSimulationScenario(
const double &forceMagnitude,
const std::vector<std::pair<FullPatternVertexIndex, FullPatternVertexIndex>>
&oppositeInterfaceViPairs,
SimulationJob &job);
private:
static void computeDesiredReducedModelDisplacements(
const SimulationResults &fullModelResults,
const std::unordered_map<size_t, size_t> &displacementsReducedToFullMap,
Eigen::MatrixX3d &optimalDisplacementsOfReducedModel);
static void runOptimization(const ReducedPatternOptimization::Settings &settings,
ReducedPatternOptimization::Results &results);
std::vector<std::shared_ptr<SimulationJob>> createFullPatternSimulationJobs(
const std::shared_ptr<SimulationMesh> &pMesh,
const std::vector<std::pair<ReducedPatternOptimization::BaseSimulationScenario, double>>
&maxForceMagnitudes);
void computeMaps(PatternGeometry &fullModel, PatternGeometry &reducedPattern);
void createSimulationMeshes(PatternGeometry &fullModel, PatternGeometry &reducedModel);
static void initializeOptimizationParameters(const std::shared_ptr<SimulationMesh> &mesh,
const int &optimizationParamters);
static double objective(long n, const double *x);
DRMSimulationModel simulator;
void computeObjectiveValueNormalizationFactors();
static void getResults(const dlib::function_evaluation &optimizationResult_dlib,
const ReducedPatternOptimization::Settings &settings,
ReducedPatternOptimization::Results &results);
double computeFullPatternMaxSimulationForce(
const ReducedPatternOptimization::BaseSimulationScenario &scenario);
std::vector<std::pair<ReducedPatternOptimization::BaseSimulationScenario, double>>
computeFullPatternMaxSimulationForces(
const std::vector<ReducedPatternOptimization::BaseSimulationScenario>
&desiredBaseSimulationScenarioIndices);
std::vector<std::pair<ReducedPatternOptimization::BaseSimulationScenario, double>>
getFullPatternMaxSimulationForces(
const std::vector<ReducedPatternOptimization::BaseSimulationScenario>
&desiredBaseSimulationScenarioIndices);
};
void updateMesh(long n, const double *x);
#endif // REDUCEDMODELOPTIMIZER_HPP