John Peterson wrote:
> On Mon, Sep 27, 2010 at 9:25 AM, Stefano Berrone
> <sberrone@...> wrote:
>> We are developing a non stationary parallel adaptive code for Navier-Stokes
>> equations. In order to apply our error estimators and adaptive strategy
>> in an efficient way, we need to do not repartition the mesh in the
>> adaptive steps within a time-step, and to repartition the mesh just at
>> the end of each time-step after the computation of the solution on the
>> last mesh for that time-step.
>> We did some experiment without success.
>> Did someone solve similar problems before? Can someone help us?
>> Is it correct that if we do not repartition the mesh after each
>> refinement/coarsening the new children produced by refinement and the
>> father made active by coarsening of elements on the same processor
>> should be local on the processor to which the old elements belong?
> Hi Stefano,
> I believe that all partitioning is done from the
> MeshBase::prepare_for_use() which utilizes the _partitioner object
> stored by MeshBase.
> I wonder if you could write a "do-nothing" partitioner subclass, and
> substitute it for the "real" partitioner until you actually want to
> partition, at which point you could swap back in the real one?
> Another question, though, is why this is necessary? Performance? Are
> you using the Parallel mesh? If not, I doubt there is much
> performance penalty just caused by the repartitioning, though I could
> be wrong
thank you very much for your prompt answer and sorry for the delay in my
The simplest solution that I thought is to put
Partitioner* default_partitioner = mesh.partitioner().release();
before each time-step
if( mesh_changed )
after each time-step. The function Clear_flags simply set to
Elem::DO_NOTHING refinement_flag and p_refinement_flag for all elements.
The problem is that this solution does not work and I can not understand
I noticed that if mesh._partitioner is NULL no partition is applied, so
it seems that mesh.partitioner().release() is enough to prevent partition.
After the time-step I do not want to change the mesh and the solution,
but just repartition the mesh for balancing the processors load. The
problem is that after some time-steps it crashes in
equation_systems.reinit(). In my code the problem occurs in the
solution->localize (*current_local_solution, send_list);
of system::restrict_vectors(). I can not understand why. Do you have
I also tried to replace equation_systems.reinit() with the following
with worst effects.
I'm using a serial mesh. The origin of my need is that when you coarsen
the mesh in a evolutionary problem you should keep unchanged the initial
condition (and consequently the initial mesh) for that time-step and use
a different (refined-coarsened) mesh for the solution at the end of the
In practice in libmesh you should have 2 meshes and 2 dof_map, one for
the solution at the end of the time-step and the other for the solution
at the begin. The difference is that, while both meshes can be refined,
only that for the end of the time-step is coarsened (I'm assuming to
work with Lagrange elements).
This could be done by not "contracting" the mesh within a time-step, by
linking the dof_map to the active elements of mesh for the end of the
time-step and by linking the old_dof_map to the leaves of the element
tree with the not active (coarsened) elements. I think that this is
possible, but some quite complex change in the library (I think in the
mesh and dof_map classes) is probably needed. What I did was to
temporary save dofs for the coarsened elements in a different structure.
This is performed by each processor on its local elements and dofs and I
want to prevent repartition in order to do not exchange these data
between the processors if some elements change its proecssor_id in the
repartition within a time-step(for efficiency reasons). At the end of
the time-step this structure is no longer needed and repartition can be
applied without problem. I'm not sure if I'm sufficiently clear, let me
Thank you very much for your help.