Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
SummerSchool2021-PAA
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
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Show more breadcrumbs
dumux-pub
SummerSchool2021-PAA
Commits
8d194722
Commit
8d194722
authored
3 years ago
by
Ned Coltman
Browse files
Options
Downloads
Patches
Plain Diff
[install] include installscript with subgrid patch
parent
dc0bbbdc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
installsummerschool.py
+129
-0
129 additions, 0 deletions
installsummerschool.py
with
129 additions
and
0 deletions
installsummerschool.py
0 → 100755
+
129
−
0
View file @
8d194722
#!/usr/bin/env python3
#
# This installs the module SummerSchool2021-PAA and its dependencies.
# The exact revisions used are listed in the table below.
# However, note that this script may also apply further patches.
# If so, all patches are required to be the current folder, or,
# in the one that you specified as argument to this script.
#
#
# | module name | branch name | commit sha | commit date |
# |------------------------|-----------------------|--------------------------------------------|-----------------------------|
# | dune-common | origin/releases/2.7 | aa689abba532f40db8f5663fa379ea77211c1953 | 2020-11-10 13:36:21 +0000 |
# | dune-localfunctions | origin/releases/2.7 | 68f1bcf32d9068c258707d241624a08b771b6fde | 2020-11-26 23:45:36 +0000 |
# | dune-alugrid | origin/releases/2.7 | 51bde29a2dfa7cfac4fb73d40ffd42b9c1eb1d3d | 2021-04-22 15:10:17 +0200 |
# | dune-geometry | origin/releases/2.7 | 9d56be3e286bc761dd5d453332a8d793eff00cbe | 2020-11-26 23:26:48 +0000 |
# | dune-istl | origin/releases/2.7 | 761b28aa1deaa786ec55584ace99667545f1b493 | 2020-11-26 23:29:21 +0000 |
# | dune-uggrid | origin/releases/2.7 | 1fe87a92c3f7024dd8fb4f3e7764f7a74b794633 | 2021-06-01 20:53:44 +0000 |
# | dune-grid | origin/releases/2.7 | b7741c6599528bc42017e25f70eb6dd3b5780277 | 2020-11-26 23:30:08 +0000 |
# | dune-subgrid | origin/master | c0f298d09cd66d5647951d6797cdb1524683abae | 2021-04-20 06:54:40 +0000 |
# | dune-foamgrid | origin/master | d49187be4940227c945ced02f8457ccc9d47536a | 2020-01-06 15:36:03 +0000 |
# | dumux-course | origin/master | 0a53b97b21a725f63cc06502dbd03f814af17ee5 | 2021-05-18 21:30:51 +0000 |
# | dumux | origin/master | 4455a367f42bc2ea985045737073c4f3e8c3f76d | 2021-08-03 07:01:17 +0000 |
# | SummerSchool2021-PAA | origin/master | dc0bbbdc81e701c5f96238e247874655713dfab7 | 2021-08-03 09:52:49 +0200 |
import
os
import
sys
import
subprocess
top
=
"
DUMUX
"
os
.
makedirs
(
top
,
exist_ok
=
True
)
def
runFromSubFolder
(
cmd
,
subFolder
):
folder
=
os
.
path
.
join
(
top
,
subFolder
)
try
:
subprocess
.
run
(
cmd
,
cwd
=
folder
,
check
=
True
)
except
Exception
as
e
:
cmdString
=
'
'
.
join
(
cmd
)
sys
.
exit
(
"
Error when calling:
\n
{}
\n
-> folder: {}
\n
-> error: {}
"
.
format
(
cmdString
,
folder
,
str
(
e
))
)
def
installModule
(
subFolder
,
url
,
branch
,
revision
):
targetFolder
=
url
.
rstrip
(
"
.git
"
).
split
(
"
/
"
)[
-
1
]
if
not
os
.
path
.
exists
(
targetFolder
):
runFromSubFolder
([
'
git
'
,
'
clone
'
,
url
,
targetFolder
],
'
.
'
)
runFromSubFolder
([
'
git
'
,
'
checkout
'
,
branch
],
subFolder
)
runFromSubFolder
([
'
git
'
,
'
reset
'
,
'
--hard
'
,
revision
],
subFolder
)
else
:
print
(
f
'
Skip cloning
{
url
}
since target folder
"
{
targetFolder
}
"
already exists.
'
)
def
applyPatch
(
subFolder
,
patch
):
sfPath
=
os
.
path
.
join
(
top
,
subFolder
)
patchPath
=
os
.
path
.
join
(
sfPath
,
'
tmp.patch
'
)
with
open
(
patchPath
,
'
w
'
)
as
patchFile
:
patchFile
.
write
(
patch
)
runFromSubFolder
([
'
git
'
,
'
apply
'
,
'
tmp.patch
'
],
subFolder
)
os
.
remove
(
patchPath
)
print
(
"
Installing dune-localfunctions
"
)
installModule
(
"
dune-localfunctions
"
,
"
https://gitlab.dune-project.org/core/dune-localfunctions.git
"
,
"
origin/releases/2.7
"
,
"
68f1bcf32d9068c258707d241624a08b771b6fde
"
)
print
(
"
Installing dune-alugrid
"
)
installModule
(
"
dune-alugrid
"
,
"
https://gitlab.dune-project.org/extensions/dune-alugrid.git
"
,
"
origin/releases/2.7
"
,
"
51bde29a2dfa7cfac4fb73d40ffd42b9c1eb1d3d
"
)
print
(
"
Installing SummerSchool2021-PAA
"
)
installModule
(
"
SummerSchool2021-PAA
"
,
"
https://git.iws.uni-stuttgart.de/dumux-pub/summerschool2021-paa.git
"
,
"
origin/master
"
,
"
dc0bbbdc81e701c5f96238e247874655713dfab7
"
)
print
(
"
Installing dune-subgrid
"
)
installModule
(
"
dune-subgrid
"
,
"
https://git.imp.fu-berlin.de/agnumpde/dune-subgrid.git
"
,
"
origin/master
"
,
"
c0f298d09cd66d5647951d6797cdb1524683abae
"
)
print
(
"
Installing dune-foamgrid
"
)
installModule
(
"
dune-foamgrid
"
,
"
https://gitlab.dune-project.org/extensions/dune-foamgrid.git
"
,
"
origin/master
"
,
"
d49187be4940227c945ced02f8457ccc9d47536a
"
)
print
(
"
Installing dune-istl
"
)
installModule
(
"
dune-istl
"
,
"
https://gitlab.dune-project.org/core/dune-istl.git
"
,
"
origin/releases/2.7
"
,
"
761b28aa1deaa786ec55584ace99667545f1b493
"
)
print
(
"
Installing dune-geometry
"
)
installModule
(
"
dune-geometry
"
,
"
https://gitlab.dune-project.org/core/dune-geometry.git
"
,
"
origin/releases/2.7
"
,
"
9d56be3e286bc761dd5d453332a8d793eff00cbe
"
)
print
(
"
Installing dumux-course
"
)
installModule
(
"
dumux-course
"
,
"
https://git.iws.uni-stuttgart.de/dumux-repositories/dumux-course.git
"
,
"
origin/master
"
,
"
0a53b97b21a725f63cc06502dbd03f814af17ee5
"
)
print
(
"
Installing dumux
"
)
installModule
(
"
dumux
"
,
"
https://git.iws.uni-stuttgart.de/dumux-repositories/dumux.git
"
,
"
origin/master
"
,
"
4455a367f42bc2ea985045737073c4f3e8c3f76d
"
)
print
(
"
Installing dune-uggrid
"
)
installModule
(
"
dune-uggrid
"
,
"
https://gitlab.dune-project.org//staging/dune-uggrid.git
"
,
"
origin/releases/2.7
"
,
"
1fe87a92c3f7024dd8fb4f3e7764f7a74b794633
"
)
print
(
"
Installing dune-grid
"
)
installModule
(
"
dune-grid
"
,
"
https://gitlab.dune-project.org/core/dune-grid.git
"
,
"
origin/releases/2.7
"
,
"
b7741c6599528bc42017e25f70eb6dd3b5780277
"
)
print
(
"
Installing dune-common
"
)
installModule
(
"
dune-common
"
,
"
https://gitlab.dune-project.org/core/dune-common.git
"
,
"
origin/releases/2.7
"
,
"
aa689abba532f40db8f5663fa379ea77211c1953
"
)
print
(
"
Applying patch for dune-subgrid for load balance requirement
"
)
patch
=
"""
diff --git a/dune/subgrid/subgrid.hh b/dune/subgrid/subgrid.hh
index 7405c29..f776495 100644
--- a/dune/subgrid/subgrid.hh
+++ b/dune/subgrid/subgrid.hh
@@ -842,7 +842,7 @@ class SubGrid :
}
-#if 0
+#if 1
/**
\\
brief Distributes this grid over the available nodes in a distributed machine
*
*
\\
param minlevel The coarsest grid level that gets distributed
@@ -851,6 +851,7 @@ class SubGrid :
void loadBalance(int strategy, int minlevel, int depth, int maxlevel, int minelement){
DUNE_THROW(NotImplemented,
\"
SubGrid::loadBalance()
\"
);
}
+ void loadBalance(){}
/**
\\
brief The communication interface
* @param T: array class holding data associated with the entities
"""
applyPatch
(
"
dune-subgrid
"
,
patch
)
print
(
"
Configuring project
"
)
runFromSubFolder
(
[
'
./dune-common/bin/dunecontrol
'
,
'
--opts=SummerSchool2021-PAA/cmake.opts
'
,
'
all
'
],
'
.
'
)
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