-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDGOperatorFactory.h
More file actions
81 lines (56 loc) · 3.4 KB
/
DGOperatorFactory.h
File metadata and controls
81 lines (56 loc) · 3.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#pragma once
#include "ProblemDefinition.h"
#include "evolution/GlobalEvolution.h"
#include "evolution/HesthavenEvolutionMethods.h"
#include "evolution/MaxwellEvolutionMethods.h"
#include "mfemExtension/BilinearIntegrators.h"
#include "mfemExtension/BilinearForm_IBFI.hpp"
#include "Types.h"
namespace maxwell {
using FiniteElementOperator = std::unique_ptr<mfemExtension::BilinearForm>;
FieldType altField(const FieldType& f);
FiniteElementOperator buildByMult(const BilinearForm& op1, const BilinearForm& op2, FiniteElementSpace& fes);
struct GlobalIndices {
GlobalIndices(const int blockSize);
std::array<std::array<mfem::Array<int>, 3>, 2> index;
};
void loadBlockInGlobalAtIndices(const DenseMatrix& blk, SparseMatrix& dst, const std::pair<Array<int>, Array<int>>& ids, const double fieldSign = 1.0);
std::map<BdrCond, std::vector<double>> bdrCoeffCheck(const FluxType& ft);
class DGOperatorFactory {
public:
DGOperatorFactory(ProblemDescription& pd, mfem::FiniteElementSpace& fes);
// Methods for speficic FieldType or Direction Operators //
FiniteElementOperator buildInverseMassMatrixSubOperator(const FieldType& f);
FiniteElementOperator buildDerivativeSubOperator(const Direction& d);
FiniteElementOperator buildZeroNormalSubOperator(const FieldType& f);
FiniteElementOperator buildOneNormalSubOperator(const FieldType& f, const std::vector<Direction>& dirTerms);
FiniteElementOperator buildTwoNormalSubOperator(const FieldType& f, const std::vector<Direction>& dirTerms);
FiniteElementOperator buildZeroNormalIBFISubOperator(const FieldType& f);
FiniteElementOperator buildOneNormalIBFISubOperator(const FieldType& f, const std::vector<Direction>& dirTerms);
FiniteElementOperator buildTwoNormalIBFISubOperator(const FieldType& f, const std::vector<Direction>& dirTerms);
// Methods for complete Maxwell Operators //
std::array<FiniteElementOperator, 2> buildMaxwellInverseMassMatrixOperator();
std::array<FiniteElementOperator, 2> buildMaxwellTFSFInverseMassMatrixOperator();
std::array<std::array<FiniteElementOperator, 3>, 2> buildMaxwellDirectionalOperator();
std::array<FiniteElementOperator, 2> buildMaxwellZeroNormalOperator();
std::array<std::array<std::array<FiniteElementOperator, 3>, 2>, 2> buildMaxwellOneNormalOperator();
std::array<std::array<std::array<std::array<FiniteElementOperator, 3>, 3>, 2>, 2> buildMaxwellTwoNormalOperator();
std::array<FiniteElementOperator, 2> buildMaxwellIntBdrZeroNormalOperator();
std::array<std::array<std::array<FiniteElementOperator, 3>, 2>, 2> buildMaxwellIntBdrOneNormalOperator();
std::array<std::array<std::array<std::array<FiniteElementOperator, 3>, 3>, 2>, 2> buildMaxwellIntBdrTwoNormalOperator();
// Methors for complete Global Operators //
std::array<FiniteElementOperator, 2> buildGlobalInverseMassMatrixOperator();
void addGlobalZeroNormalIBFIOperators(SparseMatrix* global);
void addGlobalOneNormalIBFIOperators(SparseMatrix* global);
void addGlobalTwoNormalIBFIOperators(SparseMatrix* global);
void addGlobalDirectionalOperators(SparseMatrix* global);
void addGlobalZeroNormalOperators(SparseMatrix* global);
void addGlobalOneNormalOperators(SparseMatrix* global);
void addGlobalTwoNormalOperators(SparseMatrix* global);
std::unique_ptr<SparseMatrix> buildTFSFGlobalOperator();
std::unique_ptr<SparseMatrix> buildGlobalOperator();
private:
ProblemDescription pd_;
mfem::FiniteElementSpace fes_;
};
}