Common Errors
This is a running log of common Alamo error messages, their causes, and fixes.
MLLinOp: grids not coarsenable between AMR levels
This is a conflict in the multigrid solver because the grid size is not a power of 2.
Fix this by changing the domain dimensions, amr.n_cell, so that they are powers of two.
static_cast<long>(i) < this->size() failed
One common reason this happens is that Dirichlet or Neumann boundaries are specified but no boundary values are provided.
error: lvalue required as left operand of assignment
This can happen when using the () operator with an Isotropic Matrix4-type object.
Because this data structure only stores two constants, it is not possible to define any of the values using indices. Similarly, you cannot set an Isotropic 4-matrix to a Cubic 4-matrix because the cubic matrix has lower symmetry.
If you get this error, use a lower-symmetry 4-matrix.
Inconsistent box arrays
This is known to happen when using an Operator::Elastic inside an Integrator, for example in TimeStepBegin.
Typically this happens when the elastic operator is not initialized within the routine in which it is used. One example is declaring it as a member variable inside an Integrator-derived class. The reason is that there are AMReX-specific functions that only get called by the constructor.
Fix this by initializing the operator object inside the routine in which it is used. Either make the member variable a pointer and use the new keyword, or create the variable inside the function.
MLMG converges in serial but diverges in parallel
MLMG sometimes fails to converge in VoronoiElastic in parallel, even if it converges just fine in serial. This generally seems to appear at a C/F boundary (see figure below).
Note that the solution actually appears to be just fine, it’s just that the residual persists. Also note that this only happens when there is a variable model, like in polycrystal elasticity.
Also, keep in mind that the residual persists whether in parallel or in serial, it’s just that convergence fails in parallel only. So it seems this is a communication issue, not an actual parallel convergence issue.
Fix: this is also a temporary fix, mostly, and that is to just increase amr.blocking_factor. In this particular case it was 4 and I increased it to 8. The reason why this makes some sense is that it seems the residual issue occurs when there are two fine patches separated by a very narrow course patch (as in the figure above). Increasing the blocking factor reduces that effect - and in fact, it actually doesn’t hurt performance much either.
MLMG fails to converge
Many things can cause failure of convergence. Here are some of the causes and fixes.
One of the issues that can cause problems with MLMG is if a regrid operation occurs and there is a C/F boundary at the domain boundary. The cause appears to be that regridding can do odd things to the RHS fab. For instance, in the process of averaging, some of the RHS stuff can leak from the boundary into the interior. This obviously causes problems.
Fix: a temporary appears to be to simply zero out and re-initialize the RHS fab before doing an elastic solve.
Last updated
Was this helpful?