Skip to content

Commit

Permalink
fix compilation of master
Browse files Browse the repository at this point in the history
  • Loading branch information
tjhei committed Nov 22, 2017
1 parent cd32154 commit 9f91dc3
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 13 deletions.
6 changes: 6 additions & 0 deletions include/aspect/free_surface.h
Expand Up @@ -77,6 +77,12 @@ namespace aspect
*/
void execute();

/**
* Called by Simulator::set_assemblers() to allow the FreeSurfaceHandler
* to register its assembler.
*/
void set_assemblers();

/**
* Allocates and sets up the members of the FreeSurfaceHandler. This
* is called by Simulator<dim>::setup_dofs()
Expand Down
6 changes: 6 additions & 0 deletions include/aspect/simulator/assemblers/interface.h
Expand Up @@ -587,6 +587,12 @@ namespace aspect
class Manager
{
public:

/**
* Reset the state of the manager and remove all Assemblers.
*/
void reset ();

/**
* A vector of pointers containing all assemblers for the Stokes preconditioner.
* These assemblers are called once per cell.
Expand Down
10 changes: 10 additions & 0 deletions source/simulator/assemblers/interface.cc
Expand Up @@ -487,6 +487,16 @@ namespace aspect
}


template <int dim>
void Manager<dim>::reset ()
{
stokes_preconditioner.clear();
stokes_system.clear();
stokes_system_on_boundary_face.clear();
advection_system.clear();
advection_system_on_boundary_face.clear();
advection_system_on_interior_face.clear();
}

template <int dim>
Manager<dim>::Properties::Properties ()
Expand Down
10 changes: 8 additions & 2 deletions source/simulator/assembly.cc
Expand Up @@ -123,10 +123,12 @@ namespace aspect
Simulator<dim>::
set_assemblers ()
{
// first let the manager delete all existing assemblers:
assemblers->reset();

assemblers->advection_system_assembler_properties.resize(1+introspection.n_compositional_fields);
assemblers->advection_system_assembler_on_face_properties.resize(1+introspection.n_compositional_fields);


if (parameters.include_melt_transport)
{
aspect::Assemblers::MeltStokesPreconditioner<dim> *preconditioner = new aspect::Assemblers::MeltStokesPreconditioner<dim>();
Expand Down Expand Up @@ -359,7 +361,11 @@ namespace aspect
}
}

// allow other assemblers to add themselves or modify the existing ones by firing the signal
// Let the free surface add its assembler:
if (parameters.free_surface_enabled)
free_surface->set_assemblers();

// Finally allow other assemblers to add themselves or modify the existing ones by firing the signal
this->signals.set_assemblers(*this, *assemblers);

// ensure that all assembler objects have access to the SimulatorAccess
Expand Down
26 changes: 16 additions & 10 deletions source/simulator/free_surface.cc
Expand Up @@ -134,7 +134,23 @@ namespace aspect
free_surface_dof_handler (sim.triangulation)
{
parse_parameters(prm);
}

template <int dim>
FreeSurfaceHandler<dim>::~FreeSurfaceHandler ()
{
// Free the Simulator's mapping object, otherwise
// when the FreeSurfaceHandler gets destroyed,
// the mapping's reference to the mesh displacement
// vector will be invalid.
sim.mapping.reset();
}



template <int dim>
void FreeSurfaceHandler<dim>::set_assemblers()
{
aspect::Assemblers::ApplyStabilization<dim> *surface_stabilization
= new aspect::Assemblers::ApplyStabilization<dim>();

Expand All @@ -153,16 +169,6 @@ namespace aspect
update_JxW_values);
}

template <int dim>
FreeSurfaceHandler<dim>::~FreeSurfaceHandler ()
{
// Free the Simulator's mapping object, otherwise
// when the FreeSurfaceHandler gets destroyed,
// the mapping's reference to the mesh displacement
// vector will be invalid.
sim.mapping.reset();
}

template <int dim>
void FreeSurfaceHandler<dim>::declare_parameters(ParameterHandler &prm)
{
Expand Down
1 change: 0 additions & 1 deletion source/simulator/solver_schemes.cc
Expand Up @@ -528,7 +528,6 @@ namespace aspect

if (nonlinear_iteration <= 1)
{
assemblers.reset (new internal::Assembly::AssemblerLists<dim>());
set_assemblers();
compute_current_constraints ();
}
Expand Down

0 comments on commit 9f91dc3

Please sign in to comment.