[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
andTNumNodes
from the member function signatures. - Where
TDim
is being referenced, use the value returned bythis->GetGeometry().WorkingSpaceDimension()
. Note that alsoconstexpr
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 bythis->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 forTDim
andTNumNodes
, respectively. - Remove the explicit class instantiations from the implementation file.