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
2643fbab
Commit
2643fbab
authored
13 years ago
by
Robert Klöfkorn
Browse files
Options
Downloads
Patches
Plain Diff
default model
parent
80c07bc6
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
dune/fem-dg/models/defaultmodel.hh
+275
-0
275 additions, 0 deletions
dune/fem-dg/models/defaultmodel.hh
with
275 additions
and
0 deletions
dune/fem-dg/models/defaultmodel.hh
0 → 100644
+
275
−
0
View file @
2643fbab
#ifndef DUNE_FEM_DG_DEFAULTMODEL_HH
#define DUNE_FEM_DG_DEFAULTMODEL_HH
#include
<dune/common/exceptions.hh>
/**********************************************
* Default model
*********************************************/
template
<
class
Traits
>
class
DefaultModel
{
public:
static
const
int
dimDomain
=
Traits
::
dimDomain
;
static
const
int
dimRange
=
Traits
::
dimRange
;
typedef
typename
Traits
::
DomainType
DomainType
;
typedef
typename
Traits
::
RangeType
RangeType
;
typedef
typename
Traits
::
GradientType
GradientType
;
typedef
typename
Traits
::
FluxRangeType
FluxRangeType
;
typedef
typename
Traits
::
FaceDomainType
FaceDomainType
;
typedef
typename
Traits
::
JacobianRangeType
JacobianRangeType
;
typedef
typename
Traits
::
EntityType
EntityType
;
typedef
typename
Traits
::
IntersectionType
IntersectionType
;
inline
bool
hasFlux
()
const
{
return
false
;
}
inline
bool
hasStiffSource
()
const
{
return
false
;
}
inline
bool
hasNonStiffSource
()
const
{
return
false
;
}
inline
double
nonStiffSource
(
const
EntityType
&
en
,
const
double
time
,
const
DomainType
&
x
,
const
RangeType
&
u
,
const
GradientType
&
du
,
RangeType
&
s
)
const
{
s
=
0
;
return
std
::
numeric_limits
<
double
>
::
max
();
}
inline
double
nonStiffSource
(
const
EntityType
&
en
,
const
double
time
,
const
DomainType
&
x
,
const
RangeType
&
u
,
const
JacobianRangeType
&
jac
,
RangeType
&
s
)
const
{
s
=
0
;
return
std
::
numeric_limits
<
double
>
::
max
();
}
inline
double
nonStiffSource
(
const
EntityType
&
en
,
const
double
time
,
const
DomainType
&
x
,
const
RangeType
&
u
,
RangeType
&
s
)
const
{
s
=
0
;
return
std
::
numeric_limits
<
double
>
::
max
();
}
inline
double
stiffSource
(
const
EntityType
&
en
,
const
double
time
,
const
DomainType
&
x
,
const
RangeType
&
u
,
const
GradientType
&
du
,
RangeType
&
s
)
const
{
return
stiffSource
(
en
,
time
,
x
,
u
,
s
);
}
inline
double
stiffSource
(
const
EntityType
&
en
,
const
double
time
,
const
DomainType
&
x
,
const
RangeType
&
u
,
const
JacobianRangeType
&
jac
,
RangeType
&
s
)
const
{
return
stiffSource
(
en
,
time
,
x
,
u
,
s
);
}
inline
double
stiffSource
(
const
EntityType
&
en
,
const
double
time
,
const
DomainType
&
x
,
const
RangeType
&
u
,
RangeType
&
s
)
const
{
s
=
0
;
return
std
::
numeric_limits
<
double
>
::
max
();
}
/**
* @brief advection term \f$F\f$
*
* @param en entity on which to evaluate the advection term
* @param time current time of TimeProvider
* @param x coordinate local to entity
* @param u \f$U\f$
* @param f \f$f(U)\f$
*/
inline
void
advection
(
const
EntityType
&
en
,
const
double
time
,
const
DomainType
&
x
,
const
RangeType
&
u
,
FluxRangeType
&
f
)
const
{
f
=
0
;
}
/**
* @brief velocity calculation, is called by advection()
*/
inline
void
velocity
(
const
EntityType
&
en
,
const
double
time
,
const
DomainType
&
x
,
DomainType
&
v
)
const
{
v
=
0
;
}
/**
* @brief diffusion term \f$a\f$
*/
inline
void
jacobian
(
const
EntityType
&
en
,
const
double
time
,
const
DomainType
&
x
,
const
RangeType
&
u
,
JacobianRangeType
&
a
)
const
{
a
=
0
;
assert
(
a
.
rows
==
dimRange
*
dimDomain
);
assert
(
a
.
cols
==
dimDomain
);
for
(
int
r
=
0
;
r
<
dimRange
;
r
++
)
for
(
int
d
=
0
;
d
<
dimDomain
;
d
++
)
a
[
dimDomain
*
r
+
d
][
d
]
=
u
[
r
];
}
inline
void
eigenValues
(
const
EntityType
&
en
,
const
double
time
,
const
DomainType
&
x
,
const
RangeType
&
u
,
RangeType
&
maxValue
)
const
{
DUNE_THROW
(
Dune
::
NotImplemented
,
"DefaultModel::eigenValues is not implemented"
);
}
inline
double
penaltyFactor
(
const
double
time
,
const
DomainType
&
xInside
,
const
EntityType
&
inside
,
const
RangeType
&
uLeft
)
const
//const EntityType& outside = inside,
//const RangeType& uRight = uLeft ) const
{
DUNE_THROW
(
Dune
::
NotImplemented
,
"DefaultModel::penaltyValues is not implemented"
);
return
0.0
;
}
/**
* @brief diffusion term \f$A\f$
*/
template
<
class
JacobianType
>
inline
void
diffusion
(
const
EntityType
&
en
,
const
double
time
,
const
DomainType
&
x
,
const
RangeType
&
u
,
const
JacobianType
&
jac
,
FluxRangeType
&
A
)
const
{
}
inline
void
diffusion
(
const
EntityType
&
en
,
const
double
time
,
const
DomainType
&
x
,
const
RangeType
&
u
,
const
GradientType
&
vecJac
,
FluxRangeType
&
A
)
const
{
Dune
::
FieldMatrixConverter
<
GradientType
,
FluxRangeType
>
jac
(
vecJac
);
diffusion
(
en
,
time
,
x
,
u
,
jac
,
A
);
}
inline
double
diffusionTimeStep
(
const
IntersectionType
&
it
,
const
double
enVolume
,
const
double
circumEstimate
,
const
double
time
,
const
FaceDomainType
&
x
,
const
RangeType
&
u
)
const
{
return
0
;
}
public
:
/**
* @brief checks for existence of dirichlet boundary values
*/
inline
bool
hasBoundaryValue
(
const
IntersectionType
&
it
,
const
double
time
,
const
FaceDomainType
&
x
)
const
{
return
true
;
}
/**
* @brief neuman boundary values \f$g_N\f$ for pass2
*/
inline
double
boundaryFlux
(
const
IntersectionType
&
it
,
const
double
time
,
const
FaceDomainType
&
x
,
const
RangeType
&
uLeft
,
const
GradientType
&
vLeft
,
RangeType
&
gLeft
)
const
{
gLeft
=
0.
;
return
0.
;
}
/**
* @brief neuman boundary values \f$g_N\f$ for pass1
*/
inline
double
boundaryFlux
(
const
IntersectionType
&
it
,
const
double
time
,
const
FaceDomainType
&
x
,
const
RangeType
&
uLeft
,
RangeType
&
gLeft
)
const
{
gLeft
=
0.
;
return
0.
;
}
/**
* @brief diffusion boundary flux
*/
inline
double
diffusionBoundaryFlux
(
const
IntersectionType
&
it
,
const
double
time
,
const
FaceDomainType
&
x
,
const
RangeType
&
uLeft
,
const
GradientType
&
gradLeft
,
RangeType
&
gLeft
)
const
{
Dune
::
FieldMatrixConverter
<
GradientType
,
JacobianRangeType
>
jacLeft
(
gradLeft
);
return
diffusionBoundaryFlux
(
it
,
time
,
x
,
uLeft
,
jacLeft
,
gLeft
);
}
/** \brief boundary flux for the diffusion part
*/
template
<
class
JacobianRangeImp
>
inline
double
diffusionBoundaryFlux
(
const
IntersectionType
&
it
,
const
double
time
,
const
FaceDomainType
&
x
,
const
RangeType
&
uLeft
,
const
JacobianRangeImp
&
jacLeft
,
RangeType
&
gLeft
)
const
{
std
::
cerr
<<
"diffusionBoundaryFlux shouldn't be used in this model"
<<
std
::
endl
;
abort
();
}
/**
* @brief dirichlet boundary values
*/
inline
void
boundaryValue
(
const
IntersectionType
&
it
,
const
double
time
,
const
FaceDomainType
&
x
,
const
RangeType
&
uLeft
,
RangeType
&
uRight
)
const
{
}
};
#endif
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