Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dune-fem-dg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Show more breadcrumbs
dune-fem
dune-fem-dg
Commits
f58baa58
Commit
f58baa58
authored
10 years ago
by
Robert Kloefkorn
Browse files
Options
Downloads
Patches
Plain Diff
make legacy code work.
parent
1292c5f5
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/fem-dg/main/main_pol.cc
+35
-16
35 additions, 16 deletions
dune/fem-dg/main/main_pol.cc
with
35 additions
and
16 deletions
dune/fem-dg/main/main_pol.cc
+
35
−
16
View file @
f58baa58
...
...
@@ -45,6 +45,17 @@
// problem dependent
#include
<problemcreator.hh>
#ifndef NEW_STEPPER_SELECTOR_USED
#warning "Old method of stepper selection detected. Please consult dune/fem-dg/test and update your code"
#if defined EULER
#include
<dune/fem-dg/stepper/advectionstepper.hh>
#define Stepper AdvectionStepper
#else
#include
<dune/fem-dg/stepper/advectiondiffusionstepper.hh>
#define Stepper AdvectionDiffusionStepper
#endif
#endif
#include
<dune/fem/misc/femeoc.hh>
#include
<dune/fem/misc/flops.hh>
...
...
@@ -107,35 +118,43 @@ namespace LOOPSPACE {
}
typedef
Dune
::
GridSelector
::
GridType
GridType
;
// old method
#ifndef NEW_STEPPER_SELECTOR_USED
typedef
ProblemGenerator
<
GridType
>
ProblemTraits
;
// return type of initializeGrid is Dune::GridPtr, use release such that memory of GridPtr is released
std
::
unique_ptr
<
GridType
>
gridptr
(
ProblemTraits
::
initializeGrid
().
release
()
);
// Note to me: problem description is for FemEOC
const
std
::
string
advFlux
=
ProblemTraits
::
advectionFluxName
();
const
std
::
string
diffFlux
=
ProblemTraits
::
diffusionFluxName
();
//
g
et
grid reference
GridType
&
grid
=
*
gridptr
;
//
r
et
urn type of initializeGrid is Dune::GridPtr, use release such that memory of GridPtr is released
std
::
unique_ptr
<
GridType
>
grid
ptr
(
ProblemTraits
::
initializeGrid
(
advFlux
+
diffFlux
).
release
()
)
;
#ifndef NAVIER_STOKES_STEPPER_HH
// the new way
typedef
ProblemTraits
::
Stepper
<
ProblemTraits
>
::
Type
StepperType
;
#else
#warning "Using deprecated method of Stepper selection. Please consult the fem-dg examples for update"
// the old legacy way
typedef
Stepper
<
GridType
,
ProblemTraits
,
POLORDER
>
StepperType
;
#endif
StepperType
stepper
(
*
gridptr
);
// new method, the ProblemGenerator simply creates the stepper
compute
(
stepper
);
#else
typedef
ProblemCreator
<
GridType
>
ProblemTraits
;
//
c
re
ate step
pe
r
o
n heap, otherwise problems with stack size
std
::
unique_ptr
<
StepperType
>
stepper
(
new
StepperType
(
grid
)
);
// re
turn ty
pe o
f initializeGrid is Dune::GridPtr, use release such that memory of GridPtr is released
std
::
unique_ptr
<
GridType
>
gridptr
(
ProblemTraits
::
initializeGrid
().
release
(
)
);
assert
(
stepper
);
typedef
ProblemTraits
::
StepperType
StepperType
;
std
::
unique_ptr
<
StepperType
>
stepper
(
new
StepperType
(
*
gridptr
)
);
// new method, the ProblemGenerator simply creates the stepper
compute
(
*
stepper
);
#endif
// stop flop counters for all threads
if
(
countFlops
)
// stop flop counters for all threads
if
(
countFlops
)
{
FlopStopObject
stopObj
;
Dune
::
Fem
::
ThreadHandle
::
run
(
stopObj
);
// print results
// print results
Dune
::
Fem
::
FlopCounter
::
print
(
std
::
cout
);
}
}
...
...
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