Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Aland, Sebastian
amdis
Commits
4bedf2e3
Commit
4bedf2e3
authored
Jan 14, 2012
by
Praetorius, Simon
Browse files
missing file BasisFunction.hh added
parent
aff33faa
Changes
1
Hide whitespace changes
Inline
Side-by-side
AMDiS/src/BasisFunction.hh
0 → 100644
View file @
4bedf2e3
//
// Software License for AMDiS
//
// Copyright (c) 2010 Dresden University of Technology
// All rights reserved.
// Authors: Simon Vey, Thomas Witkowski et al.
//
// This file is part of AMDiS
//
// See also license.opensource.txt in the distribution.
#include
"BasisFunction.h"
namespace
AMDiS
{
template
<
typename
T
>
T
BasisFunction
::
evalUh
(
const
DimVec
<
double
>&
lambda
,
const
mtl
::
dense_vector
<
T
>&
uh_loc
)
const
{
T
val
;
nullify
(
val
);
for
(
int
i
=
0
;
i
<
nBasFcts
;
i
++
)
val
+=
uh_loc
[
i
]
*
(
*
(
*
phi
)[
i
])(
lambda
);
return
val
;
}
template
<
typename
T
>
typename
GradientType
<
T
>::
type
&
BasisFunction
::
evalGrdUh
(
const
DimVec
<
double
>&
lambda
,
const
DimVec
<
WorldVector
<
double
>
>&
grd_lambda
,
const
mtl
::
dense_vector
<
T
>&
uh_loc
,
typename
GradientType
<
T
>::
type
&
val
)
const
{
mtl
::
dense_vector
<
double
>
grdTmp1
(
dim
+
1
);
T
null
;
nullify
(
null
);
mtl
::
dense_vector
<
T
>
grdTmp2
(
dim
+
1
,
null
);
for
(
int
i
=
0
;
i
<
nBasFcts
;
i
++
)
{
(
*
(
*
grdPhi
)[
i
])(
lambda
,
grdTmp1
);
for
(
int
j
=
0
;
j
<
dim
+
1
;
j
++
)
grdTmp2
[
j
]
+=
uh_loc
[
i
]
*
grdTmp1
[
j
];
}
nullify
(
val
);
for
(
int
i
=
0
;
i
<
dow
;
i
++
)
{
for
(
int
j
=
0
;
j
<
dim
+
1
;
j
++
)
val
[
i
]
+=
grd_lambda
[
j
][
i
]
*
grdTmp2
[
j
];
}
return
val
;
}
// template<typename T>
// typename D2Type<T>::type& BasisFunction::evalD2Uh(const DimVec<double>& lambda,
// const DimVec<WorldVector<double> >& grd_lambda,
// const mtl::dense_vector<T>& uh_loc,
// D2Type<T>::type& val) const
// {
// DimMat<double> D2_b(dim, DEFAULT_VALUE, 0.0);
// DimMat<T> D2_tmp(dim, DEFAULT_VALUE, 0.0);
//
// for (int i = 0; i < nBasFcts; i++) {
// (*(*d2Phi)[i])(lambda, D2_b);
// for (int k = 0; k < dim + 1; k++)
// for (int l = 0; l < dim + 1; l++)
// D2_tmp[k][l] += uh_loc[i] * D2_b[k][l];
// }
//
// for (int i = 0; i < dow; i++)
// for (int j = 0; j < dow; j++) {
// val[i][j] = 0.0;
// for (int k = 0; k < dim + 1; k++)
// for (int l = 0; l < dim + 1; l++)
// val[i][j] += grd_lambda[k][i] * grd_lambda[l][j] * D2_tmp[k][l];
// }
//
// return val;
// }
}
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment