[aspect-devel] Moving plugins into main ASPECT
Rene Gassmoeller
rene.gassmoeller at mailbox.org
Fri Oct 20 09:24:35 PDT 2017
> - about inner_core : the cluster here can’t handle external library,
> so we had to add the inner_core.cc to the main ASPECT (which is the
> main reason we ended up forking aspect). However, it seems that we did
> it quite abruptly… and so the aspect binary we obtain doing that works
> OK for inner core, but can’t do any other thing (like testing with box
> convection). I guess we should do that differently, but I am not sure
> how? How to include inner_core properly into aspect? (splitting
> inner_core.cc with a inner_core.h ? any other things?)
Hi Marine,
let me start with the first problem (Juliane has some answers on your
other questions later today), and let me cc the mailing list, because
this is actually an instructive question that might help others as well.
Your approach is correct, if you are unable to compile shared libraries
on your cluster you should move the plugin you need into the main
project. In principle every source file you simply move into ASPECT's
/source directory and every header file you move into the /include
directory is included when compiling ASPECT after rerunning cmake. You
do not need to split the declaration and definition into source and
header files, it has some practical advantages and is considered better
style (that is why we do it with all normal plugins ;-)), but if the
plugin in question is in a single .cc file you can keep it in that
single file and move it into the /source folder.
In your particular case (the inner_core.cc) the plugin contains a
material model and a heating model, and an additional assembly term. The
material model and heating model should work as expected. The
complication arises from the fact that the assembly term is
unconditionally added to the assembly whenever this .cc file is
included. This is not a problem if it is in a plugin, but if it is in
the main project you can not run models that do not use this term
anymore. The simplest solution I can see would be to comment/uncomment
the following lines of inner_core.cc depending on whether you want to
run inner core models or not:
ASPECT_REGISTER_SIGNALS_CONNECTOR(signal_connector<2>,
signal_connector<3>)
This of course requires recompilation every time you want to
activate/deactivate this term.
An alternative would be to remove the following lines from the plugin
template <int dim>
void signal_connector (aspect::SimulatorSignals<dim> &signals)
{
signals.set_assemblers.connect
(&aspect::set_assemblers_phase_boundary<dim>);
}
ASPECT_REGISTER_SIGNALS_CONNECTOR(signal_connector<2>,
signal_connector<3>)
and add the following line to the material models (not the heating
models) parse_parameters() function:
this->get_signals().set_assemblers.connect
(&aspect::set_assemblers_phase_boundary<dim>);
Now the additional assembler term should only be connected if you select
this material model.
Let me know how that goes, or if you have other questions.
Best,
Rene
More information about the Aspect-devel
mailing list