-
Notifications
You must be signed in to change notification settings - Fork 2
/
ConfigureDataLayout.cmake
54 lines (50 loc) · 2.73 KB
/
ConfigureDataLayout.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
################################################################################
#
# \file ConfigureDataLayout.cmake
# \copyright 2012-2015 J. Bakosi,
# 2016-2018 Los Alamos National Security, LLC.,
# 2019-2021 Triad National Security, LLC.
# All rights reserved. See the LICENSE file for details.
# \brief Configure data layouts
#
################################################################################
# Configure data layout for particle data
# Available options
set(PARTICLE_DATA_LAYOUT_VALUES "particle" "equation")
# Initialize all to off
set(PARTICLE_DATA_LAYOUT_AS_PARTICLE_MAJOR off) # 0
set(PARTICLE_DATA_LAYOUT_AS_EQUATION_MAJOR off) # 1
# Set default and select from list
set(PARTICLE_DATA_LAYOUT "particle" CACHE STRING "Particle data layout. Default: (particle-major). Available options: ${PARTICLE_DATA_LAYOUT_VALUES}(-major).")
SET_PROPERTY (CACHE PARTICLE_DATA_LAYOUT PROPERTY STRINGS ${PARTICLE_DATA_LAYOUT_VALUES})
STRING (TOLOWER ${PARTICLE_DATA_LAYOUT} PARTICLE_DATA_LAYOUT)
LIST (FIND PARTICLE_DATA_LAYOUT_VALUES ${PARTICLE_DATA_LAYOUT} PARTICLE_DATA_LAYOUT_INDEX)
# Evaluate selected option and put in a define for it
IF (${PARTICLE_DATA_LAYOUT_INDEX} EQUAL 0)
set(PARTICLE_DATA_LAYOUT_AS_PARTICLE_MAJOR on)
ELSEIF (${PARTICLE_DATA_LAYOUT_INDEX} EQUAL 1)
set(PARTICLE_DATA_LAYOUT_AS_EQUATION_MAJOR on)
ELSEIF (${PARTICLE_DATA_LAYOUT_INDEX} EQUAL -1)
MESSAGE(FATAL_ERROR "Particle data layout '${PARTICLE_DATA_LAYOUT}' not supported, valid entries are ${PARTICLE_DATA_LAYOUT_VALUES}(-major).")
ENDIF()
message(STATUS "Particle data layout: " ${PARTICLE_DATA_LAYOUT} "(-major)")
# Configure data layout for mesh field data
# Available options
set(FIELD_DATA_LAYOUT_VALUES "field" "equation")
# Initialize all to off
set(FIELD_DATA_LAYOUT_AS_FIELD_MAJOR off) # 0
set(FIELD_DATA_LAYOUT_AS_EQUATION_MAJOR off) # 1
# Set default and select from list
set(FIELD_DATA_LAYOUT "field" CACHE STRING "Mesh field data layout. Default: (field-major). Available options: ${FIELD_DATA_LAYOUT_VALUES}(-major).")
SET_PROPERTY (CACHE FIELD_DATA_LAYOUT PROPERTY STRINGS ${FIELD_DATA_LAYOUT_VALUES})
STRING (TOLOWER ${FIELD_DATA_LAYOUT} FIELD_DATA_LAYOUT)
LIST (FIND FIELD_DATA_LAYOUT_VALUES ${FIELD_DATA_LAYOUT} FIELD_DATA_LAYOUT_INDEX)
# Evaluate selected option and put in a define for it
IF (${FIELD_DATA_LAYOUT_INDEX} EQUAL 0)
set(FIELD_DATA_LAYOUT_AS_FIELD_MAJOR on)
ELSEIF (${FIELD_DATA_LAYOUT_INDEX} EQUAL 1)
set(FIELD_DATA_LAYOUT_AS_EQUATION_MAJOR on)
ELSEIF (${FIELD_DATA_LAYOUT_INDEX} EQUAL -1)
MESSAGE(FATAL_ERROR "Mesh field data layout '${FIELD_DATA_LAYOUT}' not supported, valid entries are ${FIELD_DATA_LAYOUT_VALUES}(-major).")
ENDIF()
message(STATUS "Mesh field data layout: " ${FIELD_DATA_LAYOUT} "(-major)")