Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-gfe
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
Model registry
Operate
Environments
Monitor
Incidents
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
Sander, Oliver
dune-gfe
Commits
28c4cd3c
Commit
28c4cd3c
authored
14 years ago
by
Oliver Sander
Committed by
sander@FU-BERLIN.DE
14 years ago
Browse files
Options
Downloads
Patches
Plain Diff
factor out the computation of dFdw
[[Imported from SVN: r6544]]
parent
a49ed500
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/gfe/localgeodesicfefunction.hh
+14
-13
14 additions, 13 deletions
dune/gfe/localgeodesicfefunction.hh
with
14 additions
and
13 deletions
dune/gfe/localgeodesicfefunction.hh
+
14
−
13
View file @
28c4cd3c
...
...
@@ -139,6 +139,18 @@ private:
return
V
*
UT
;
}
/** \brief Compute derivate of F(w,q) (the derivative of the weighted distance fctl) wrt to w */
Dune
::
FieldMatrix
<
ctype
,
embeddedDim
,
dim
+
1
>
computeDFdw
(
const
TargetSpace
&
q
)
const
{
Dune
::
FieldMatrix
<
ctype
,
embeddedDim
,
dim
+
1
>
dFdw
;
for
(
int
i
=
0
;
i
<
dim
+
1
;
i
++
)
{
Dune
::
FieldVector
<
ctype
,
embeddedDim
>
tmp
=
TargetSpace
::
derivativeOfDistanceSquaredWRTSecondArgument
(
coefficients_
[
i
],
q
);
for
(
int
j
=
0
;
j
<
embeddedDim
;
j
++
)
dFdw
[
j
][
i
]
=
tmp
[
j
];
}
return
dFdw
;
}
/** \brief The coefficient vector */
std
::
vector
<
TargetSpace
>
coefficients_
;
...
...
@@ -198,13 +210,7 @@ evaluateDerivative(const Dune::FieldVector<ctype, dim>& local) const
Dune
::
FieldMatrix
<
ctype
,
dim
+
1
,
dim
>
B
=
referenceToBarycentricLinearPart
();
// compute negative derivative of F(w,q) (the derivative of the weighted distance fctl) wrt to w
Dune
::
FieldMatrix
<
ctype
,
embeddedDim
,
dim
+
1
>
dFdw
;
for
(
int
i
=
0
;
i
<
dim
+
1
;
i
++
)
{
Dune
::
FieldVector
<
ctype
,
embeddedDim
>
tmp
=
TargetSpace
::
derivativeOfDistanceSquaredWRTSecondArgument
(
coefficients_
[
i
],
q
);
for
(
int
j
=
0
;
j
<
embeddedDim
;
j
++
)
dFdw
[
j
][
i
]
=
tmp
[
j
];
}
Dune
::
FieldMatrix
<
ctype
,
embeddedDim
,
dim
+
1
>
dFdw
=
computeDFdw
(
q
);
dFdw
*=
-
1
;
// multiply the two previous matrices: the result is the right hand side
...
...
@@ -285,12 +291,7 @@ evaluateDerivativeOfGradientWRTCoefficient(const Dune::FieldVector<ctype, dim>&
Dune
::
FieldMatrix
<
ctype
,
dim
+
1
,
dim
>
B
=
referenceToBarycentricLinearPart
();
// compute derivate of F(w,q) (the derivative of the weighted distance fctl) wrt to w
Dune
::
FieldMatrix
<
ctype
,
embeddedDim
,
dim
+
1
>
dFdw
;
for
(
int
i
=
0
;
i
<
dim
+
1
;
i
++
)
{
Dune
::
FieldVector
<
ctype
,
embeddedDim
>
tmp
=
TargetSpace
::
derivativeOfDistanceSquaredWRTSecondArgument
(
coefficients_
[
i
],
q
);
for
(
int
j
=
0
;
j
<
embeddedDim
;
j
++
)
dFdw
[
j
][
i
]
=
tmp
[
j
];
}
Dune
::
FieldMatrix
<
ctype
,
embeddedDim
,
dim
+
1
>
dFdw
=
computeDFdw
(
q
);
// the actual system matrix
std
::
vector
<
ctype
>
w
=
barycentricCoordinates
(
local
);
...
...
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