# Particles with free surface

**URL:** <https://community.geodynamics.org/t/particles-with-free-surface/1908>\
**Category:** ASPECT\
**Created:** [July 16, 2021, 6:48am UTC](https://community.geodynamics.org/t/particles-with-free-surface/1908 "2021-07-16T06:48:36Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![moh\_g](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/moh_g/32/836_2.png) [@moh\_g](https://community.geodynamics.org/u/moh_g)\
**Post date:** [July 16, 2021, 6:48am UTC](https://community.geodynamics.org/t/particles-with-free-surface/1908/1 "2021-07-16T06:48:36Z")

</div>

Hi all,

I am trying to run a lithospheric extension model with free surface and passive particles to track the pT path of the upper crust but the simulation fails either during the initial mesh refinement at timestep 0 or at the start of timestep 1 when I remove the mesh refinement (first lines from the error file are below).

I am using version 2.3.0-pre

Thank you

Moh

```auto
An error occurred in line <3272> of file </nobackup/earmgo/aspect_workshop/candi/tmp/unpack/deal.II-v9.2.0/include/deal.II/dofs/dof_accessor.templates.h> in function
    void dealii::DoFCellAccessor<DoFHandlerType, level_dof_access>::get_dof_values(const InputVector &, ForwardIterator, ForwardIterator) const [with InputVector = dealii::TrilinosWrappers::MPI::Vector, ForwardIterator = double *, DoFHandlerType = dealii::DoFHandler<3, 3>, bool level_dof_access = false]
The violated condition was:
    this->is_artificial() == false
Additional information:
    Can't ask for DoF indices on artificial cells.

```

---

<div class="post-metadata">

**Author:** ![bangerth](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/bangerth/32/52_2.png) [@bangerth](https://community.geodynamics.org/u/bangerth)\
**Post date:** [July 16, 2021, 4:45pm UTC](https://community.geodynamics.org/t/particles-with-free-surface/1908/2 "2021-07-16T16:45:00Z")

</div>

Moh,  
would you be willing to try this again with the current ASPECT development sources? Rene has done a lot of work in this area, and the problem may since have been fixed.  
Best  
Wolfgang

---

<div class="post-metadata">

**Author:** ![jbnaliboff](https://avatars.discourse-cdn.com/v4/letter/j/58956e/32.png) [@jbnaliboff](https://community.geodynamics.org/u/jbnaliboff)\
**Post date:** [July 16, 2021, 11:22pm UTC](https://community.geodynamics.org/t/particles-with-free-surface/1908/3 "2021-07-16T23:22:47Z")

</div>

Hi Moh,

I’m also unsure exactly what the issue is here. The ability to use the particles with the free surface was reintroduced at some point in 2.3.0-pre, but that does not seem to be the issue.

I agree with Wolfgang’s suggestion to update to the most recent master branch and see if that resolves the issue.

In the next week or two I should have some tests done with extension models using active particles, and am happy to share those results when they have run successfully.

Cheers,  
John

---

<div class="post-metadata">

**Author:** ![moh\_g](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/moh_g/32/836_2.png) [@moh\_g](https://community.geodynamics.org/u/moh_g)\
**Post date:** [July 17, 2021, 8:09pm UTC](https://community.geodynamics.org/t/particles-with-free-surface/1908/4 "2021-07-17T20:09:58Z")

</div>

Hi Wolfgang, John,

Thanks for the reply.

I tried to install the current ASPECT and ran into an issues:

```auto
[31%] Building CXX object CMakeFiles/aspect.dir/source/material_model/rheology/visco_plastic.cc.o
/home/home02/earmgo/safe/aspect_dir/aspect-2.4.0-pre/source/material_model/diffusion_dislocation.cc(452): error: namespace "std" has no member "make_unique"
            diffusion_creep.parse_parameters(prm, std::make_unique<std::vector<unsigned int>>(n_fields));
                                                       ^

/home/home02/earmgo/safe/aspect_dir/aspect-2.4.0-pre/source/material_model/diffusion_dislocation.cc(452): error: type name is not allowed
            diffusion_creep.parse_parameters(prm, std::make_unique<std::vector<unsigned int>>(n_fields));
                                                                   ^

/home/home02/earmgo/safe/aspect_dir/aspect-2.4.0-pre/source/material_model/diffusion_dislocation.cc(456): error: namespace "std" has no member "make_unique"
            dislocation_creep.parse_parameters(prm, std::make_unique<std::vector<unsigned int>>(n_fields));
                                                         ^

/home/home02/earmgo/safe/aspect_dir/aspect-2.4.0-pre/source/material_model/diffusion_dislocation.cc(456): error: type name is not allowed
            dislocation_creep.parse_parameters(prm, std::make_unique<std::vector<unsigned int>>(n_fields));
                                                                     ^

compilation aborted for /home/home02/earmgo/safe/aspect_dir/aspect-2.4.0-pre/source/material_model/diffusion_dislocation.cc (code 2)
make[2]: *** [CMakeFiles/aspect.dir/source/material_model/diffusion_dislocation.cc.o] Error 2
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/aspect.dir/all] Error 2
make: *** [all] Error 2

```

It seems to be related to the compiler being c++11 instead of c++14, according to some posts that I found online, but I can’t figure out how to solve it! Any help would be appreciated 🙂.

---

<div class="post-metadata">

**Author:** ![jbnaliboff](https://avatars.discourse-cdn.com/v4/letter/j/58956e/32.png) [@jbnaliboff](https://community.geodynamics.org/u/jbnaliboff)\
**Post date:** [July 17, 2021, 8:45pm UTC](https://community.geodynamics.org/t/particles-with-free-surface/1908/5 "2021-07-17T20:45:36Z")

</div>

Hi Moh,

Hmm, you should still be able to build ASPECT using a compiler that does not support C++14 yet. Are you using deal.II version 9.3.0?

John

---

<div class="post-metadata">

**Author:** ![moh\_g](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/moh_g/32/836_2.png) [@moh\_g](https://community.geodynamics.org/u/moh_g)\
**Post date:** [July 17, 2021, 9:00pm UTC](https://community.geodynamics.org/t/particles-with-free-surface/1908/6 "2021-07-17T21:00:29Z")

</div>

Hi John,

No I am using deal II 8.2.0, which is the version installed through candi.

Moh

---

<div class="post-metadata">

**Author:** ![tjhei](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/tjhei/32/1163_2.png) [@tjhei](https://community.geodynamics.org/u/tjhei)\
**Post date:** [July 17, 2021, 10:03pm UTC](https://community.geodynamics.org/t/particles-with-free-surface/1908/7 "2021-07-17T22:03:08Z")

</div>

Hi Moh,

we will be moving to requiring a c++ 14 compiler in about a week or so, so I don’t think we are going to go back to fix the issues you just reported. If you don’t want to upgrade, you can replace  
`std::make_unique` by `std_cxx14::make_unique`  
There are maybe 6-7 places in `source/` that needs fixing. I think that is all that is required to compile with c++11.

Best,  
Timo

---

<div class="post-metadata">

**Author:** ![moh\_g](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/moh_g/32/836_2.png) [@moh\_g](https://community.geodynamics.org/u/moh_g)\
**Post date:** [July 18, 2021, 4:36pm UTC](https://community.geodynamics.org/t/particles-with-free-surface/1908/8 "2021-07-18T16:36:04Z")

</div>

Hi Timo,

Thanks for the fix. It helped getting the compilation to 94% but now I am getting this error:

```auto
[94%] Building CXX object CMakeFiles/aspect.dir/contrib/world_builder/source/features/subducting_plate_models/temperature/linear.cc.o
/home/home02/earmgo/safe/aspect_dir/aspect-2.4.0-pre/unit_tests/parse_map_to_double_array.cc(87): error: name followed by "::" must be a class or namespace name
      auto n_values_per_key = std_cxx14::make_unique<std::vector<unsigned int>>();
                              ^

/home/home02/earmgo/safe/aspect_dir/aspect-2.4.0-pre/unit_tests/parse_map_to_double_array.cc(87): error: expected an identifier
      auto n_values_per_key = std_cxx14::make_unique<std::vector<unsigned int>>();
                                                                 ^

/home/home02/earmgo/safe/aspect_dir/aspect-2.4.0-pre/unit_tests/parse_map_to_double_array.cc(87): error: expected a ";"
      auto n_values_per_key = std_cxx14::make_unique<std::vector<unsigned int>>();
                                                                 ^

```

In any case, John shared with me one of his test setups using active particles that runs on the 2.3-branch.

---

<div class="post-metadata">

**Author:** ![bangerth](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/bangerth/32/52_2.png) [@bangerth](https://community.geodynamics.org/u/bangerth)\
**Post date:** [July 19, 2021, 4:56pm UTC](https://community.geodynamics.org/t/particles-with-free-surface/1908/9 "2021-07-19T16:56:23Z")

</div>

> I tried to install the current ASPECT and ran into an issues:
> 
> > [31%] Building CXX object  
> > CMakeFiles/aspect.dir/source/material\_model/rheology/visco\_plastic.cc.o  
> > /home/home02/earmgo/safe/aspect\_dir/aspect-2.4.0-pre/source/material\_model/diffusion\_dislocation.cc(452):  
> > error: namespace “std” has no member “make\_unique”  
> > diffusion\_creep.parse\_parameters(prm, std::make\_unique\<std::vector\<unsigned
> > 
> > > (n\_fields)); ^

Apparently all developers use compilers that already understand C++14. You can  
either wait until this patch is merged  
[Don't use std::make\_unique just yet. by bangerth · Pull Request #4261 · geodynamics/aspect · GitHub](https://github.com/geodynamics/aspect/pull/4261)  
or just replace all of these places by std\_cxx14::make\_unique.

Best  
W.

---

<div class="post-metadata">

**Author:** ![bangerth](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/bangerth/32/52_2.png) [@bangerth](https://community.geodynamics.org/u/bangerth)\
**Post date:** [July 19, 2021, 4:58pm UTC](https://community.geodynamics.org/t/particles-with-free-surface/1908/10 "2021-07-19T16:58:35Z")

</div>

You might have to add  
#include \<aspect/compat.h\>  
to this file.

---

<div class="post-metadata">

**Author:** ![moh\_g](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/moh_g/32/836_2.png) [@moh\_g](https://community.geodynamics.org/u/moh_g)\
**Post date:** [July 19, 2021, 6:13pm UTC](https://community.geodynamics.org/t/particles-with-free-surface/1908/11 "2021-07-19T18:13:03Z")

</div>

Hi Wolfgang,

I added the #include \<aspect/compat.h\> to the unit\_tests/parse\_map\_to\_double\_array.cc but I still have the same issue (i.e., name followed by “::” must be a class or namespace name).

Concerning my initial issue with the particles, adding diffusivity to the mesh solved the issue. The model has reached 15 Myr so far on the 2.3-branch.

So, I am happy to wait for the cxx14 patch to be merged before compiling the master-branch.

Cheers,  
Moh

---

<div class="post-metadata">

**Author:** ![bangerth](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/bangerth/32/52_2.png) [@bangerth](https://community.geodynamics.org/u/bangerth)\
**Post date:** [July 19, 2021, 6:56pm UTC](https://community.geodynamics.org/t/particles-with-free-surface/1908/12 "2021-07-19T18:56:50Z")

</div>

Mohamed,  
the patch I mentioned earlier has been merged. As for this particular file,  
just remove everything from the file and leave it empty – you don’t need the  
contents of the file.

Best  
W.

---

<div class="post-metadata">

**Author:** ![moh\_g](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/moh_g/32/836_2.png) [@moh\_g](https://community.geodynamics.org/u/moh_g)\
**Post date:** [July 19, 2021, 7:50pm UTC](https://community.geodynamics.org/t/particles-with-free-surface/1908/13 "2021-07-19T19:50:09Z")

</div>

That worked Thanks Wolfgang.

Moh
