[aspect-devel] Material models with 3-D ASCII input

Marie Kajan marie.kajan at gmail.com
Tue Jan 30 11:10:41 PST 2018

Hi all,

I have an ASCII data file containing viscosity values with corresponding
spherical coordinates. I've used the Utilities::AsciiDataInitial class in
the past to implement an initial temperature field in 3-D, and now I would
like to implement viscosity in a similar way. Existing material models seem
to mainly use the Utilities::AsciiDataProfile class, which can only
implement 1-D parameters. I'm not sure that Utilities::AsciiDataLookup is
what I want either.

I tried to write a material model that incorporated ASCII data in a similar
fashion to the 'AsciiData' initial temperature model. My code simply
declared Utilities::AsciiDataInitial as an additional public member in the
main class of my material model like this:

template <int dim>

class XXXXX: public MaterialModel::Interface<dim>, public
::aspect::SimulatorAccess<dim>, public Utilities::AsciiDataInitial<dim>

but it turns out that Utilities::AsciiDataInitial already inherits from the
SimulatorAccess class, so this coding attempt gave me errors about
SimulatorAccess functions being inaccessible due to ambiguity. I'm very
rusty when it comes to inheritance and pointers, so I'm here to ask some

1. Can I just remove SimulatorAccess as a public member of my class
template to resolve this ambiguity? This seems like a bad idea, but I don't
know enough about ASPECT's internal workings to be sure.

2. Why does <include/aspect/material_model/ascii_reference_profile.h> store
the ASCII data in an object called 'profile' instead of declaring
Utilities::AsciiDataProfile as a public member? So it ends up calling
functions like "profile.initialize(XXX)" instead of
"Utilities::AsciiDataProfile::initialize(XXX)", for example.

3. I tried to mimic the above approach in my own code as well, putting
"aspect::Utilities::AsciiDataInitial<dim> field" in the private header and
"field.initialize(1)" in the initialize function of my material model, and
so on. But unlike AsciiDataProfile, the initialize function of
AsciiDataInitial contains 'this' pointers that end up pointing nowhere and
giving me "address not mapped" errors. Again, I'm not an expert on
pointers... Could I fix this problem without altering the source code, or
is this just a bad approach?

4. ...Is there a more sensible way to go about what I'm trying to do here?

I didn't want to dump a bunch of code here, but please let me know if my
questions aren't clear enough as is, or if I'm misunderstanding what the
ASPECT code is doing. Thanks in advance for any help!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.geodynamics.org/pipermail/aspect-devel/attachments/20180130/bb2cf817/attachment.html>

More information about the Aspect-devel mailing list