@@ -84,12 +84,13 @@ std::unique_ptr<ParOperator> GetBtt(const MaterialOperator &mat_op,
84
84
constexpr MaterialPropertyType MatType = MaterialPropertyType::INV_PERMEABILITY;
85
85
constexpr MeshElementType ElemType = MeshElementType::BDR_SUBMESH;
86
86
MaterialPropertyCoefficient<MatType, ElemType> muinv_func (mat_op);
87
- auto btt = std::make_unique<mfem::SymmetricBilinearForm>(&nd_fespace);
88
- btt->AddDomainIntegrator (new mfem::VectorFEMassIntegrator (muinv_func));
89
- btt->SetAssemblyLevel (mfem::AssemblyLevel::LEGACY);
90
- btt->Assemble (skip_zeros);
91
- btt->Finalize (skip_zeros);
92
- return std::make_unique<ParOperator>(std::move (btt), nd_fespace);
87
+ mfem::SymmetricBilinearForm btt (&nd_fespace);
88
+ btt.AddDomainIntegrator (new mfem::VectorFEMassIntegrator (muinv_func));
89
+ btt.SetAssemblyLevel (mfem::AssemblyLevel::LEGACY);
90
+ btt.Assemble (skip_zeros);
91
+ btt.Finalize (skip_zeros);
92
+ return std::make_unique<ParOperator>(std::unique_ptr<mfem::SparseMatrix>(btt.LoseMat ()),
93
+ nd_fespace);
93
94
}
94
95
95
96
std::unique_ptr<ParOperator> GetBtn (const MaterialOperator &mat_op,
@@ -100,12 +101,13 @@ std::unique_ptr<ParOperator> GetBtn(const MaterialOperator &mat_op,
100
101
constexpr MaterialPropertyType MatType = MaterialPropertyType::INV_PERMEABILITY;
101
102
constexpr MeshElementType ElemType = MeshElementType::BDR_SUBMESH;
102
103
MaterialPropertyCoefficient<MatType, ElemType> muinv_func (mat_op);
103
- auto btn = std::make_unique<mfem::MixedBilinearForm>(&h1_fespace, &nd_fespace);
104
- btn->AddDomainIntegrator (new mfem::MixedVectorGradientIntegrator (muinv_func));
105
- btn->SetAssemblyLevel (mfem::AssemblyLevel::LEGACY);
106
- btn->Assemble (skip_zeros);
107
- btn->Finalize (skip_zeros);
108
- return std::make_unique<ParOperator>(std::move (btn), h1_fespace, nd_fespace, false );
104
+ mfem::MixedBilinearForm btn (&h1_fespace, &nd_fespace);
105
+ btn.AddDomainIntegrator (new mfem::MixedVectorGradientIntegrator (muinv_func));
106
+ btn.SetAssemblyLevel (mfem::AssemblyLevel::LEGACY);
107
+ btn.Assemble (skip_zeros);
108
+ btn.Finalize (skip_zeros);
109
+ return std::make_unique<ParOperator>(std::unique_ptr<mfem::SparseMatrix>(btn.LoseMat ()),
110
+ h1_fespace, nd_fespace, false );
109
111
}
110
112
111
113
std::array<std::unique_ptr<ParOperator>, 3 > GetBnn (const MaterialOperator &mat_op,
@@ -115,38 +117,44 @@ std::array<std::unique_ptr<ParOperator>, 3> GetBnn(const MaterialOperator &mat_o
115
117
constexpr MaterialPropertyType MatTypeMuInv = MaterialPropertyType::INV_PERMEABILITY;
116
118
constexpr MeshElementType ElemType = MeshElementType::BDR_SUBMESH;
117
119
MaterialPropertyCoefficient<MatTypeMuInv, ElemType> muinv_func (mat_op);
118
- auto bnn1 = std::make_unique< mfem::SymmetricBilinearForm> (&h1_fespace);
119
- bnn1-> AddDomainIntegrator (new mfem::DiffusionIntegrator (muinv_func));
120
- bnn1-> SetAssemblyLevel (mfem::AssemblyLevel::LEGACY);
121
- bnn1-> Assemble (skip_zeros);
122
- bnn1-> Finalize (skip_zeros);
120
+ mfem::SymmetricBilinearForm bnn1 (&h1_fespace);
121
+ bnn1. AddDomainIntegrator (new mfem::DiffusionIntegrator (muinv_func));
122
+ bnn1. SetAssemblyLevel (mfem::AssemblyLevel::LEGACY);
123
+ bnn1. Assemble (skip_zeros);
124
+ bnn1. Finalize (skip_zeros);
123
125
124
126
constexpr MaterialPropertyType MatTypeEpsReal = MaterialPropertyType::PERMITTIVITY_REAL;
125
127
NormalProjectedCoefficient epsilon_func (
126
128
std::make_unique<MaterialPropertyCoefficient<MatTypeEpsReal, ElemType>>(mat_op));
127
- auto bnn2r = std::make_unique< mfem::SymmetricBilinearForm> (&h1_fespace);
128
- bnn2r-> AddDomainIntegrator (new mfem::MixedScalarMassIntegrator (epsilon_func));
129
- bnn2r-> SetAssemblyLevel (mfem::AssemblyLevel::LEGACY);
130
- bnn2r-> Assemble (skip_zeros);
131
- bnn2r-> Finalize (skip_zeros);
129
+ mfem::SymmetricBilinearForm bnn2r (&h1_fespace);
130
+ bnn2r. AddDomainIntegrator (new mfem::MixedScalarMassIntegrator (epsilon_func));
131
+ bnn2r. SetAssemblyLevel (mfem::AssemblyLevel::LEGACY);
132
+ bnn2r. Assemble (skip_zeros);
133
+ bnn2r. Finalize (skip_zeros);
132
134
133
135
// Contribution for loss tangent: ε -> ε * (1 - i tan(δ)).
134
136
if (!mat_op.HasLossTangent ())
135
137
{
136
- return {std::make_unique<ParOperator>(std::move (bnn1), h1_fespace),
137
- std::make_unique<ParOperator>(std::move (bnn2r), h1_fespace), nullptr };
138
+ return {std::make_unique<ParOperator>(
139
+ std::unique_ptr<mfem::SparseMatrix>(bnn1.LoseMat ()), h1_fespace),
140
+ std::make_unique<ParOperator>(
141
+ std::unique_ptr<mfem::SparseMatrix>(bnn2r.LoseMat ()), h1_fespace),
142
+ nullptr };
138
143
}
139
144
constexpr MaterialPropertyType MatTypeEpsImag = MaterialPropertyType::PERMITTIVITY_IMAG;
140
145
NormalProjectedCoefficient negepstandelta_func (
141
146
std::make_unique<MaterialPropertyCoefficient<MatTypeEpsImag, ElemType>>(mat_op));
142
- auto bnn2i = std::make_unique<mfem::SymmetricBilinearForm>(&h1_fespace);
143
- bnn2i->AddDomainIntegrator (new mfem::MixedScalarMassIntegrator (negepstandelta_func));
144
- bnn2i->SetAssemblyLevel (mfem::AssemblyLevel::LEGACY);
145
- bnn2i->Assemble (skip_zeros);
146
- bnn2i->Finalize (skip_zeros);
147
- return {std::make_unique<ParOperator>(std::move (bnn1), h1_fespace),
148
- std::make_unique<ParOperator>(std::move (bnn2r), h1_fespace),
149
- std::make_unique<ParOperator>(std::move (bnn2i), h1_fespace)};
147
+ mfem::SymmetricBilinearForm bnn2i (&h1_fespace);
148
+ bnn2i.AddDomainIntegrator (new mfem::MixedScalarMassIntegrator (negepstandelta_func));
149
+ bnn2i.SetAssemblyLevel (mfem::AssemblyLevel::LEGACY);
150
+ bnn2i.Assemble (skip_zeros);
151
+ bnn2i.Finalize (skip_zeros);
152
+ return {std::make_unique<ParOperator>(std::unique_ptr<mfem::SparseMatrix>(bnn1.LoseMat ()),
153
+ h1_fespace),
154
+ std::make_unique<ParOperator>(
155
+ std::unique_ptr<mfem::SparseMatrix>(bnn2r.LoseMat ()), h1_fespace),
156
+ std::make_unique<ParOperator>(
157
+ std::unique_ptr<mfem::SparseMatrix>(bnn2i.LoseMat ()), h1_fespace)};
150
158
}
151
159
152
160
std::array<std::unique_ptr<ParOperator>, 3 > GetAtt (const MaterialOperator &mat_op,
@@ -157,36 +165,42 @@ std::array<std::unique_ptr<ParOperator>, 3> GetAtt(const MaterialOperator &mat_o
157
165
constexpr MeshElementType ElemType = MeshElementType::BDR_SUBMESH;
158
166
NormalProjectedCoefficient muinv_func (
159
167
std::make_unique<MaterialPropertyCoefficient<MatTypeMuInv, ElemType>>(mat_op));
160
- auto att1 = std::make_unique< mfem::SymmetricBilinearForm> (&nd_fespace);
161
- att1-> AddDomainIntegrator (new mfem::CurlCurlIntegrator (muinv_func));
162
- att1-> SetAssemblyLevel (mfem::AssemblyLevel::LEGACY);
163
- att1-> Assemble (skip_zeros);
164
- att1-> Finalize (skip_zeros);
168
+ mfem::SymmetricBilinearForm att1 (&nd_fespace);
169
+ att1. AddDomainIntegrator (new mfem::CurlCurlIntegrator (muinv_func));
170
+ att1. SetAssemblyLevel (mfem::AssemblyLevel::LEGACY);
171
+ att1. Assemble (skip_zeros);
172
+ att1. Finalize (skip_zeros);
165
173
166
174
constexpr MaterialPropertyType MatTypeEpsReal = MaterialPropertyType::PERMITTIVITY_REAL;
167
175
MaterialPropertyCoefficient<MatTypeEpsReal, ElemType> epsilon_func (mat_op);
168
- auto att2r = std::make_unique< mfem::SymmetricBilinearForm> (&nd_fespace);
169
- att2r-> AddDomainIntegrator (new mfem::VectorFEMassIntegrator (epsilon_func));
170
- att2r-> SetAssemblyLevel (mfem::AssemblyLevel::LEGACY);
171
- att2r-> Assemble (skip_zeros);
172
- att2r-> Finalize (skip_zeros);
176
+ mfem::SymmetricBilinearForm att2r (&nd_fespace);
177
+ att2r. AddDomainIntegrator (new mfem::VectorFEMassIntegrator (epsilon_func));
178
+ att2r. SetAssemblyLevel (mfem::AssemblyLevel::LEGACY);
179
+ att2r. Assemble (skip_zeros);
180
+ att2r. Finalize (skip_zeros);
173
181
174
182
// Contribution for loss tangent: ε -> ε * (1 - i tan(δ)).
175
183
if (!mat_op.HasLossTangent ())
176
184
{
177
- return {std::make_unique<ParOperator>(std::move (att1), nd_fespace),
178
- std::make_unique<ParOperator>(std::move (att2r), nd_fespace), nullptr };
185
+ return {std::make_unique<ParOperator>(
186
+ std::unique_ptr<mfem::SparseMatrix>(att1.LoseMat ()), nd_fespace),
187
+ std::make_unique<ParOperator>(
188
+ std::unique_ptr<mfem::SparseMatrix>(att2r.LoseMat ()), nd_fespace),
189
+ nullptr };
179
190
}
180
191
constexpr MaterialPropertyType MatTypeEpsImag = MaterialPropertyType::PERMITTIVITY_IMAG;
181
192
MaterialPropertyCoefficient<MatTypeEpsImag, ElemType> negepstandelta_func (mat_op);
182
- auto att2i = std::make_unique<mfem::SymmetricBilinearForm>(&nd_fespace);
183
- att2i->AddDomainIntegrator (new mfem::VectorFEMassIntegrator (negepstandelta_func));
184
- att2i->SetAssemblyLevel (mfem::AssemblyLevel::LEGACY);
185
- att2i->Assemble (skip_zeros);
186
- att2i->Finalize (skip_zeros);
187
- return {std::make_unique<ParOperator>(std::move (att1), nd_fespace),
188
- std::make_unique<ParOperator>(std::move (att2r), nd_fespace),
189
- std::make_unique<ParOperator>(std::move (att2i), nd_fespace)};
193
+ mfem::SymmetricBilinearForm att2i (&nd_fespace);
194
+ att2i.AddDomainIntegrator (new mfem::VectorFEMassIntegrator (negepstandelta_func));
195
+ att2i.SetAssemblyLevel (mfem::AssemblyLevel::LEGACY);
196
+ att2i.Assemble (skip_zeros);
197
+ att2i.Finalize (skip_zeros);
198
+ return {std::make_unique<ParOperator>(std::unique_ptr<mfem::SparseMatrix>(att1.LoseMat ()),
199
+ nd_fespace),
200
+ std::make_unique<ParOperator>(
201
+ std::unique_ptr<mfem::SparseMatrix>(att2r.LoseMat ()), nd_fespace),
202
+ std::make_unique<ParOperator>(
203
+ std::unique_ptr<mfem::SparseMatrix>(att2i.LoseMat ()), nd_fespace)};
190
204
}
191
205
192
206
std::array<std::unique_ptr<mfem::HypreParMatrix>, 6 >
0 commit comments