[aspect-devel] Kludges in ASPECT
Wolfgang Bangerth
bangerth at tamu.edu
Fri Oct 31 14:56:36 PDT 2014
> For instance, at the moment I would like to integrate along columns in
> my model, and assign values to the compositional fields in the top
> cells based on the result. I could probably come up with a legit way
> to do that, and write some nicely commented code which follows all of
> the best-practice guidelines, but I don't even know if much will come
> of it, so I'd rather just kludge something in and test it quickly
> before I exert more effort on it.
>
> As far as I know, none of the plugin interfaces are really intended to
> be used for directly reading and writing to the solution vectors. Am I
> wrong about that? Would a postprocessor be the best way to do it?
>
> Does anyone have a favorite method for quick kludges which modify the
> solution vectors?
I'd just make all of the members of Simulator public. Basically
everything you do in plugins is in classes that derive from
SimulatorAccess, so if you do
const_cast<Simulator<dim>&>(this->get_simulator())
then you have a writable reference to the simulator object and you can
access all of its member variables (because you've made them public).
Not pretty, but works.
Best
W.
--
------------------------------------------------------------------------
Wolfgang Bangerth email: bangerth at math.tamu.edu
www: http://www.math.tamu.edu/~bangerth/
More information about the Aspect-devel
mailing list