KratosMultiphysics / Kratos

Kratos Multiphysics (A.K.A Kratos) is a framework for building parallel multi-disciplinary simulation software. Modularity, extensibility and HPC are the main objectives. Kratos has BSD license and is written in C++ with extensive Python interface.

Home Page:https://kratosmultiphysics.github.io/Kratos/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[GeoMechanicsApplication] Make `UPwBaseElement` a non-template class

markelov208 opened this issue · comments

Background

At present, in the element hierarchy of GeoMechanicsApplication there are two branches of U-Pw elements: one for non-diff order elements (starting from UPwBaseElement) and the other one for diff order elements (starting from SmallStrainUPwDiffOrderElement). The problem with this design is that code is duplicated, since the common ancestor class is Element, which doesn't provide any geomechanics-specific functionality. When we would make SmallStrainUPwDiffOrderElement a subclass of UPwBaseElement, the relationships start to make more sense and also we can get rid of some code duplication. A practical issue here is that UPwBaseElement is a class template, whereas SmallStrainUPwDiffOrderElement isn't.

Acceptance Criteria

Class UPwBaseElement is no longer a class template. In other words, its template parameters TDim and TNumNodes must have been eliminated.

Implementation Details

In order to achieve what has been described above, the following action points have to be carried out:

  • Remove the template parameters TDim and TNumNodes from the member function signatures.
  • Where TDim is being referenced, use the value returned by this->GetGeometry().WorkingSpaceDimension(). Note that also constexpr will need to be removed (when present), since this value can no longer be evaluated at compile time.
  • Where TNumNodes is being referenced, use the value returned by this->GetGeometry().PointsNumber().
  • Function template GeoElementUtilities::GetNodalVariableMatrix needs to be modified such that it also no longer has any template parameters. Since we pass the element's geometry as an argument to this function, we can obtain the element's dimension as well as the number of nodes as described above for TDim and TNumNodes, respectively.
  • Remove the explicit class instantiations from the implementation file.