Skip to content

[GeoMechanicsApplication] Add a class that represents a (p, q) vectorΒ #14195

@avdg81

Description

@avdg81

As a developer, I would like to have a class that represents a ($p$, $q$) vector. This class will be very similar to the class that represents a ($\sigma$, $\tau$) vector.

Class design

  • The class will store the values of $p$ and $q$ in a fixed-size array mValues (with a size of 2).
  • The class will have member functions P and Q that return references to the corresponding elements of the array. This will make it easier to read expressions that operate on the component level.
  • The class will be default-constructible, which will yield an instance with $p = 0$ and $q = 0$.
  • The class can also be instantiated with any vector of size 2. In addition, a constructor will be provided that receives a std::initializer_list<double> (which must have a size of 2). Attempting to instantiate this class with a vector or initializer list with an incorrect size results in throwing an exception.
  • The class will have a template member function CopyTo that copies the internal array to a container of the specified type. This will help to pass the values of $p$ and $q$ to functions that expect a vector type, e.g. Vector.

Needless to say, all the above mentioned functionality should be covered by unit tests.

Metadata

Metadata

Assignees

Labels

GeoMechanicsIssues related to the GeoMechanicsApplication

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions