[aspect-devel] The output of nonadiabatic_temperature
Juliane Dannberg
dannberg at gfz-potsdam.de
Mon Oct 24 18:48:47 PDT 2016
Hi Nan,
from what I see, you might have declared your ave_temp vector in a place
that you can not access from where you want to use it (in your
postprocessor). You declared it within the Visualization class, and try
to access it in a different class (which is also not derived from
Visualization).
So you probably would want to declare and fill your average temperature
vector in a different place in the code. The Visualization class is used
just to generate graphical output for all visualization postprocessors,
and it doesn't compute any of the output quantities for the individual
postprocessors.
So the very easy to implement (but also very slow) option would be to
call the function that does the lateral averaging directly within
compute_derived_quantities_vector().
Alternatively, you could have a look at the "Dynamic Topography"
postprocessor that demonstrates how you would write a visualization
postprocessor that has to loop over all cells for the computation of the
output.
In general, it is always helpful if you send the whole patch (or a link
to a version of the code that reproduces the error, e.g. on github)
because then we can reproduce the error and it's easier to fix it.
Best,
Juliane
On 10/24/2016 06:11 AM, Nan Zhang wrote:
> Hi Juliane,
>
> I passed the first error in my previous email because I forgot
> including "<aspect/lateral_averaging>" in visualization.cc!
>
> But, I got new compiling error for nonadiabatic_temperature.cc like
> ********************************************************************
> [ 0%] Building CXX object
> CMakeFiles/aspect.dir/source/postprocess/visualization/nonadiabatic_temperature.cc.o
>
> /group/pawsey0138/znan/sw_packages/aspect_trilinos/aspect_develop/source/postprocess/visualization/nonadiabatic_temperature.cc:
> In member function 'virtual void
> aspect::Postprocess::VisualizationPostprocessors::NonadiabaticTemperature<dim>::compute_derived_quantities_vector(const
> std::vector<dealii::Vector<double> >&, const
> std::vector<std::vector<dealii::Tensor<1, dim> > >&, const
> std::vector<std::vector<dealii::Tensor<2, dim, double> > >&, const
> std::vector<dealii::Point<dim, double> >&, const
> std::vector<dealii::Point<dim, double> >&,
> std::vector<dealii::Vector<double> >&) const':
> /group/pawsey0138/znan/sw_packages/aspect_trilinos/aspect_develop/source/postprocess/visualization/nonadiabatic_temperature.cc:64:66:
> error: 'ave_temp' was not declared in this scope
> const unsigned int idx = static_cast<unsigned int>
> ((ave_temp.size()-1) * depth /
> this->get_geometry_model().maximal_depth());
> ^
> make[2]: ***
> [CMakeFiles/aspect.dir/source/postprocess/visualization/nonadiabatic_temperature.cc.o]
> Error 1
> make[1]: *** [CMakeFiles/aspect.dir/all] Error 2
> make: *** [all] Error 2
> ********************************************************************
>
> It seems that my modification in nonadiabatic_temperature.cc with
> ave_temp array cannot transfer into the
> compute_derived_quantities_vector (). How could I define an array and
> transfer information into compute_derived_quantities_vector ()?
>
> Thanks!
> Nan
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.geodynamics.org/pipermail/aspect-devel/attachments/20161024/9cf2a089/attachment.html>
More information about the Aspect-devel
mailing list