Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dorie
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
31
Issues
31
List
Boards
Labels
Service Desk
Milestones
Merge Requests
9
Merge Requests
9
Operations
Operations
Incidents
Environments
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
dorie
dorie
Commits
ed1c784f
Commit
ed1c784f
authored
Aug 16, 2018
by
Santiago Ospina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
run loop as in master and deleted the dorie discrete grid function
parent
5fddf899
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
116 deletions
+36
-116
dune/dorie/interface/richards_simulation.cc
dune/dorie/interface/richards_simulation.cc
+34
-36
dune/dorie/interface/richards_simulation.hh
dune/dorie/interface/richards_simulation.hh
+1
-2
dune/dorie/solver/adapters/discrete_grid_function.hh
dune/dorie/solver/adapters/discrete_grid_function.hh
+0
-76
dune/dorie/solver/adapters/water_flux.hh
dune/dorie/solver/adapters/water_flux.hh
+1
-2
No files found.
dune/dorie/interface/richards_simulation.cc
View file @
ed1c784f
...
...
@@ -61,10 +61,10 @@ RichardsSimulation<Traits>::RichardsSimulation (Dune::MPIHelper& _helper, std::s
{
const
int
subsamling_lvl
=
_inifile
.
get
<
int
>
(
"output.subsamplingLevel"
,
0
);
const
auto
subsamling_intervals
=
Dune
::
refinementLevels
(
subsamling_lvl
);
auto
sub_vtk
=
std
::
make_shared
<
Dune
::
SubsamplingVTKWriter
<
GV
>>
(
gv
,
auto
sub
samling
_vtk
=
std
::
make_shared
<
Dune
::
SubsamplingVTKWriter
<
GV
>>
(
gv
,
subsamling_intervals
);
vtkwriter
=
std
::
make_unique
<
Writer
>
(
sub_vtk
,
vtkwriter
=
std
::
make_unique
<
Writer
>
(
sub
samling
_vtk
,
inifile
.
get
<
std
::
string
>
(
"output.fileName"
),
inifile
.
get
<
std
::
string
>
(
"output.outputPath"
),
"./"
);
...
...
@@ -163,26 +163,21 @@ bool RichardsSimulation<Traits>::compute_time_step ()
template
<
typename
Traits
>
void
RichardsSimulation
<
Traits
>::
run
()
{
if
constexpr
(
Traits
::
write_output
)
write_data
(
controller
->
getTime
());
{
write_data
(
controller
->
getTime
());
while
(
controller
->
doStep
())
{
const
auto
previous_time
=
controller
->
getTime
();
const
RF
dt
=
controller
->
getDT
();
if
(
!
compute_time_step
())
{
const
auto
time
=
controller
->
getTime
();
const
auto
dt
=
controller
->
getDT
();
if
(
!
compute_time_step
()){
continue
;
}
const
auto
next_time
=
controller
->
getTime
();
if
constexpr
(
Traits
::
write_output
)
write_data
(
next_time
);
write_data
(
controller
->
getTime
());
if
(
controller
->
doStep
()
&&
adaptivity
->
adapt_grid
(
*
grid
,
gv
,
*
gfs
,
*
param
,
*
fboundary
,
previous_time
,
*
u
))
&&
adaptivity
->
adapt_grid
(
*
grid
,
gv
,
*
gfs
,
*
param
,
*
fboundary
,
time
+
dt
,
// need "old" boundary condition
*
u
))
{
operator_setup
();
// reset operators if grid changes
}
...
...
@@ -202,27 +197,30 @@ void RichardsSimulation<Traits>::update_adapters ()
template
<
typename
Traits
>
void
RichardsSimulation
<
Traits
>::
write_data
(
RF
time
)
{
update_adapters
();
if
(
inifile
.
get
<
bool
>
(
"output.vertexData"
))
{
vtkwriter
->
addVertexData
(
udgf
,
"head"
);
vtkwriter
->
addVertexData
(
fluxdgf
,
"flux"
);
vtkwriter
->
addVertexData
(
condgf
,
"K_0"
);
vtkwriter
->
addVertexData
(
waterdgf
,
"theta_w"
);
vtkwriter
->
addVertexData
(
satdgf
,
"Theta"
);
}
else
{
vtkwriter
->
addCellData
(
udgf
,
"head"
);
vtkwriter
->
addCellData
(
fluxdgf
,
"flux"
);
vtkwriter
->
addCellData
(
condgf
,
"K_0"
);
vtkwriter
->
addCellData
(
waterdgf
,
"theta_w"
);
vtkwriter
->
addCellData
(
satdgf
,
"Theta"
);
}
try
{
vtkwriter
->
write
(
time
,
output_type
);
}
catch
(...){
DUNE_THROW
(
Dune
::
IOError
,
"Cannot write VTK output!"
);
if
constexpr
(
Traits
::
write_output
)
{
update_adapters
();
if
(
inifile
.
get
<
bool
>
(
"output.vertexData"
))
{
vtkwriter
->
addVertexData
(
udgf
,
"head"
);
vtkwriter
->
addVertexData
(
fluxdgf
,
"flux"
);
vtkwriter
->
addVertexData
(
condgf
,
"K_0"
);
vtkwriter
->
addVertexData
(
waterdgf
,
"theta_w"
);
vtkwriter
->
addVertexData
(
satdgf
,
"Theta"
);
}
else
{
vtkwriter
->
addCellData
(
udgf
,
"head"
);
vtkwriter
->
addCellData
(
fluxdgf
,
"flux"
);
vtkwriter
->
addCellData
(
condgf
,
"K_0"
);
vtkwriter
->
addCellData
(
waterdgf
,
"theta_w"
);
vtkwriter
->
addCellData
(
satdgf
,
"Theta"
);
}
try
{
vtkwriter
->
write
(
time
,
output_type
);
}
catch
(...){
DUNE_THROW
(
Dune
::
IOError
,
"Cannot write VTK output!"
);
}
vtkwriter
->
clear
();
}
vtkwriter
->
clear
();
}
}
// namespace Dorie
...
...
dune/dorie/interface/richards_simulation.hh
View file @
ed1c784f
...
...
@@ -28,7 +28,6 @@
#include "../solver/adapters/saturation.hh"
#include "../solver/adapters/water_flux.hh"
#include "../solver/adapters/conductivity.hh"
#include "../solver/adapters/discrete_grid_function.hh"
namespace
Dune
{
...
...
@@ -113,7 +112,7 @@ struct RichardsSimulationTraits : public BaseTraits
// -- Grid Functions of state valriables -- //
/// Matric head
using
GFMatricHead
=
Dune
::
Dorie
::
DiscreteGridFunction
<
GFS
,
U
>
;
using
GFMatricHead
=
Dune
::
PDELab
::
DiscreteGridFunction
<
GFS
,
U
>
;
/// Water Flux
using
GFWaterFlux
=
Dune
::
Dorie
::
WaterFluxAdapter
<
GFS
,
U
,
Parameters
>
;
/// Conductivity
...
...
dune/dorie/solver/adapters/discrete_grid_function.hh
deleted
100644 → 0
View file @
5fddf899
#ifndef DUNE_DORIE_DISCRETE_GRID_FUNCTION_ADAPTER_HH
#define DUNE_DORIE_DISCRETE_GRID_FUNCTION_ADAPTER_HH
#include <vector>
#include <memory>
#include <dune/pdelab/common/function.hh>
#include <dune/pdelab/gridfunctionspace/localfunctionspace.hh>
#include <dune/pdelab/gridfunctionspace/lfsindexcache.hh>
namespace
Dune
{
namespace
Dorie
{
/*---------------------------------------------------------------------*//**
* @brief Convert a grid function space and a coefficient vector into a
* grid function
*
* @tparam GFS GridFunctionSpace type
* @tparam X CoefficientVector type
*/
template
<
typename
GFS
,
typename
X
>
class
DiscreteGridFunction
:
public
Dune
::
PDELab
::
DiscreteGridFunction
<
GFS
,
X
>
{
using
Base
=
Dune
::
PDELab
::
DiscreteGridFunction
<
GFS
,
X
>
;
public:
struct
Traits
:
public
Base
::
Traits
{
using
GridFunctionSpace
=
GFS
;
using
CoefficientVector
=
X
;
};
/*-------------------------------------------------------------------*//**
* @brief Construct a DiscreteGridFunction
*
* @param gfs shared pointer to the GridFunctionsSpace
* @param x shared pointer to the coefficients vector
*/
DiscreteGridFunction
(
std
::
shared_ptr
<
GFS
>
gfs
,
std
::
shared_ptr
<
X
>
x
)
:
Base
(
gfs
,
x
)
,
pgfs
(
gfs
)
,
px
(
x
)
{}
std
::
shared_ptr
<
GFS
>
gridFunctionSpace
()
{
return
pgfs
;
}
std
::
shared_ptr
<
const
GFS
>
gridFunctionSpace
()
const
{
return
pgfs
;
}
std
::
shared_ptr
<
X
>
coefficientVector
()
{
return
px
;
}
std
::
shared_ptr
<
const
X
>
coefficientVector
()
const
{
return
px
;
}
private:
std
::
shared_ptr
<
GFS
>
pgfs
;
std
::
shared_ptr
<
X
>
px
;
};
}
}
#endif
\ No newline at end of file
dune/dorie/solver/adapters/water_flux.hh
View file @
ed1c784f
#ifndef DUNE_DORIE_RICHARDS_WATER_FLUX_ADAPTER_HH
#define DUNE_DORIE_RICHARDS_WATER_FLUX_ADAPTER_HH
#include "discrete_grid_function.hh"
#include "discrete_grid_function_gradient.hh"
namespace
Dune
{
...
...
@@ -22,7 +21,7 @@ namespace Dune{
WaterFluxAdapter
<
GFS
,
X
,
P
>
>
{
using
DiscreteGridFunction
=
Dune
::
Dorie
::
DiscreteGridFunction
<
GFS
,
X
>
;
using
DiscreteGridFunction
=
Dune
::
PDELab
::
DiscreteGridFunction
<
GFS
,
X
>
;
using
DiscreteGridFunctionGradient
=
Dune
::
Dorie
::
DiscreteGridFunctionGradient
<
GFS
,
X
>
;
using
Parameters
=
P
;
...
...
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