Compare commits

..

No commits in common. "master" and "linearSimulationModel" have entirely different histories.

59 changed files with 2075 additions and 1268 deletions

View File

@ -1,8 +1,5 @@
cmake_minimum_required(VERSION 2.8) cmake_minimum_required(VERSION 2.8)
project(ReducedModelOptimization) 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 #Add the project cmake scripts to the module path
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
@ -15,14 +12,7 @@ else()
set(UPDATE_DISCONNECTED_IF_AVAILABLE "UPDATE_DISCONNECTED 1") set(UPDATE_DISCONNECTED_IF_AVAILABLE "UPDATE_DISCONNECTED 1")
endif() 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 ##Create directory for the external libraries
file(MAKE_DIRECTORY ${EXTERNAL_DEPS_DIR}) file(MAKE_DIRECTORY ${EXTERNAL_DEPS_DIR})

View File

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,27 @@
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

@ -0,0 +1,26 @@
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

@ -0,0 +1,26 @@
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 -0.8660254037844387 0 255 255 255 255
0.3333333333333333 -0.5773502691896258 0 255 255 255 255 0.3333333333333333 -0.5773502691896258 0 255 255 255 255
0.1666666666666666 -0.288675134594813 0 255 255 255 255 0.1666666666666666 -0.288675134594813 0 255 255 255 255
0 -0.3333333 0 255 255 255 255 0.1 -0.5773502691896258 0 255 255 255 255
0 3 0 3

View File

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

File diff suppressed because it is too large Load Diff

View File

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