POperators_SOT.h 5.82 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/******************************************************************************
 *
 * Extension of AMDiS - Adaptive multidimensional simulations
 *
 * Copyright (C) 2013 Dresden University of Technology. All Rights Reserved.
 * Web: https://fusionforge.zih.tu-dresden.de/projects/amdis
 *
 * Authors: Simon Praetorius et al.
 *
 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 *
 *
 * See also license.opensource.txt in the distribution.
 * 
 ******************************************************************************/


#ifndef EXTENSIONS_P_OPERATORS_SOT_H
#define EXTENSIONS_P_OPERATORS_SOT_H
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57

#include "AMDiS.h"

using namespace std;
using namespace AMDiS;

/// < factor*phase*grad(u) , grad(psi) >
class Phase_SOT : public SecondOrderTerm 
{
public:
/// Constructor.
Phase_SOT(DOFVectorBase<double>* phaseDV, double fac=1.0);

/// Implementation of \ref OperatorTerm::initElement().
void initElement(const ElInfo* elInfo, SubAssembler* subAssembler,
		Quadrature *quad = NULL);

/// Implementation of \ref OperatorTerm::initElement() for multilpe meshes.
void initElement(const ElInfo* largeElInfo, const ElInfo* smallElInfo,
		SubAssembler* subAssembler,
		Quadrature *quad = NULL);

/// Implements SecondOrderTerm::getLALt().
inline void getLALt(const ElInfo *elInfo, std::vector<mtl::dense2D<double> > &LALt) const;    

/// Implenetation of SecondOrderTerm::eval().
inline void eval(int nPoints,
		const mtl::dense_vector<double>&,
		const mtl::dense_vector<WorldVector<double> >& grdUhAtQP,
		const mtl::dense_vector<WorldMatrix<double> >& D2UhAtQP,
		mtl::dense_vector<double>& result,
		double opFactor);

/// Implenetation of SecondOrderTerm::weakEval().
void weakEval(const std::vector<WorldVector<double> > &grdUhAtQP,
		std::vector<WorldVector<double> > &result);

Praetorius, Simon's avatar
Praetorius, Simon committed
58
double f(const int iq) const;
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
void setFactor(const double fac_) { fac=fac_; }

protected:
DOFVectorBase<double> *phaseDV;
mtl::dense_vector<double> phase;
double fac;
};

/* -------------------------------------------------------------- */

/// < factor*phase*A*grad(u) , grad(psi) > ... 'I' kann ueberladen werden
class MatrixPhase_SOT : public SecondOrderTerm
{
public:
/// Constructor
MatrixPhase_SOT(DOFVectorBase<double>* phaseDV, int comp, double fac=1.0);

/// Implementation of \ref OperatorTerm::initElement().
void initElement(const ElInfo* elInfo, 
        SubAssembler* subAssembler,
        Quadrature *quad=NULL);
void initElement(const ElInfo* largeElInfo, const ElInfo* smallElInfo,
        SubAssembler* subAssembler,
        Quadrature *quad=NULL);
inline void lDlt(const DimVec<WorldVector<double> >& Lambda, 
            const WorldVector<double>& vec,
            mtl::dense2D<double>& LALt,
            double factor) const;
void getLALt(const ElInfo *elInfo,
        std::vector<mtl::dense2D<double> > &LALt) const; 

void eval(int nPoints,
        const mtl::dense_vector<double>& uhAtQP,
        const mtl::dense_vector<WorldVector<double> >& grdUhAtQP,
        const mtl::dense_vector<WorldMatrix<double> >& D2UhAtQP,
        mtl::dense_vector<double>& result,
        double opFactor);

void weakEval(const std::vector<WorldVector<double> > &grdUhAtQP,
        std::vector<WorldVector<double> > &result);

inline WorldVector<double> f(const int iq) const;
void setFactor(const double fac_) { fac=fac_; }

protected:
DOFVectorBase<double> *phaseDV;
mtl::dense_vector<double> phase;
int comp;
double fac;
bool symmetric;
};

/* -------------------------------------------------------------- */

/// < factor*()_ij*grad(u) , grad(psi) >
class MatrixIJ_SOT : public SecondOrderTerm
{
public:
/// Constructor
MatrixIJ_SOT(int row, int col, double fac=1.0);

/// Implementation of \ref OperatorTerm::initElement().
void initElement(const ElInfo* elInfo, 
        SubAssembler* subAssembler,
        Quadrature *quad=NULL) {}
void initElement(const ElInfo* largeElInfo, const ElInfo* smallElInfo,
        SubAssembler* subAssembler,
        Quadrature *quad=NULL) {}
void getLALt(const ElInfo *elInfo,
        std::vector<mtl::dense2D<double> > &LALt) const; 
void eval(int nPoints,
        const mtl::dense_vector<double>& uhAtQP,
        const mtl::dense_vector<WorldVector<double> >& grdUhAtQP,
        const mtl::dense_vector<WorldMatrix<double> >& D2UhAtQP,
        mtl::dense_vector<double>& result,
        double opFactor);
void weakEval(const std::vector<WorldVector<double> > &grdUhAtQP,
        std::vector<WorldVector<double> > &result);
void setFactor(const double fac_) { fac=fac_; }

protected:
int row,col;
double fac;
bool symmetric;
};

/* -------------------------------------------------------------- */

/// < factor*phase*A*grad(u) , grad(psi) > ... 'I' kann ueberladen werden
class MatrixIJPhase_SOT : public SecondOrderTerm
{
public:
/// Constructor
MatrixIJPhase_SOT(DOFVectorBase<double>* phaseDV, int row, int col, double fac=1.0);

/// Implementation of \ref OperatorTerm::initElement().
void initElement(const ElInfo* elInfo, 
        SubAssembler* subAssembler,
        Quadrature *quad=NULL);
void initElement(const ElInfo* largeElInfo, const ElInfo* smallElInfo,
        SubAssembler* subAssembler,
        Quadrature *quad=NULL);
void getLALt(const ElInfo *elInfo,
        std::vector<mtl::dense2D<double> > &LALt) const; 
void eval(int nPoints,
        const mtl::dense_vector<double>& uhAtQP,
        const mtl::dense_vector<WorldVector<double> >& grdUhAtQP,
        const mtl::dense_vector<WorldMatrix<double> >& D2UhAtQP,
        mtl::dense_vector<double>& result,
        double opFactor);
void weakEval(const std::vector<WorldVector<double> > &grdUhAtQP,
        std::vector<WorldVector<double> > &result);
void setFactor(const double fac_) { fac=fac_; }

protected:
DOFVectorBase<double> *phaseDV;
mtl::dense_vector<double> phase;
int row,col;
double fac;
bool symmetric;
};


182
#endif // EXTENSIONS_P_OPERATORS_SOT_H