Skip to content

Commit d3e39f5

Browse files
committed
add files
1 parent 246fed3 commit d3e39f5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+18419
-0
lines changed

.clang-format

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Generated from CLion C/C++ Code Style settings
2+
BasedOnStyle: LLVM
3+
AccessModifierOffset: -2
4+
AlignAfterOpenBracket: Align
5+
AlignConsecutiveAssignments:
6+
Enabled: true
7+
AlignCompound: true
8+
AlignOperands: Align
9+
AllowAllArgumentsOnNextLine: false
10+
AllowAllConstructorInitializersOnNextLine: false
11+
AllowAllParametersOfDeclarationOnNextLine: false
12+
AllowShortBlocksOnASingleLine: Always
13+
AllowShortCaseLabelsOnASingleLine: false
14+
AllowShortFunctionsOnASingleLine: All
15+
AllowShortIfStatementsOnASingleLine: Always
16+
AllowShortLambdasOnASingleLine: All
17+
AllowShortLoopsOnASingleLine: true
18+
AlwaysBreakAfterReturnType: None
19+
AlwaysBreakTemplateDeclarations: Yes
20+
BinPackArguments: false
21+
BreakBeforeBraces: Custom
22+
BraceWrapping:
23+
AfterCaseLabel: false
24+
AfterClass: false
25+
AfterControlStatement: Never
26+
AfterEnum: false
27+
AfterFunction: false
28+
AfterNamespace: false
29+
AfterUnion: false
30+
BeforeCatch: false
31+
BeforeElse: false
32+
IndentBraces: false
33+
SplitEmptyFunction: false
34+
SplitEmptyRecord: true
35+
BreakBeforeBinaryOperators: None
36+
BreakBeforeTernaryOperators: true
37+
BreakConstructorInitializers: AfterColon
38+
BreakInheritanceList: BeforeColon
39+
ColumnLimit: 0
40+
CompactNamespaces: false
41+
ContinuationIndentWidth: 4
42+
IndentCaseLabels: true
43+
IndentPPDirectives: None
44+
IndentWidth: 2
45+
KeepEmptyLinesAtTheStartOfBlocks: true
46+
MaxEmptyLinesToKeep: 2
47+
NamespaceIndentation: All
48+
ObjCSpaceAfterProperty: false
49+
ObjCSpaceBeforeProtocolList: true
50+
PointerAlignment: Right
51+
ReflowComments: false
52+
SpaceAfterCStyleCast: true
53+
SpaceAfterLogicalNot: false
54+
SpaceAfterTemplateKeyword: false
55+
SpaceBeforeAssignmentOperators: true
56+
SpaceBeforeCpp11BracedList: false
57+
SpaceBeforeCtorInitializerColon: true
58+
SpaceBeforeInheritanceColon: true
59+
SpaceBeforeParens: ControlStatements
60+
SpaceBeforeRangeBasedForLoopColon: false
61+
SpaceInEmptyParentheses: false
62+
SpacesBeforeTrailingComments: 4
63+
SpacesInAngles: false
64+
SpacesInCStyleCastParentheses: false
65+
SpacesInContainerLiterals: false
66+
SpacesInParentheses: false
67+
SpacesInSquareBrackets: false
68+
TabWidth: 2
69+
UseTab: ForIndentation
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Build-sphinx-docs
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: write # Allows pushing to the repo
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Check out repository
19+
uses: actions/checkout@v3 # Updated to v3 for better token handling
20+
21+
- name: Set up Python 3.10
22+
uses: actions/setup-python@v2
23+
with:
24+
python-version: "3.10"
25+
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
python -m pip install -U sphinx
30+
python -m pip install sphinx-book-theme
31+
python -m pip install sphinx-autoapi
32+
python -m pip install ghp-import
33+
34+
- name: Build HTML
35+
run: |
36+
cd doc/
37+
make html
38+
39+
- name: Deploy with ghp-import
40+
run: |
41+
git config --global user.name "github-actions[bot]"
42+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
43+
ghp-import -n -p -f doc/build/html
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Ensures authentication

.gitignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
cmake-build*
2+
.idea
3+
build/
4+
venv/
5+
.venv/
6+
.cache
7+
.vscode/
8+
run/*
9+
__pycache__/
10+
Testing
11+
*.mp4
12+
**.csv
13+
**.vtu
14+
**.vth
15+
**.png
16+
*.out
17+
*.pdf
18+
.DS_Store
19+
convergence.py
20+
out/
21+
mesh.stl

CMakeLists.txt

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
cmake_minimum_required(VERSION 3.16)
2+
project(DACTI)
3+
4+
# fix policy warning
5+
cmake_policy(SET CMP0135 NEW)
6+
7+
set(ENABLE_OPENGL_SUPPORT "OFF")
8+
set(ENABLE_TRACY_PROFILING "OFF")
9+
10+
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fopenmp -O3 -march=native")
11+
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fopenmp")
12+
13+
set(CMAKE_NINJA_FORCE_RESPONSE_FILE "ON" CACHE BOOL "Force Ninja to use response files.")
14+
15+
##########
16+
# DACTI LIB
17+
##########
18+
include_directories(${PROJECT_SOURCE_DIR}/src/lib)
19+
file(GLOB_RECURSE LIB_SRC src/lib/*.cpp)
20+
add_library(dacti ${LIB_SRC})
21+
target_compile_features(dacti PUBLIC cxx_std_20)
22+
23+
##########
24+
# LOCAL LIBS
25+
##########
26+
find_package(VTK 9.3 COMPONENTS
27+
CommonCore
28+
CommonDataModel
29+
FiltersGeneral
30+
IOXML
31+
)
32+
set(LIBS ${VTK_LIBRARIES})
33+
34+
find_package(OpenMP)
35+
set(LIBS ${LIBS} OpenMP::OpenMP_CXX)
36+
37+
##########
38+
# EXTERNAL LIBS
39+
##########
40+
add_subdirectory(ext)
41+
42+
if(ENABLE_OPENGL_SUPPORT)
43+
find_package(OpenGL)
44+
set(LIBS ${LIBS} glfw OpenGL::GL libglew_static)
45+
message("OpenGL visualization enabled")
46+
endif()
47+
48+
if(ENABLE_TRACY_PROFILING)
49+
set(LIBS ${LIBS} Tracy::TracyClient)
50+
message("Tracy enabled")
51+
endif()
52+
53+
set(LIBS ${LIBS}
54+
fmt::fmt
55+
vtu11::vtu11
56+
spdlog
57+
Eigen3::Eigen
58+
igl::core
59+
igl::embree
60+
igl::glfw
61+
tomlplusplus::tomlplusplus
62+
)
63+
64+
##########
65+
# LINK LIBS
66+
##########
67+
target_link_libraries(dacti ${LIBS})
68+
69+
##########
70+
# EXAMPLES
71+
##########
72+
function(link_example NAME)
73+
target_link_libraries(${NAME} dacti)
74+
if(ENABLE_OPENGL_SUPPORT)
75+
target_compile_definitions(${NAME} PUBLIC GL_VIS)
76+
endif()
77+
if(ENABLE_TRACY_PROFILING)
78+
target_compile_definitions(${NAME} PUBLIC DACTI_PROFILER_ON)
79+
endif()
80+
target_include_directories(${NAME} PUBLIC ${INC_PATH})
81+
target_compile_definitions(${NAME} PUBLIC DACTI_EXAMPLE_NAME="${NAME}")
82+
83+
set_target_properties(${NAME} PROPERTIES CXX_STANDARD 20)
84+
set_target_properties(${NAME} PROPERTIES CXX_STANDARD_REQUIRED ON)
85+
# set_target_properties(${NAME} PROPERTIES COMPILE_FLAGS "-fopenmp -O3 -march=native")
86+
endfunction()
87+
88+
# build EXAMPLE_FILES list using glob
89+
file(GLOB_RECURSE EXAMPLE_FILES src/examples/*.cpp)
90+
91+
# add example for each .cpp file in EXAMPLE_FILES
92+
foreach(example_file ${EXAMPLE_FILES})
93+
get_filename_component(example_name ${example_file} NAME_WE)
94+
add_executable(${example_name} ${example_file})
95+
link_example(${example_name})
96+
endforeach()

cases/cylinder.toml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
[scene]
2+
name = "cylinder"
3+
domain_size = [8.0, 8.0]
4+
5+
[run]
6+
print_interval = 0.0015
7+
end_time = 0.3
8+
9+
[integrator]
10+
min_refinement_level = 2
11+
max_refinement_level = 10
12+
max_refinement_level_geom = 11
13+
refinement_radius = 2.0
14+
error_threshold = [5e-3, 1e-2]
15+
error_weights = [1.0, 0.01, 0.01, 1e-5]
16+
max_cfl = 0.4
17+
18+
[model.reference_values]
19+
rho = 1.2
20+
Ma = 0.3
21+
vel_angle = 1.0
22+
p = 101325.0
23+
L = 0.4
24+
Re = 120.0
25+
26+
[initial_condition]
27+
type = "uniform"
28+
value = "reference"
29+
30+
[[geometry]]
31+
name = "object"
32+
shape = "ellipse"
33+
a = 0.2
34+
b = 0.2
35+
translation = [-2.0, 0.0, 0.0]
36+
37+
[boundary_conditions.object]
38+
type = "noslip"
39+
40+
[boundary_conditions.X.neg]
41+
type = "inflow"
42+
fade_in = 0.0
43+
44+
[boundary_conditions.X.pos]
45+
type = "outflow"
46+
47+
[boundary_conditions.Y.neg]
48+
type = "freeslip"
49+
50+
[boundary_conditions.Y.pos]
51+
type = "freeslip"

cases/cylinderg.toml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
[scene]
2+
name = "cylinderg"
3+
domain_size = [8.0, 8.0]
4+
5+
[run]
6+
print_interval = 0.0015
7+
end_time = 0.3
8+
9+
[integrator]
10+
min_refinement_level = 2
11+
max_refinement_level = 10
12+
max_refinement_level_geom = 11
13+
refinement_radius = 2.0
14+
error_threshold = [5e-3, 1e-2]
15+
error_weights = [1.0, 0.01, 0.01, 1e-5]
16+
max_cfl = 0.4
17+
max_dt = 5e-6
18+
19+
[model.reference_values]
20+
rho = 1.2
21+
Ma = 0.3
22+
vel_angle = 1.0
23+
p = 101325.0
24+
L = 0.4
25+
Re = 100.0
26+
27+
[initial_condition]
28+
type = "uniform"
29+
value = "reference"
30+
31+
[[geometry]]
32+
name = "object"
33+
shape = "ellipse"
34+
a = 0.2
35+
b = 0.2
36+
translation = [-2.0, 0.0, 0.0]
37+
38+
[boundary_conditions.object]
39+
type = "noslip"
40+
41+
[boundary_conditions.X.neg]
42+
type = "inflow"
43+
fade_in = 0.0
44+
45+
[boundary_conditions.X.pos]
46+
type = "outflow"
47+
48+
[boundary_conditions.Y.neg]
49+
type = "freeslip"
50+
51+
[boundary_conditions.Y.pos]
52+
type = "freeslip"

cases/diamond.toml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
[scene]
2+
name = "diamond"
3+
domain_size = [2.0, 2.0]
4+
5+
[run]
6+
print_interval = 1.0
7+
end_time = 5.0
8+
steady_tol = 1e-5
9+
10+
[integrator]
11+
min_refinement_level = 2
12+
max_refinement_level = 9
13+
refinement_radius = 3.0
14+
error_threshold = [0.01, 0.02]
15+
error_weights = [1.0, 1.0, 1.0, 1.0]
16+
max_cfl = 0.25
17+
18+
[model.reference_values]
19+
rho = 1.0
20+
Ma = 2.5
21+
vel_angle = 5.0
22+
p = 1.0
23+
24+
[initial_condition]
25+
type = "uniform"
26+
value = "reference"
27+
28+
[[geometry]]
29+
name = "object"
30+
shape = "diamond"
31+
width = 1.0
32+
height = 0.176
33+
34+
[boundary_conditions.object]
35+
type = "freeslip"
36+
37+
[boundary_conditions.X.neg]
38+
type = "inflow"
39+
fade_in = 0.0
40+
41+
[boundary_conditions.X.pos]
42+
type = "outflow"
43+
44+
[boundary_conditions.Y.neg]
45+
type = "outflow"
46+
47+
[boundary_conditions.Y.pos]
48+
type = "outflow"

0 commit comments

Comments
 (0)