Loading [MathJax]/extensions/tex2jax.js
OGS
Toggle main menu visibility
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
v
w
z
Enumerations
b
c
d
e
f
g
i
l
m
n
o
p
s
t
u
v
Enumerator
a
b
c
d
e
f
g
h
l
m
n
p
r
s
t
v
y
Classes
Class List
Class Index
Class Hierarchy
Files
File List
File Members
All
a
b
c
d
e
f
g
i
k
m
n
o
p
r
s
t
v
w
x
Functions
a
c
d
e
f
g
i
m
o
p
r
s
t
v
w
Variables
Typedefs
Enumerations
Macros
b
c
g
m
n
o
p
r
s
t
ComputeResiduum.cpp
Go to the documentation of this file.
1
10
#include "
ComputeResiduum.h
"
11
12
#include "
MathLib/LinAlg/LinAlg.h
"
13
14
namespace
ProcessLib
15
{
16
GlobalVector
computeResiduum
(
double
const
dt,
GlobalVector
const
& x,
17
GlobalVector
const
& x_prev,
GlobalMatrix
const
& M,
18
GlobalMatrix
const
& K,
GlobalVector
const
& b)
19
{
20
using namespace
MathLib::LinAlg
;
21
GlobalVector
residuum;
22
GlobalVector
x_dot;
23
copy(x, x_dot);
// tmp = x
24
axpy(x_dot, -1., x_prev);
// tmp = x - x_prev
25
scale(x_dot, 1. / dt);
// tmp = (x - x_prev)/dt
26
matMult(M, x_dot, residuum);
// r = M*x_dot
27
matMultAdd(K, x, residuum, residuum);
// r = M*x_dot + K*x
28
axpy(residuum, -1., b);
// r = M*x_dot + K*x - b
29
scale(residuum, -1.);
// r = -r
30
return
residuum;
31
}
16
GlobalVector
computeResiduum
(
double
const
dt,
GlobalVector
const
& x, {
…
}
32
}
// namespace ProcessLib
ComputeResiduum.h
LinAlg.h
MathLib::EigenMatrix
Definition
EigenMatrix.h:29
MathLib::EigenVector
Global vector based on Eigen vector.
Definition
EigenVector.h:25
MathLib::LinAlg
Definition
LinAlg.cpp:24
ProcessLib
Definition
ProjectData.h:51
ProcessLib::computeResiduum
GlobalVector computeResiduum(double const dt, GlobalVector const &x, GlobalVector const &x_prev, GlobalMatrix const &M, GlobalMatrix const &K, GlobalVector const &b)
Definition
ComputeResiduum.cpp:16
ProcessLib
Utils
ComputeResiduum.cpp
Generated by
1.12.0