Thanks for the comments

On 9/27/05, Roy Stogner <> wrote:
On Tue, 27 Sep 2005, Wout Ruijter wrote:

> Three questions regarding periodic boundary conditions:
> 1 - Michael already showed how to implement periodic bc's of type u(l)=u(r),
> how do you add u(l)-u(r)=x? Is that a matter of modifying the righthandside?
> I mean, is the rhs taken into account for constrained dof?

You'll have to do so explicitly.  I don't recall whether Michael
finally ended up using a penalty method or building libMesh
constraints to do his boundary conditions, but only the former method
will work for your case.  I don't think the DofConstraintRow objects
can include right hand side terms.

I guess one could create loose nodes, or dofs, for that matter, which could be forced using a penalty method and which provide the constant that is needed.
I see now that there has been a discussion on that before, I'll read some on it.

> 2 - Is there any way in which of two elements with the same error estimate
> only one will be refined?

If you have a mesh on which 400 elements have error 2 and 600 have
error 1, then AFAIK telling libMesh to refine the worst 30% of
elements will cause a random 300 elements from the first group to be
flagged for refinement.  Normally this is barely noticeable: any
elements "left behind" by one refinement step are likely to be the
first elements in line for refinement on the next step.  If you need
two meshes to match exactly or one mesh to be perfectly symmetric,
though, this will be a problem.

> If this is not the case I would be able to ensure matching meshes by
> modifying the error estimates, or should I modify the refinement
> flags directly?

Either way is good; I'm not sure which way would be quicker to code.
To be safe make sure to modify the flags conservatively: only set new
refinement flags and remove coarsening flags, never set coarsening or
remove refinement.
Of course.

> 3- Am I right to presume that in the case that no interpolated constraints
> are used the _dof_coupling can be used for x==0?
> I guess this could speed up the whole matter in cases with many couplings.

I don't think I understand this question.
Roy Stogner
Sorry, the last one is fairly vague,
I mean, if a node is linked to 1 other node with u(l)=u(r), one could use the _dof_coupling instead of a constraint, whereas if it is linked to a couple of nodes (when it is a hanging node), or when u(l)-u(r)=x, x!=0, one would need a constraint row to handle it.
However, this may be fairly obsolete, because I don't think using _dof_coupling is a good idea, as it seems to allocate N^2 memory.

Sorry for being thick, but I don't understand how the penalty method you suggested in an earlier mail would lead to a coupling of DOF (not a constraint) without having to do a lookup of the corresponding dof on the other side of the mesh and/or meddling with the sparsity structure. If it does that, I would happily implement and use it.

Thanks a lot for your time,