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
c5c6bde7
Commit
c5c6bde7
authored
11 years ago
by
Robert Kloefkorn
Browse files
Options
Downloads
Patches
Plain Diff
added missing file.
parent
ea812ca9
No related branches found
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/test/advdiff/problems/sin.hh
+145
-0
145 additions, 0 deletions
dune/fem-dg/test/advdiff/problems/sin.hh
with
145 additions
and
0 deletions
dune/fem-dg/test/advdiff/problems/sin.hh
0 → 100644
+
145
−
0
View file @
c5c6bde7
#ifndef DUNE_PROBLEM_SIN_HH
#define DUNE_PROBLEM_SIN_HH
// dune-fem includes
#include
<dune/fem/io/parameter.hh>
#include
<dune/fem/space/common/functionspace.hh>
// local includes
#include
<dune/fem-dg/models/defaultprobleminterfaces.hh>
namespace
Dune
{
template
<
class
GridType
>
class
U0Sin
:
public
EvolutionProblemInterface
<
Fem
::
FunctionSpace
<
double
,
double
,
GridType
::
dimension
,
DIMRANGE
>
,
false
>
{
public:
typedef
EvolutionProblemInterface
<
Fem
::
FunctionSpace
<
double
,
double
,
GridType
::
dimension
,
DIMRANGE
>
,
false
>
BaseType
;
enum
{
dimDomain
=
BaseType
::
dimDomain
};
typedef
typename
BaseType
::
DomainType
DomainType
;
typedef
typename
BaseType
::
RangeType
RangeType
;
typedef
typename
BaseType
::
JacobianRangeType
JacobianRangeType
;
typedef
Fem
::
Parameter
ParameterType
;
/**
* @brief define problem parameters
*/
U0Sin
()
:
BaseType
()
,
velocity_
(
1
),
startTime_
(
ParameterType
::
getValue
<
double
>
(
"femhowto.startTime"
,
0.0
)
),
epsilon_
(
ParameterType
::
getValue
<
double
>
(
"femhowto.epsilon"
,
0.1
)
),
rhsFactor_
(
epsilon_
*
2.0
*
std
::
pow
(
2.0
,
(
double
)
dimDomain
)
*
M_PI
*
M_PI
),
myName_
(
"U0Sin"
)
{
std
::
cout
<<
"Problem: "
<<
myName_
<<
", epsilon "
<<
epsilon_
<<
"
\n
"
;
}
//! this problem has no source term
bool
hasStiffSource
()
const
{
return
false
;
}
bool
hasNonStiffSource
()
const
{
return
true
;
}
double
stiffSource
(
const
DomainType
&
arg
,
const
double
t
,
const
RangeType
&
u
,
RangeType
&
res
)
const
{
return
0.0
;
}
double
nonStiffSource
(
const
DomainType
&
arg
,
const
double
t
,
const
RangeType
&
u
,
RangeType
&
res
)
const
{
// eval solution
evaluate
(
arg
,
t
,
res
);
// apply factor
res
*=
rhsFactor_
;
return
0.0
;
}
double
diffusion
(
const
RangeType
&
u
,
const
JacobianRangeType
&
gradU
)
const
{
return
epsilon
();
}
//! return start time
double
startTime
()
const
{
return
startTime_
;
}
//! return start time
double
epsilon
()
const
{
return
epsilon_
;
}
/**
* @brief getter for the velocity
*/
void
velocity
(
const
DomainType
&
x
,
DomainType
&
v
)
const
{
v
=
velocity_
;
}
/**
* @brief evaluates \f$ u_0(x) \f$
*/
void
evaluate
(
const
DomainType
&
arg
,
RangeType
&
res
)
const
{
evaluate
(
arg
,
startTime_
,
res
);
}
/**
* @brief evaluate exact solution
*/
void
evaluate
(
const
DomainType
&
arg
,
const
double
t
,
RangeType
&
res
)
const
{
res
=
1.0
;
const
double
pi
=
2.0
*
M_PI
;
for
(
int
i
=
0
;
i
<
DomainType
::
dimension
;
++
i
)
{
res
*=
std
::
sin
(
pi
*
(
arg
[
i
]
-
t
)
);
}
}
/**
* @brief latex output for EocOutput
*/
std
::
string
description
()
const
{
std
::
ostringstream
ofs
;
ofs
<<
"Problem: "
<<
myName_
<<
", Epsilon: "
<<
epsilon_
;
ofs
<<
", End time: "
<<
ParameterType
::
getValue
<
double
>
(
"femhowto.endTime"
);
return
ofs
.
str
();
}
/* \brief finalize the simulation using the calculated numerical
* solution u for this problem
*
* \param[in] variablesToOutput Numerical solution in the suitably chosen variables
* \param[in] eocloop Specific EOC loop
*/
template
<
class
DiscreteFunctionType
>
void
finalizeSimulation
(
DiscreteFunctionType
&
variablesToOutput
,
const
int
eocloop
)
const
{}
protected
:
const
DomainType
velocity_
;
const
double
startTime_
;
const
double
epsilon_
;
const
double
rhsFactor_
;
std
::
string
myName_
;
};
}
#endif
/*DUNE_PROBLEM_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