File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 1
1
#include " Data.h"
2
2
3
+ #include " pbat/physics/HyperElasticity.h"
4
+
3
5
#include < algorithm>
4
6
#include < exception>
5
7
#include < fmt/format.h>
@@ -131,13 +133,33 @@ Data& Data::Construct(bool bValidate)
131
133
{
132
134
// clang-format off
133
135
if (xt.size () == 0 )
136
+ {
134
137
xt = x;
138
+ }
135
139
if (v.size () == 0 )
140
+ {
136
141
v.setZero (x.rows (), x.cols ());
142
+ }
143
+ if (m.size () == 0 )
144
+ {
145
+ m.setConstant (x.cols (), Scalar (1e3 ));
146
+ }
147
+ if (aext.size () == 0 )
148
+ {
149
+ aext.resizeLike (x);
150
+ aext.colwise () = Vector<3 >{Scalar (0 ), Scalar (0 ), Scalar (-9.81 )};
151
+ }
137
152
xtilde.resizeLike (x);
138
153
xchebm2.resizeLike (x);
139
154
xchebm1.resizeLike (x);
140
155
vt.resizeLike (x);
156
+ if (lame.size () == 0 )
157
+ {
158
+ auto const [mu, lambda] = physics::LameCoefficients (Scalar (1e6 ), Scalar (0.45 ));
159
+ lame.resize (2 , T.cols ());
160
+ lame.row (0 ).setConstant (mu);
161
+ lame.row (1 ).setConstant (lambda);
162
+ }
141
163
if (bValidate)
142
164
{
143
165
bool const bPerVertexQuantityDimensionsValid =
You can’t perform that action at this time.
0 commit comments