geodynamics / aspect

A parallel, extensible finite element code to simulate convection in both 2D and 3D models.
https://aspect.geodynamics.org/
Other
223 stars 235 forks source link

allow different base_elements for compositional fields #5802

Closed tjhei closed 3 months ago

tjhei commented 4 months ago

We now store different base_element indices in introspection (one index for each compositional field). This is no functional change, as we do not support different FiniteElements so far.

To be able to make this change, I had to fix various places that use base_elements or assume that all compositional fields have the same base element.

part of #5748

tjhei commented 4 months ago

This one if for you @bangerth . :-)

bangerth commented 4 months ago

There are numerous errors such as these:

In file included from /Users/jenkins/jenkins/workspace/aspect-osx_PR-5802/build/CMakeFiles/aspect-release.dir/Unity/unity_40_cxx.cxx:16:
/Users/jenkins/jenkins/workspace/aspect-osx_PR-5802/source/simulator/helper_functions.cc:1690:74: error: no viable conversion from 'const std::vector<unsigned int>' to 'unsigned int'
    const Quadrature<dim> quadrature_C(dof_handler.get_fe().base_element(introspection.base_elements.compositional_fields).get_unit_support_points());
                                                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/jenkins/jenkins/workspace/aspect-osx_PR-5802/source/simulator/helper_functions.cc:2578:22: note: in instantiation of member function 'aspect::Simulator<2>::compute_reactions' requested here
  ASPECT_INSTANTIATE(INSTANTIATE)
                     ^
/Users/jenkins/candi-9.5.1-r1b/deal.II-v9.5.1/include/deal.II/fe/fe.h:1622:35: note: passing argument to parameter 'index' here
  base_element(const unsigned int index) const;
                                  ^
In file included from /Users/jenkins/jenkins/workspace/aspect-osx_PR-5802/build/CMakeFiles/aspect-release.dir/Unity/unity_40_cxx.cxx:16:
/Users/jenkins/jenkins/workspace/aspect-osx_PR-5802/source/simulator/helper_functions.cc:1785:74: error: no viable conversion from 'const std::vector<unsigned int>' to 'unsigned int'
              for (unsigned int j=0; j<dof_handler.get_fe().base_element(introspection.base_elements.compositional_fields).dofs_per_cell; ++j)
                                                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/jenkins/candi-9.5.1-r1b/deal.II-v9.5.1/include/deal.II/fe/fe.h:1622:35: note: passing argument to parameter 'index' here
  base_element(const unsigned int index) const;
                                  ^
In file included from /Users/jenkins/jenkins/workspace/aspect-osx_PR-5802/build/CMakeFiles/aspect-release.dir/Unity/unity_40_cxx.cxx:16:
/Users/jenkins/jenkins/workspace/aspect-osx_PR-5802/source/simulator/helper_functions.cc:1826:70: error: no viable conversion from 'const std::vector<unsigned int>' to 'unsigned int'
          for (unsigned int j=0; j<dof_handler.get_fe().base_element(introspection.base_elements.compositional_fields).dofs_per_cell; ++j)
                                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I would assume that you get those on your machine too?

tjhei commented 4 months ago

Updated and rebased.

tjhei commented 4 months ago

Updated. Thank you for the comments! :+1:

tjhei commented 3 months ago

Fingers crossed, this might be good to go now.

tjhei commented 3 months ago

The two tests are changing very slightly due to the reordering of the loops in the composition mesh refinement plugin.

tjhei commented 3 months ago

updated.