Skip to content

Commit 95712c9

Browse files
authored
Merge branch 'master' into lp-error-est-dev
2 parents 0f5c506 + a5b7fba commit 95712c9

35 files changed

+2113
-186
lines changed

CHANGELOG

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ Discretization improvements
3535

3636
- Added support for simplices in GSLIB-FindPoints.
3737

38+
- Added support for H1 and L2 element matrix assembly in the mass, convection,
39+
diffusion, transpose, and the face DG trace integrators. This is compatible
40+
with GPU device execution and is illustrated in Example 9/9p, see the option
41+
'-ea'. When enabled, this level of assembly stores independent dense matrices
42+
for the elements, and independent dense matrices for the faces in the DG case.
43+
3844
- Added new partial assembly kernels for H(div) bilinear forms, as well as
3945
VectorFEDivergenceIntegrator.
4046

examples/ex9.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
//
2020
// Device sample runs:
2121
// ex9 -pa
22+
// ex9 -ea
2223
// ex9 -pa -m ../data/periodic-cube.mesh
2324
// ex9 -pa -m ../data/periodic-cube.mesh -d cuda
2425
//
@@ -142,6 +143,7 @@ int main(int argc, char *argv[])
142143
int ref_levels = 2;
143144
int order = 3;
144145
bool pa = false;
146+
bool ea = false;
145147
const char *device_config = "cpu";
146148
int ode_solver_type = 4;
147149
double t_final = 10.0;
@@ -166,6 +168,8 @@ int main(int argc, char *argv[])
166168
"Order (degree) of the finite elements.");
167169
args.AddOption(&pa, "-pa", "--partial-assembly", "-no-pa",
168170
"--no-partial-assembly", "Enable Partial Assembly.");
171+
args.AddOption(&ea, "-ea", "--element-assembly", "-no-ea",
172+
"--no-element-assembly", "Enable Element Assembly.");
169173
args.AddOption(&device_config, "-d", "--device",
170174
"Device configuration string, see Device::Configure().");
171175
args.AddOption(&ode_solver_type, "-s", "--ode-solver",
@@ -269,6 +273,11 @@ int main(int argc, char *argv[])
269273
m.SetAssemblyLevel(AssemblyLevel::PARTIAL);
270274
k.SetAssemblyLevel(AssemblyLevel::PARTIAL);
271275
}
276+
else if (ea)
277+
{
278+
m.SetAssemblyLevel(AssemblyLevel::ELEMENT);
279+
k.SetAssemblyLevel(AssemblyLevel::ELEMENT);
280+
}
272281
m.AddDomainIntegrator(new MassIntegrator);
273282
k.AddDomainIntegrator(new ConvectionIntegrator(velocity, -1.0));
274283
k.AddInteriorFaceIntegrator(
@@ -429,8 +438,9 @@ FE_Evolution::FE_Evolution(BilinearForm &_M, BilinearForm &_K, const Vector &_b)
429438
: TimeDependentOperator(_M.Height()), M(_M), K(_K), b(_b), z(_M.Height())
430439
{
431440
bool pa = M.GetAssemblyLevel() == AssemblyLevel::PARTIAL;
441+
bool ea = M.GetAssemblyLevel() == AssemblyLevel::ELEMENT;
432442
Array<int> ess_tdof_list;
433-
if (pa)
443+
if (pa || ea)
434444
{
435445
M_prec = new OperatorJacobiSmoother(M, ess_tdof_list);
436446
M_solver.SetOperator(M);

examples/ex9p.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
//
2020
// Device sample runs:
2121
// mpirun -np 4 ex9p -pa
22+
// mpirun -np 4 ex9p -ea
2223
// mpirun -np 4 ex9p -pa -m ../data/periodic-cube.mesh
2324
// mpirun -np 4 ex9p -pa -m ../data/periodic-cube.mesh -d cuda
2425
//
@@ -161,6 +162,7 @@ int main(int argc, char *argv[])
161162
int par_ref_levels = 0;
162163
int order = 3;
163164
bool pa = false;
165+
bool ea = false;
164166
const char *device_config = "cpu";
165167
int ode_solver_type = 4;
166168
double t_final = 10.0;
@@ -188,6 +190,8 @@ int main(int argc, char *argv[])
188190
"Order (degree) of the finite elements.");
189191
args.AddOption(&pa, "-pa", "--partial-assembly", "-no-pa",
190192
"--no-partial-assembly", "Enable Partial Assembly.");
193+
args.AddOption(&ea, "-ea", "--element-assembly", "-no-ea",
194+
"--no-element-assembly", "Enable Element Assembly.");
191195
args.AddOption(&device_config, "-d", "--device",
192196
"Device configuration string, see Device::Configure().");
193197
args.AddOption(&ode_solver_type, "-s", "--ode-solver",
@@ -319,6 +323,11 @@ int main(int argc, char *argv[])
319323
m->SetAssemblyLevel(AssemblyLevel::PARTIAL);
320324
k->SetAssemblyLevel(AssemblyLevel::PARTIAL);
321325
}
326+
else if (ea)
327+
{
328+
m->SetAssemblyLevel(AssemblyLevel::ELEMENT);
329+
k->SetAssemblyLevel(AssemblyLevel::ELEMENT);
330+
}
322331
m->AddDomainIntegrator(new MassIntegrator);
323332
k->AddDomainIntegrator(new ConvectionIntegrator(velocity, -1.0));
324333
k->AddInteriorFaceIntegrator(
@@ -556,8 +565,9 @@ FE_Evolution::FE_Evolution(ParBilinearForm &_M, ParBilinearForm &_K,
556565
z(_M.Height())
557566
{
558567
bool pa = _M.GetAssemblyLevel()==AssemblyLevel::PARTIAL;
568+
bool ea = _M.GetAssemblyLevel()==AssemblyLevel::ELEMENT;
559569

560-
if (pa)
570+
if (pa || ea)
561571
{
562572
M.Reset(&_M, false);
563573
K.Reset(&_K, false);
@@ -571,7 +581,7 @@ FE_Evolution::FE_Evolution(ParBilinearForm &_M, ParBilinearForm &_K,
571581
M_solver.SetOperator(*M);
572582

573583
Array<int> ess_tdof_list;
574-
if (pa)
584+
if (pa || ea)
575585
{
576586
M_prec = new OperatorJacobiSmoother(_M, ess_tdof_list);
577587
dg_solver = NULL;

fem/CMakeLists.txt

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,20 @@ set(SRCS
1313
bilinearform.cpp
1414
bilinearform_ext.cpp
1515
bilininteg.cpp
16-
bilininteg_convection.cpp
17-
bilininteg_dgtrace.cpp
18-
bilininteg_diffusion.cpp
16+
bilininteg_convection_pa.cpp
17+
bilininteg_convection_ea.cpp
18+
bilininteg_dgtrace_pa.cpp
19+
bilininteg_dgtrace_ea.cpp
20+
bilininteg_diffusion_pa.cpp
21+
bilininteg_diffusion_ea.cpp
1922
bilininteg_divergence.cpp
2023
bilininteg_hcurl.cpp
2124
bilininteg_hdiv.cpp
2225
bilininteg_vectorfe.cpp
2326
bilininteg_gradient.cpp
24-
bilininteg_mass.cpp
27+
bilininteg_mass_pa.cpp
28+
bilininteg_mass_ea.cpp
29+
bilininteg_transpose_ea.cpp
2530
bilininteg_vecdiffusion.cpp
2631
bilininteg_vecmass.cpp
2732
coefficient.cpp

fem/bilinearform.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,7 @@ void BilinearForm::SetAssemblyLevel(AssemblyLevel assembly_level)
126126
// Use the original BilinearForm implementation for now
127127
break;
128128
case AssemblyLevel::ELEMENT:
129-
mfem_error("Element assembly not supported yet... stay tuned!");
130-
// ext = new EABilinearFormExtension(this);
129+
ext = new EABilinearFormExtension(this);
131130
break;
132131
case AssemblyLevel::PARTIAL:
133132
ext = new PABilinearFormExtension(this);

0 commit comments

Comments
 (0)