Skip to content

Commit 006a023

Browse files
authored
ENH: Implement Watson and von-Mises Fisher Orientation Averaging (#41)
* Initial port of codes from EMsoft to average orientations * Adding Unit test for VMF and Watson sampling Orientation Average * Fixing the PRNG functions to match EMsoft * Directional Stats Unit tests updates for Average Orientations * TEST: DirectionalStats + Avg Orientation Testing Implemented * VER: Update EbsdLib version to 2.3.0 --------- Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
1 parent fe6711d commit 006a023

31 files changed

Lines changed: 41220 additions & 129 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ release
3737
debug
3838
Test/ProjectTest/Build
3939
CMakeUserPresets.json
40+
.claude
4041

4142
# Python build-related files
4243
pyebsd/build/

CMakeLists.txt

Lines changed: 69 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ option(EbsdLib_BUILD_H5SUPPORT "Build H5Support Library" OFF)
3737

3838

3939
# set project's name
40-
project(EbsdLibProj VERSION 2.2.0)
40+
project(EbsdLibProj VERSION 2.3.0)
4141

4242

4343
# Request C++17 standard, using new CMake variables.
44-
set(CMAKE_CXX_STANDARD 17)
44+
set(CMAKE_CXX_STANDARD 20)
4545
set(CMAKE_CXX_STANDARD_REQUIRED ON)
4646
set(CMAKE_CXX_EXTENSIONS OFF)
4747

@@ -114,6 +114,13 @@ else()
114114
message(WARNING "The Eigen Library is required for some algorithms to execute. These algorithms will be disabled.")
115115
endif()
116116

117+
118+
# -----------------------------------------------------------------------
119+
# Find FMT library
120+
# -----------------------------------------------------------------------
121+
find_package(fmt CONFIG REQUIRED)
122+
123+
117124
#-------------------------------------------------------------------------------
118125
# Determine if we need the ghcFilesystem library
119126
#-------------------------------------------------------------------------------
@@ -160,6 +167,66 @@ endif()
160167

161168
include(${EbsdLibProj_SOURCE_DIR}/Source/EbsdLib/SourceList.cmake)
162169

170+
171+
172+
# ------------------------------------------------------------------------------
173+
# Check if a different Data_Archive web site is being used.
174+
# The alternate would be for the internal build bots that can download from a
175+
# local webserver
176+
# ------------------------------------------------------------------------------
177+
if("${DATA_ARCHIVE_WEB_SITE}" STREQUAL "")
178+
set(DATA_ARCHIVE_WEB_SITE "https://github.com/bluequartzsoftware/ebsdlib/releases/download/Data_Archive/")
179+
endif()
180+
181+
file(TO_CMAKE_PATH "${EBSDLIB_DATA_DIR}" EBSDLIB_DATA_DIR_NORM)
182+
183+
184+
# -----------------------------------------------------------------------
185+
# This section creates a global file that holds the commands to copy data
186+
# files, test data files, pipelines into a single cmake file that gets
187+
# generated. This reduces the many copy targets to a single target.
188+
# -----------------------------------------------------------------------
189+
set_property(GLOBAL PROPERTY FETCH_FILE_INDEX 0)
190+
set(FETCH_FILE_PATH "${EbsdLibProj_BINARY_DIR}/EbsdLibProj_fetch_remote_files.cmake")
191+
set_property(GLOBAL PROPERTY FETCH_FILE_PATH "${FETCH_FILE_PATH}")
192+
file(WRITE ${FETCH_FILE_PATH} "# -----------------------------------------------------------------------
193+
# This file is programmatically generated from the CMake file ${CMAKE_CURRENT_LIST_FILE}
194+
# This file has the commands to download each of the test files.
195+
# The WORKING_DIRECTORY is set to the following CMake code:
196+
# ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/$<$<CONFIG:Debug>:Debug>$<$<CONFIG:Release>:Release>
197+
# -----------------------------------------------------------------------\n
198+
cmake_policy(SET CMP0012 NEW)
199+
cmake_policy(SET CMP0054 NEW)
200+
# The ``FindPythonInterp`` and ``FindPythonLibs`` modules are removed.
201+
# if(CMAKE_VERSION VERSION_GREATER \"3.27.0\")
202+
# cmake_policy(SET CMP0148 NEW)
203+
# endif()
204+
# resolves symlinks before collapsing ../ components.
205+
if(CMAKE_VERSION VERSION_GREATER \"3.28.0\")
206+
cmake_policy(SET CMP0152 NEW)
207+
endif()
208+
set(CONFIG \${CMAKE_CONFIG})
209+
set(LOG_FILE \"${EbsdLibProj_BINARY_DIR}/EbsdLibProj_fetch_remote_files.log\")\n
210+
FILE(WRITE \"\${LOG_FILE}\" \"Featch File Log Start\n\")\n
211+
")
212+
213+
message(STATUS "FETCH_FILE_PATH: ${FETCH_FILE_PATH}")
214+
215+
set(TEST_WORKING_DIR "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
216+
if(CMAKE_GENERATOR MATCHES "Visual Studio")
217+
set(TEST_WORKING_DIR "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/$<$<CONFIG:Debug>:Debug>$<$<CONFIG:Release>:Release>")
218+
endif()
219+
220+
if(EBSDLIB_DOWNLOAD_TEST_FILES)
221+
add_custom_target(EbsdLib_Fetch_Remote_Data_Files ALL
222+
COMMAND "${CMAKE_COMMAND}" -DCMAKE_CONFIG=$<CONFIG> -P "${FETCH_FILE_PATH}"
223+
COMMENT "Downloading EbsdLib Test Data Files"
224+
# WORKING_DIRECTORY "${TEST_WORKING_DIR}"
225+
)
226+
set_target_properties(EbsdLib_Fetch_Remote_Data_Files PROPERTIES FOLDER ZZ_FETCH_TEST_FILES)
227+
endif()
228+
229+
163230
# ------------------------------------------------------------------------------
164231
# Build Unit Test
165232
# ------------------------------------------------------------------------------

CMakePresets.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,14 @@
6161
"type": "BOOL",
6262
"value": "ON"
6363
},
64+
"EBSDLIB_DOWNLOAD_TEST_FILES": {
65+
"type": "BOOL",
66+
"value": "ON"
67+
},
68+
"EBSDLIB_DATA_DIR": {
69+
"type": "PATH",
70+
"value": "${sourceDir}/../EbsdLib_Data"
71+
},
6472
"BUILDNAME": {
6573
"type": "STRING",
6674
"value": "$env{PRESET_NAME}-$env{BUILD_BUILDNUMBER}-PR$env{SYSTEM_PULLREQUEST_PULLREQUESTNUMBER}"
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
qu
2+
10
3+
0.92934656 -0.36858946 0.0081792902 0.019746415
4+
0.93205625 -0.3620477 0.012823511 -0.0053116297
5+
0.92983103 -0.36758989 0.016257482 -0.0052523925
6+
0.93061996 -0.36583757 0.010389386 -0.0012097559
7+
0.92853022 -0.37113327 -0.0051697767 0.0080596395
8+
0.92621905 -0.37646216 -0.0033933693 -0.019568495
9+
0.92438912 -0.38072789 0.02168753 0.0089833615
10+
0.92300296 -0.38422647 -0.002270041 0.020744085
11+
0.92018086 -0.39103976 -0.018711079 -0.0022371865
12+
0.91371483 -0.40632781 0.0044282493 -0.0018341328

0 commit comments

Comments
 (0)