Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-codegen
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Christian Heinigk
dune-codegen
Commits
63476c3e
Commit
63476c3e
authored
6 years ago
by
Dominic Kempf
Browse files
Options
Downloads
Patches
Plain Diff
Allow grid analysis with custom analyzing executable
parent
9b2b116b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cmake/modules/DuneCodegenMacros.cmake
+30
-3
30 additions, 3 deletions
cmake/modules/DuneCodegenMacros.cmake
dune/codegen/sumfact/analyzegrid.hh
+3
-0
3 additions, 0 deletions
dune/codegen/sumfact/analyzegrid.hh
with
33 additions
and
3 deletions
cmake/modules/DuneCodegenMacros.cmake
+
30
−
3
View file @
63476c3e
...
...
@@ -45,6 +45,27 @@
# Set this option, if you do not want the target to be automatically
# built. This option is forwarded to the builtin command add_executable.
#
# .. cmake_param:: ANALYZE_GRID
# :option:
#
# Set this option to enable code generation time grid analysis.
# This is useful to reduce the variety of sum factorization kernels
# in unstructured grids. Note that the grid analysis tool needs to
# be able to construct your grid from the given inifile. If you have
# a custom grid construction method, you can use ANALYZE_GRID_COMMAND
# instead.
#
# .. cmake_param:: ANALYZE_GRID_COMMAND
# :multi:
# :argname command:
#
# Use this to pass a custom grid analysis command. This is necessary
# if you use a custom grid generation methdod. The inifile and the
# outputfile will be appended to this command. You can use the analysis code in
# dune/codegen/sumfact/analyzegrid.hh to write your own tool.
# Specifying this option will automatically set ANALYZE_GRID.
#
#
# Add an executable to the project that gets automatically
# generated at configure time with the form compiler uf2pdelab.
# Regeneration is triggered correctly if the UFL file or the
...
...
@@ -73,7 +94,7 @@ file(GLOB_RECURSE UFL2PDELAB_SOURCES ${UFL2PDELAB_GLOB_PATTERN})
function
(
add_generated_executable
)
set
(
OPTIONS EXCLUDE_FROM_ALL ANALYZE_GRID
)
set
(
SINGLE TARGET SOURCE UFLFILE INIFILE
)
set
(
MULTI FORM_COMPILER_ARGS DEPENDS
)
set
(
MULTI FORM_COMPILER_ARGS DEPENDS
ANALYZE_GRID_COMMAND
)
include
(
CMakeParseArguments
)
cmake_parse_arguments
(
GEN
"
${
OPTIONS
}
"
"
${
SINGLE
}
"
"
${
MULTI
}
"
${
ARGN
}
)
...
...
@@ -114,6 +135,12 @@ function(add_generated_executable)
else
()
set
(
GEN_EXCLUDE_FROM_ALL
""
)
endif
()
if
(
GEN_ANALYZE_GRID_COMMAND
)
set
(
GEN_ANALYZE_GRID 1
)
else
()
dune_module_path
(
MODULE dune-codegen RESULT codegenbin BUILD_DIR
)
set
(
GEN_ANALYZE_GRID_COMMAND
${
codegenbin
}
/bin/analyzegrid/analyze_grid
)
endif
()
# Process analyze grid option
set
(
ANALYZE_GRID_FILE
)
...
...
@@ -122,10 +149,10 @@ function(add_generated_executable)
if
(
NOT consistent-edge-orientation_FOUND
)
message
(
FATAL_ERROR
"Asked for grid analysis, but the module consistent-edge-orientation was not found!"
)
endif
()
set
(
ANALYZE_GRID_FILE
"
${
GEN_INIFILE
}
.csv"
)
set
(
ANALYZE_GRID_FILE
"
${
CMAKE_CURRENT_BINARY_DIR
}
/
${
GEN_TARGET
}
.csv"
)
set
(
ANALYZE_GRID_OPTION
"--grid-info=
${
ANALYZE_GRID_FILE
}
"
)
add_custom_command
(
OUTPUT
${
ANALYZE_GRID_FILE
}
COMMAND
${
CMAKE_BINARY_DIR
}
/bin/analyzegrid/analyze_grid
${
GEN_INIFILE
}
${
ANALYZE_GRID_FILE
}
COMMAND
${
GEN_ANALYZE_GRID_COMMAND
}
${
GEN_INIFILE
}
${
ANALYZE_GRID_FILE
}
COMMENT
"Analyzing the grid for target
${
GEN_TARGET
}
..."
)
endif
()
...
...
This diff is collapsed.
Click to expand it.
dune/codegen/sumfact/analyzegrid.hh
+
3
−
0
View file @
63476c3e
#ifndef DUNE_CODEGEN_SUMFACT_ANALYZEGRID_HH
#define DUNE_CODEGEN_SUMFACT_ANALYZEGRID_HH
#include
<fstream>
#include
<set>
#include
<string>
#include
<dune/pdelab/common/intersectiontype.hh>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment