Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-tectonic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
podlesny
dune-tectonic
Commits
bb9e0e31
Commit
bb9e0e31
authored
13 years ago
by
Elias Pipping
Committed by
Elias Pipping
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
foo& bar -> foo &bar
parent
2f30c080
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dune/tectonic/myblockproblem.hh
+8
-8
8 additions, 8 deletions
dune/tectonic/myblockproblem.hh
dune/tectonic/nicefunction.hh
+6
-6
6 additions, 6 deletions
dune/tectonic/nicefunction.hh
dune/vtkgridfunction.hh
+7
-7
7 additions, 7 deletions
dune/vtkgridfunction.hh
with
21 additions
and
21 deletions
dune/tectonic/myblockproblem.hh
+
8
−
8
View file @
bb9e0e31
...
...
@@ -28,7 +28,7 @@ template <class MyConvexProblemTypeTEMPLATE> class MyBlockProblem {
/** \brief Solves one local system using a modified gradient method */
class
IterateObject
;
MyBlockProblem
(
MyConvexProblemType
&
problem
)
:
problem
(
problem
)
{
MyBlockProblem
(
MyConvexProblemType
&
problem
)
:
problem
(
problem
)
{
bisection
=
Bisection
(
0.0
,
1.0
,
1e-12
,
true
,
0
);
};
...
...
@@ -37,7 +37,7 @@ template <class MyConvexProblemTypeTEMPLATE> class MyBlockProblem {
private
:
// problem data
MyConvexProblemType
&
problem
;
MyConvexProblemType
&
problem
;
// commonly used minimization stuff
Bisection
bisection
;
...
...
@@ -53,18 +53,18 @@ class MyBlockProblem<MyConvexProblemTypeTEMPLATE>::IterateObject {
* \param bisection The class used to do a scalar bisection
* \param problem The problem including quadratic part and nonlinear part
*/
IterateObject
(
Bisection
const
&
bisection
,
MyConvexProblemType
&
problem
)
IterateObject
(
Bisection
const
&
bisection
,
MyConvexProblemType
&
problem
)
:
problem
(
problem
),
bisection
(
bisection
)
{}
public
:
/** \brief Set the current iterate */
void
setIterate
(
VectorType
&
u
)
{
void
setIterate
(
VectorType
&
u
)
{
this
->
u
=
u
;
return
;
}
/** \brief Update the i-th block of the current iterate */
void
updateIterate
(
LocalVectorType
const
&
ui
,
int
i
)
{
void
updateIterate
(
LocalVectorType
const
&
ui
,
int
i
)
{
u
[
i
]
=
ui
;
return
;
}
...
...
@@ -75,14 +75,14 @@ class MyBlockProblem<MyConvexProblemTypeTEMPLATE>::IterateObject {
* \param ignore Set of degrees of freedom to leave untouched
*/
void
solveLocalProblem
(
LocalVectorType
&
ui
,
int
m
,
LocalVectorType
&
ui
,
int
m
,
const
typename
Dune
::
BitSetVector
<
block_size
>::
const_reference
ignore
)
{
{
// TODO: Does it make any sense to ignore single spatial dimensions here?
if
(
ignore
.
test
(
0
))
return
;
LocalMatrixType
const
*
localA
=
NULL
;
LocalMatrixType
const
*
localA
=
NULL
;
LocalVectorType
localb
(
problem
.
f
[
m
]);
typename
MatrixType
::
row_type
::
ConstIterator
it
;
...
...
@@ -108,7 +108,7 @@ class MyBlockProblem<MyConvexProblemTypeTEMPLATE>::IterateObject {
private
:
// problem data
MyConvexProblemType
&
problem
;
MyConvexProblemType
&
problem
;
// commonly used minimization stuff
Bisection
bisection
;
...
...
This diff is collapsed.
Click to expand it.
dune/tectonic/nicefunction.hh
+
6
−
6
View file @
bb9e0e31
...
...
@@ -22,7 +22,7 @@ class LinearFunction : public NiceFunction {
LinearFunction
(
double
a
)
:
coefficient
(
a
)
{}
void
virtual
evaluate
(
double
const
&
x
,
double
&
y
)
const
{
void
virtual
evaluate
(
double
const
&
x
,
double
&
y
)
const
{
y
=
coefficient
*
x
;
}
...
...
@@ -36,7 +36,7 @@ class LinearFunction : public NiceFunction {
template
<
int
slope
>
class
SampleFunction
:
public
NiceFunction
{
public:
void
virtual
evaluate
(
double
const
&
x
,
double
&
y
)
const
{
void
virtual
evaluate
(
double
const
&
x
,
double
&
y
)
const
{
y
=
(
x
<
1
)
?
x
:
(
slope
*
(
x
-
1
)
+
1
);
}
...
...
@@ -51,7 +51,7 @@ template <int slope> class SampleFunction : public NiceFunction {
class
SteepFunction
:
public
NiceFunction
{
public:
void
virtual
evaluate
(
double
const
&
x
,
double
&
y
)
const
{
y
=
100
*
x
;
}
void
virtual
evaluate
(
double
const
&
x
,
double
&
y
)
const
{
y
=
100
*
x
;
}
double
virtual
leftDifferential
(
double
s
)
const
{
return
100
;
}
...
...
@@ -60,7 +60,7 @@ class SteepFunction : public NiceFunction {
class
TrivialFunction
:
public
NiceFunction
{
public:
void
virtual
evaluate
(
double
const
&
x
,
double
&
y
)
const
{
y
=
0
;
}
void
virtual
evaluate
(
double
const
&
x
,
double
&
y
)
const
{
y
=
0
;
}
double
virtual
leftDifferential
(
double
)
const
{
return
0
;
}
...
...
@@ -70,7 +70,7 @@ class TrivialFunction : public NiceFunction {
// slope in [n-1,n] is n
class
HorribleFunction
:
public
NiceFunction
{
public:
void
virtual
evaluate
(
double
const
&
x
,
double
&
y
)
const
{
void
virtual
evaluate
(
double
const
&
x
,
double
&
y
)
const
{
double
const
fl
=
floor
(
x
);
double
const
sum
=
fl
*
(
fl
+
1
)
/
2
;
y
=
sum
+
(
fl
+
1
)
*
(
x
-
fl
);
...
...
@@ -96,7 +96,7 @@ class HorribleFunction : public NiceFunction {
// slope in [n-1,n] is log(n+1)
class
HorribleFunctionLogarithmic
:
public
NiceFunction
{
public:
void
virtual
evaluate
(
double
const
&
x
,
double
&
y
)
const
{
void
virtual
evaluate
(
double
const
&
x
,
double
&
y
)
const
{
y
=
0
;
size_t
const
fl
=
floor
(
x
);
for
(
size_t
i
=
1
;
i
<=
fl
;)
...
...
This diff is collapsed.
Click to expand it.
dune/vtkgridfunction.hh
+
7
−
7
View file @
bb9e0e31
...
...
@@ -30,8 +30,8 @@ class VTKBasisGridFunction : public VTKFunction<typename Basis::GridView> {
* \param v A corresponding vector of coefficients.
* \param s A name of the function.
*/
VTKBasisGridFunction
(
const
Basis
&
basis
,
const
CoefficientType
&
v
,
const
std
::
string
&
s
)
VTKBasisGridFunction
(
const
Basis
&
basis
,
const
CoefficientType
&
v
,
const
std
::
string
&
s
)
:
basis_
(
basis
),
coeffs_
(
v
),
s_
(
s
)
{
if
(
v
.
size
()
!=
basis_
.
size
())
DUNE_THROW
(
...
...
@@ -48,10 +48,10 @@ class VTKBasisGridFunction : public VTKFunction<typename Basis::GridView> {
* \param e The element the local coordinates are taken from.
* \param xi The local coordinates where to evaluate the function.
*/
virtual
double
evaluate
(
int
comp
,
const
Entity
&
e
,
const
Dune
::
FieldVector
<
ctype
,
dim
>
&
xi
)
const
{
virtual
double
evaluate
(
int
comp
,
const
Entity
&
e
,
const
Dune
::
FieldVector
<
ctype
,
dim
>
&
xi
)
const
{
// evaluate the local shapefunctions
const
typename
Basis
::
LocalFiniteElement
&
localFE
=
const
typename
Basis
::
LocalFiniteElement
&
localFE
=
basis_
.
getLocalFiniteElement
(
e
);
std
::
vector
<
RangeType
>
values
(
localFE
.
localBasis
().
size
());
localFE
.
localBasis
().
evaluateFunction
(
xi
,
values
);
...
...
@@ -71,8 +71,8 @@ class VTKBasisGridFunction : public VTKFunction<typename Basis::GridView> {
virtual
~
VTKBasisGridFunction
()
{}
private
:
const
Basis
&
basis_
;
const
CoefficientType
&
coeffs_
;
const
Basis
&
basis_
;
const
CoefficientType
&
coeffs_
;
std
::
string
s_
;
};
}
...
...
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