1-D Error Estimation and Refinement

In adapting the Error Estimation and Refinement iTutorial to a use a 1-D mesh, I’m running into a couple of issues.

First, If I specify the ‘multigrid’ preconditioner as in the tutorial, I get a seg fault assembling the bilinear form. According to valgrind it happens in the BlockJacobiPreconditioner

==19959== Process terminating with default action of signal 11 (SIGSEGV)
==19959== Access not within mapped region at address 0xB104D5C0
==19959== at 0x14DBE9B7: ngla::BlockJacobiPrecond<double, double, double>::BlockJacobiPrecond(ngla::SparseMatrix<double, double, double> const&, std::shared_ptr<ngstd::Table >) (blockjacobi.cpp:454)

I don’t get the segfault if I specify ‘local’, ‘direct’, or ‘bddc’.
If I don’t specify a preconditioner, I can assemble and solve with no issues.
The segfault with ‘multigrid’ occurs whether or not inverse=“sparsecholesky” is set.

Second, I get a seg fault if I try to create an HDiv space for the error recovery method. An HDiv space probably doesn’t make much sense in a 1D context. Is there another approach to estimating error for marking and refinement?

I’m attaching my code…


Dow Drake

Edit: Also it seems that setting a refinement flag and refinement aren’t supported for 1D meshes.



for el in mesh.Elements(): mesh.SetRefinementFlag(el, el.nr > 5)
also produce seg faults.
It makes sense since 1D meshes must be created manually. It shouldn’t be difficult to do the refinement in Python.

Attachment: refinement.py

Attachment: mesh_util.py

Attachment: hdiv1d.py