Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
dorie
dorie
Commits
37153005
Commit
37153005
authored
Sep 21, 2018
by
Santiago Ospina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow richards simulation to be instantiated for raviart thomas elements that exist in dune
parent
90a083bc
Changes
13
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
179 additions
and
67 deletions
+179
-67
dune/dorie/dorie.cc
dune/dorie/dorie.cc
+55
-55
dune/dorie/impl/sim_ug_2_2.cc
dune/dorie/impl/sim_ug_2_2.cc
+2
-2
dune/dorie/impl/sim_ug_2_3.cc
dune/dorie/impl/sim_ug_2_3.cc
+1
-1
dune/dorie/impl/sim_ug_3_1.cc
dune/dorie/impl/sim_ug_3_1.cc
+1
-1
dune/dorie/impl/sim_ug_3_2.cc
dune/dorie/impl/sim_ug_3_2.cc
+1
-1
dune/dorie/impl/sim_yasp_2_1.cc
dune/dorie/impl/sim_yasp_2_1.cc
+1
-1
dune/dorie/impl/sim_yasp_2_2.cc
dune/dorie/impl/sim_yasp_2_2.cc
+1
-1
dune/dorie/impl/sim_yasp_2_3.cc
dune/dorie/impl/sim_yasp_2_3.cc
+1
-1
dune/dorie/impl/sim_yasp_3_1.cc
dune/dorie/impl/sim_yasp_3_1.cc
+1
-1
dune/dorie/impl/sim_yasp_3_2.cc
dune/dorie/impl/sim_yasp_3_2.cc
+1
-1
python/dorie/dorie/cli/cmds.py
python/dorie/dorie/cli/cmds.py
+2
-2
python/parfield/wrapper/pf_from_file.py
python/parfield/wrapper/pf_from_file.py
+90
-0
python/testtools/wrapper/test_dorie.py
python/testtools/wrapper/test_dorie.py
+22
-0
No files found.
dune/dorie/dorie.cc
View file @
37153005
...
...
@@ -142,12 +142,12 @@ int main(int argc, char** argv)
sim
.
run
();
break
;
}
//
case 2:{
//
Sim<Simplex<2,2>> sim(helper,grid,inifile);
//
sim.set_policy(adapt_policy);
//
sim.run();
//
break;
//
}
case
2
:{
Sim
<
Simplex
<
2
,
2
>>
sim
(
helper
,
grid
,
inifile
);
sim
.
set_policy
(
adapt_policy
);
sim
.
run
();
break
;
}
// case 3:{
// Sim<Simplex<2,3>> sim(helper,grid,inifile);
// sim.set_policy(adapt_policy);
...
...
@@ -168,18 +168,18 @@ int main(int argc, char** argv)
sim
.
run
();
break
;
}
//
case 2:{
//
Sim<CubeAdaptive<2,2>> sim(helper,grid,inifile);
//
sim.set_policy(adapt_policy);
//
sim.run();
//
break;
//
}
//
case 3:{
//
Sim<CubeAdaptive<2,3>> sim(helper,grid,inifile);
//
sim.set_policy(adapt_policy);
//
sim.run();
//
break;
//
}
case
2
:{
Sim
<
CubeAdaptive
<
2
,
2
>>
sim
(
helper
,
grid
,
inifile
);
sim
.
set_policy
(
adapt_policy
);
sim
.
run
();
break
;
}
case
3
:{
Sim
<
CubeAdaptive
<
2
,
3
>>
sim
(
helper
,
grid
,
inifile
);
sim
.
set_policy
(
adapt_policy
);
sim
.
run
();
break
;
}
default:
DUNE_THROW
(
Dune
::
NotImplemented
,
"Finite Element Order (grid.FEorder) not supported!"
);
}
...
...
@@ -187,21 +187,21 @@ int main(int argc, char** argv)
else
{
// no adaptivity
auto
grid
=
Dune
::
Dorie
::
build_grid_cube
<
Dune
::
YaspGrid
<
2
>>
(
inifile
,
helper
);
switch
(
FEorder
){
//
case 1:{
//
Sim<Cube<2,1>> sim(helper,grid,inifile);
//
sim.run();
//
break;
//
}
//
case 2:{
//
Sim<Cube<2,2>> sim(helper,grid,inifile);
//
sim.run();
//
break;
//
}
//
case 3:{
//
Sim<Cube<2,3>> sim(helper,grid,inifile);
//
sim.run();
//
break;
//
}
case
1
:{
Sim
<
Cube
<
2
,
1
>>
sim
(
helper
,
grid
,
inifile
);
sim
.
run
();
break
;
}
case
2
:{
Sim
<
Cube
<
2
,
2
>>
sim
(
helper
,
grid
,
inifile
);
sim
.
run
();
break
;
}
case
3
:{
Sim
<
Cube
<
2
,
3
>>
sim
(
helper
,
grid
,
inifile
);
sim
.
run
();
break
;
}
default:
DUNE_THROW
(
Dune
::
NotImplemented
,
"Finite Element Order (grid.FEorder) not supported!"
);
}
...
...
@@ -242,18 +242,18 @@ int main(int argc, char** argv)
if
(
adaptivity
){
auto
grid
=
Dune
::
Dorie
::
build_grid_cube
<
Dune
::
UGGrid
<
3
>>
(
inifile
,
helper
);
switch
(
FEorder
){
//
case 1:{
//
Sim<CubeAdaptive<3,1>> sim(helper,grid,inifile);
//
sim.set_policy(adapt_policy);
//
sim.run();
//
break;
//
}
//
case 2:{
//
Sim<CubeAdaptive<3,2>> sim(helper,grid,inifile);
//
sim.set_policy(adapt_policy);
//
sim.run();
//
break;
//
}
case
1
:{
Sim
<
CubeAdaptive
<
3
,
1
>>
sim
(
helper
,
grid
,
inifile
);
sim
.
set_policy
(
adapt_policy
);
sim
.
run
();
break
;
}
case
2
:{
Sim
<
CubeAdaptive
<
3
,
2
>>
sim
(
helper
,
grid
,
inifile
);
sim
.
set_policy
(
adapt_policy
);
sim
.
run
();
break
;
}
// case 3:{
// Sim<CubeAdaptive<3,3>> sim(helper,grid,inifile);
// sim.set_policy(adapt_policy);
...
...
@@ -267,16 +267,16 @@ int main(int argc, char** argv)
else
{
// no adaptivity
auto
grid
=
Dune
::
Dorie
::
build_grid_cube
<
Dune
::
YaspGrid
<
3
>>
(
inifile
,
helper
);
switch
(
FEorder
){
//
case 1:{
//
Sim<Cube<3,1>> sim(helper,grid,inifile);
//
sim.run();
//
break;
//
}
//
case 2:{
//
Sim<Cube<3,2>> sim(helper,grid,inifile);
//
sim.run();
//
break;
//
}
case
1
:{
Sim
<
Cube
<
3
,
1
>>
sim
(
helper
,
grid
,
inifile
);
sim
.
run
();
break
;
}
case
2
:{
Sim
<
Cube
<
3
,
2
>>
sim
(
helper
,
grid
,
inifile
);
sim
.
run
();
break
;
}
// case 3:{
// Sim<Cube<3,3>> sim(helper,grid,inifile);
// sim.run();
...
...
dune/dorie/impl/sim_ug_2_2.cc
View file @
37153005
...
...
@@ -8,8 +8,8 @@
namespace
Dune
{
namespace
Dorie
{
//
template class RichardsSimulation<RichardsSimulationTraits<BaseTraits<UGGrid<2>,Geo::cube>,2>>;
//
template class RichardsSimulation<RichardsSimulationTraits<BaseTraits<UGGrid<2>,Geo::simplex>,2>>;
template
class
RichardsSimulation
<
RichardsSimulationTraits
<
BaseTraits
<
UGGrid
<
2
>,
Geo
::
cube
>
,
2
>>
;
template
class
RichardsSimulation
<
RichardsSimulationTraits
<
BaseTraits
<
UGGrid
<
2
>,
Geo
::
simplex
>
,
2
>>
;
}
// namespace Dorie
}
// namespace Dune
\ No newline at end of file
dune/dorie/impl/sim_ug_2_3.cc
View file @
37153005
...
...
@@ -8,7 +8,7 @@
namespace
Dune
{
namespace
Dorie
{
//
template class RichardsSimulation<RichardsSimulationTraits<BaseTraits<UGGrid<2>,Geo::cube>,3>>;
template
class
RichardsSimulation
<
RichardsSimulationTraits
<
BaseTraits
<
UGGrid
<
2
>,
Geo
::
cube
>
,
3
>>
;
// template class RichardsSimulation<RichardsSimulationTraits<BaseTraits<UGGrid<2>,Geo::simplex>,3>>;
}
// namespace Dorie
...
...
dune/dorie/impl/sim_ug_3_1.cc
View file @
37153005
...
...
@@ -8,7 +8,7 @@
namespace
Dune
{
namespace
Dorie
{
//
template class RichardsSimulation<RichardsSimulationTraits<BaseTraits<UGGrid<3>,Geo::cube>,1>>;
template
class
RichardsSimulation
<
RichardsSimulationTraits
<
BaseTraits
<
UGGrid
<
3
>,
Geo
::
cube
>
,
1
>>
;
// template class RichardsSimulation<RichardsSimulationTraits<BaseTraits<UGGrid<3>,Geo::simplex>,1>>;
}
// namespace Dorie
...
...
dune/dorie/impl/sim_ug_3_2.cc
View file @
37153005
...
...
@@ -8,7 +8,7 @@
namespace
Dune
{
namespace
Dorie
{
//
template class RichardsSimulation<RichardsSimulationTraits<BaseTraits<UGGrid<3>,Geo::cube>,2>>;
template
class
RichardsSimulation
<
RichardsSimulationTraits
<
BaseTraits
<
UGGrid
<
3
>,
Geo
::
cube
>
,
2
>>
;
// template class RichardsSimulation<RichardsSimulationTraits<BaseTraits<UGGrid<3>,Geo::simplex>,2>>;
}
// namespace Dorie
...
...
dune/dorie/impl/sim_yasp_2_1.cc
View file @
37153005
...
...
@@ -8,7 +8,7 @@
namespace
Dune
{
namespace
Dorie
{
//
template class RichardsSimulation<RichardsSimulationTraits<BaseTraits<YaspGrid<2>,Geo::cube>,1>>;
template
class
RichardsSimulation
<
RichardsSimulationTraits
<
BaseTraits
<
YaspGrid
<
2
>,
Geo
::
cube
>
,
1
>>
;
}
// namespace Dorie
}
// namespace Dune
\ No newline at end of file
dune/dorie/impl/sim_yasp_2_2.cc
View file @
37153005
...
...
@@ -8,7 +8,7 @@
namespace
Dune
{
namespace
Dorie
{
//
template class RichardsSimulation<RichardsSimulationTraits<BaseTraits<YaspGrid<2>,Geo::cube>,2>>;
template
class
RichardsSimulation
<
RichardsSimulationTraits
<
BaseTraits
<
YaspGrid
<
2
>,
Geo
::
cube
>
,
2
>>
;
}
// namespace Dorie
}
// namespace Dune
\ No newline at end of file
dune/dorie/impl/sim_yasp_2_3.cc
View file @
37153005
...
...
@@ -8,7 +8,7 @@
namespace
Dune
{
namespace
Dorie
{
//
template class RichardsSimulation<RichardsSimulationTraits<BaseTraits<YaspGrid<2>,Geo::cube>,3>>;
template
class
RichardsSimulation
<
RichardsSimulationTraits
<
BaseTraits
<
YaspGrid
<
2
>,
Geo
::
cube
>
,
3
>>
;
}
// namespace Dorie
}
// namespace Dune
\ No newline at end of file
dune/dorie/impl/sim_yasp_3_1.cc
View file @
37153005
...
...
@@ -8,7 +8,7 @@
namespace
Dune
{
namespace
Dorie
{
//
template class RichardsSimulation<RichardsSimulationTraits<BaseTraits<YaspGrid<3>,Geo::cube>,1>>;
template
class
RichardsSimulation
<
RichardsSimulationTraits
<
BaseTraits
<
YaspGrid
<
3
>,
Geo
::
cube
>
,
1
>>
;
}
// namespace Dorie
}
// namespace Dune
\ No newline at end of file
dune/dorie/impl/sim_yasp_3_2.cc
View file @
37153005
...
...
@@ -8,7 +8,7 @@
namespace
Dune
{
namespace
Dorie
{
//
template class RichardsSimulation<RichardsSimulationTraits<BaseTraits<YaspGrid<3>,Geo::cube>,2>>;
template
class
RichardsSimulation
<
RichardsSimulationTraits
<
BaseTraits
<
YaspGrid
<
3
>,
Geo
::
cube
>
,
2
>>
;
}
// namespace Dorie
}
// namespace Dune
\ No newline at end of file
python/dorie/dorie/cli/cmds.py
View file @
37153005
...
...
@@ -9,8 +9,8 @@ except NameError:
pass
# paths set by cmake
DORIEDIR
=
"/
home/saospina
/Codes/D
UN
E_INSTALL/Debug/dorie"
MPIEXEC
=
"/usr/bin/mpiexec"
DORIEDIR
=
"/
Users/soilros
/Codes/D
ORI
E_INSTALL/Debug/dorie"
MPIEXEC
=
"/usr/
local/
bin/mpiexec"
MPIEXEC_NUMPROC_FLAG
=
"-n"
MPIEXEC_PREFLAG
=
""
MPIEXEC_POSTFLAGS
=
""
...
...
python/parfield/wrapper/pf_from_file.py
0 → 100644
View file @
37153005
#!/usr/bin/env python3
from
__future__
import
absolute_import
import
os
import
sys
import
argparse
import
warnings
import
subprocess
import
multiprocessing
from
dorie.parfield
import
configparser
,
pfgerror
from
dorie.parfield.converter
import
ImageConverter
,
CSVConverter
,
H5Converter
,
FFTH5Converter
"""
Script invoking the image to h5 converter on a file given via command line.
"""
# paths set by CMake
DORIEDIR
=
"/Users/soilros/Codes/DORIE_INSTALL/Debug/dorie"
MPIEXEC
=
"/usr/local/bin/mpiexec"
MPIEXEC_NUMPROC_FLAG
=
"-n"
MPIEXEC_PREFLAG
=
""
MPIEXEC_POSTFLAGS
=
""
#
RFG_EXEC
=
os
.
path
.
join
(
DORIEDIR
,
"dune/dorie-rfg/dorie-rfg"
)
def
MPIRUN
(
nproc
,
exe
,
*
args
,
**
kwargs
):
mpi_flags
=
kwargs
.
get
(
"mpi_flags"
)
or
[]
return
[
k
for
k
in
[
MPIEXEC
,
MPIEXEC_NUMPROC_FLAG
,
str
(
nproc
)]
\
+
mpi_flags
+
[
MPIEXEC_PREFLAG
,
str
(
exe
),
MPIEXEC_POSTFLAGS
]
+
list
(
args
)
if
k
]
if
__name__
==
"__main__"
:
try
:
# catch all exceptions we we can output an error message
with
warnings
.
catch_warnings
(
record
=
True
)
as
warn
:
# catch all warnings so we can count them
# PARSE COMMAND LINE
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
'param'
,
help
=
'The configuration file holding all parameterization information'
)
parser
.
add_argument
(
'-p'
,
'--parallel'
,
metavar
=
'N'
,
nargs
=
'?'
,
default
=
1
,
const
=
multiprocessing
.
cpu_count
(),
type
=
int
,
required
=
False
,
help
=
"Run in parallel on N processes. If N is not specified, run on all available CPU threads."
)
parser
.
add_argument
(
'-m'
,
'--mpi-flags'
,
action
=
"append"
,
required
=
False
,
help
=
"Additional flags that are passed to mpirun when run in parallel. "
"May be specified multiple times."
)
parser
.
add_argument
(
'--debug'
,
help
=
'Display warnings'
,
action
=
'store_true'
,
required
=
False
)
args
=
vars
(
parser
.
parse_args
())
cp
=
configparser
.
cp
(
args
[
"param"
])
params
=
{}
for
par
in
(
"generator"
,
"inputFile"
,
"outputFile"
):
try
:
params
[
par
]
=
cp
[
"general"
][
par
]
except
KeyError
:
raise
RuntimeError
(
"Missing option general.generator in parameter file {}"
.
format
(
args
[
"param"
]))
# CALL CONVERTER
if
params
[
"generator"
]
==
"image"
:
ImageConverter
(
args
[
"param"
])
elif
params
[
"generator"
]
==
"csv"
:
CSVConverter
(
args
[
"param"
])
elif
params
[
"generator"
]
==
"fft"
:
try
:
if
args
[
"parallel"
]
==
1
:
subprocess
.
check_call
([
RFG_EXEC
,
args
[
"param"
]])
else
:
subprocess
.
check_call
(
MPIRUN
(
args
[
"parallel"
],
RFG_EXEC
,
args
[
"param"
],
mpi_flags
=
args
[
"mpi_flags"
]))
except
subprocess
.
CalledProcessError
:
print
(
"FFT Field generator failed"
)
sys
.
exit
(
1
)
out_path
=
cp
.
get
(
"generator.fft"
,
"outputPath"
)
FFTH5Converter
(
args
[
"param"
],
out_path
+
"/yfield.stoch.h5"
)
elif
params
[
"generator"
]
==
"hdf5"
:
H5Converter
(
args
[
"param"
])
else
:
raise
RuntimeError
(
"Unrecognized generator {}"
.
format
(
gen
))
# HANDLE WARNINGS
if
not
"debug"
in
args
:
debug
=
False
else
:
debug
=
args
[
"debug"
]
if
debug
:
for
w
in
warn
:
print
(
" {0}: {1}"
.
format
(
w
.
category
.
__name__
,
w
.
message
))
print
(
"Parameter field generator exited successfully with ({0}) warning(s) and ({1}) error(s)"
.
format
(
len
(
warn
),
0
))
except
Exception
as
e
:
print
(
"Parameter field generator failed with ({0}) warning(s) and ({1}) error(s)"
.
format
(
len
(
warn
),
1
))
raise
python/testtools/wrapper/test_dorie.py
0 → 100644
View file @
37153005
#!/usr/bin/env python3
from
__future__
import
absolute_import
import
sys
import
os
from
dune.testtools.wrapper.argumentparser
import
get_args
from
dune.testtools.parser
import
parse_ini_file
from
dorie.testtools.wrapper
import
test_dorie
# paths set by cmake
DORIEDIR
=
"/Users/soilros/Codes/DORIE_INSTALL/Debug/dorie"
#
DORIE_WRAPPER
=
os
.
path
.
join
(
DORIEDIR
,
"bin/dorie"
)
if
__name__
==
"__main__"
:
args
=
get_args
()
iniargument
=
args
[
"ini"
]
iniinfo
=
parse_ini_file
(
args
[
"ini"
])
sys
.
exit
(
test_dorie
.
test_dorie
(
iniinfo
,
iniargument
,
DORIE_WRAPPER
))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment