Skip to content

Commit 1432612

Browse files
committed
Document preconditions
1 parent 4e1515a commit 1432612

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

source/pbat/fem/HyperElasticPotential.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ struct HyperElasticPotential
7070
* @param GNeg Shape function gradients at quadrature points. See ShapeFunctionGradients().
7171
* @param Y Young's modulus
7272
* @param nu Poisson's ratio
73+
* @pre `eg.size() == wg.size()` and `GNeg.rows() == mesh.E.rows()`
74+
* @pre `Y.size() == wg.size()` and `nu.size() == wg.size()`
7375
*/
7476
HyperElasticPotential(
7577
MeshType const& mesh,
@@ -89,6 +91,8 @@ struct HyperElasticPotential
8991
* @param GNeg Shape function gradients at quadrature points. See ShapeFunctionGradients().
9092
* @param Y \f$ |Q| \f$ Young's moduli
9193
* @param nu \f$ |Q| \f$ Poisson's ratios
94+
* @pre `eg.size() == wg.size()` and `GNeg.rows() == mesh.E.rows()`
95+
* @pre `Y.size() == wg.size()` and `nu.size() == wg.size()`
9296
*/
9397
template <class TDerivedY, class TDerivednu>
9498
HyperElasticPotential(
@@ -111,6 +115,9 @@ struct HyperElasticPotential
111115
* @param x \f$ d \times n \f$ matrix of deformed nodal positions
112116
* @param Y Young's modulus
113117
* @param nu Poisson's ratio
118+
* @pre `eg.size() == wg.size()` and `GNeg.rows() == mesh.E.rows()`
119+
* @pre `x.rows() == mesh.X.rows() * mesh.kDims`
120+
* @pre `Y.size() == wg.size()` and `nu.size() == wg.size()`
114121
*/
115122
template <class TDerived>
116123
HyperElasticPotential(
@@ -136,6 +143,9 @@ struct HyperElasticPotential
136143
* @param x \f$ d \times n \f$ matrix of deformed nodal positions
137144
* @param Y \f$ |Q| \f$ Young's moduli
138145
* @param nu \f$ |Q| \f$ Poisson's ratios
146+
* @pre `eg.size() == wg.size()` and `GNeg.rows() == mesh.E.rows()`
147+
* @pre `x.rows() == mesh.X.rows() * mesh.kDims`
148+
* @pre `Y.size() == wg.size()` and `nu.size() == wg.size()`
139149
*/
140150
template <class TDerivedx, class TDerivedY, class TDerivednu>
141151
HyperElasticPotential(
@@ -161,6 +171,7 @@ struct HyperElasticPotential
161171
* @param bWithHessian Compute hessian
162172
* @param bUseSpdProjection Project per quadrature point hessians to nearest symmetric positive
163173
* definite (SPD) matrix
174+
* @pre `x.rows() == mesh.X.rows() * mesh.kDims`
164175
*/
165176
template <class TDerived>
166177
void ComputeElementElasticity(
@@ -177,6 +188,7 @@ struct HyperElasticPotential
177188
* @tparam TDerivedOut Output matrix type
178189
* @param x Input matrix
179190
* @param y Output matrix
191+
* @pre x.rows() == InputDimensions() and y.rows() == InputDimensions() and y.cols() == x.cols()
180192
*/
181193
template <class TDerivedIn, class TDerivedOut>
182194
void Apply(Eigen::MatrixBase<TDerivedIn> const& x, Eigen::DenseBase<TDerivedOut>& y) const;

0 commit comments

Comments
 (0)