-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSacado_Wrapper - good ol wrapper.h
598 lines (479 loc) · 19.8 KB
/
Sacado_Wrapper - good ol wrapper.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
namespace Sacado_Wrapper
{
template <int dim>
class SymTensor: public SymmetricTensor<2,dim, fad_double>
{
public:
SymTensor( )
{
get_index_map<dim>( std_map_indicies );
}
// To simplify the access to the dofs we define a map that relate the components of our strain tensor to the dof-nbr
std::map<unsigned int,std::pair<unsigned int,unsigned int>> std_map_indicies;
unsigned int start_index = 0;
static const unsigned int n_dofs = ((dim==2)?3:6); // ToDo: Find a way to use eps.n_independent_components(); that gives ((dim==2)?3:6) for a SymmetricTensor
void init ( SymmetricTensor<2,dim> &tensor_double );
void set_dofs( unsigned int nbr_total_dofs=n_dofs );
void get_tangent (SymmetricTensor<4,dim> &Tangent, SymmetricTensor<2,dim,fad_double> &sigma);
SymmetricTensor<4,dim> get_tangent( SymmetricTensor<2,dim,fad_double> &sigma );
void get_tangent( SymmetricTensor<2,dim> &Tangent, fad_double &argument );
SymmetricTensor<2,dim> get_tangent( fad_double &argument );
void get_values ( SymmetricTensor<2,dim> &tensor_double );
SymmetricTensor<2,dim> get_value ();
SymmetricTensor<2,dim> val ( );
};
/*
* Initialization of the SymTensor data type with the values from a normal double SymmetricTensor
*/
template<int dim>
void SymTensor<dim>::init( SymmetricTensor<2,dim> &tensor_double )
{
for ( unsigned int i=0; i<dim; ++i)
for ( unsigned int j=0; j<dim; ++j )
(*this)[i][j] = tensor_double[i][j];
}
/*
* Set the dofs as the components of the SymTensor data type
*/
template<int dim>
void SymTensor<dim>::set_dofs( unsigned int nbr_total_dofs )
{
// Instead of calling the *.diff(*) on the components one-by-one we could also use the following for-loop, so
// we also use the map to set the dofs
for ( unsigned int x=start_index; x<(start_index+n_dofs); ++x )
{
unsigned int i=std_map_indicies[x].first;
unsigned int j=std_map_indicies[x].second;
(*this)[i][j].diff(x,nbr_total_dofs);
}
}
/*
* Assemble the tangent based on the derivatives saved in the argument sigma
* @param Tangent The desired tangent that will be computed as d_sigma/d_this, where "this" could be your strain tensor
* @param sigma The input argument used to extract the derivatives
*/
template<int dim>
void SymTensor<dim>::get_tangent( SymmetricTensor<4,dim> &Tangent, SymmetricTensor<2,dim,fad_double> &sigma )
{
for ( unsigned int i=0; i<dim; ++i)
for ( unsigned int j=0; j<dim; ++j )
{
double *derivs = &sigma[i][j].fastAccessDx(0); // Access the derivatives of the (i,j)-th component of \a sigma
// We loop over all the dofs. To be able to use this independent of the chosen dimension \a dim, we use a ternary operator
// to decide whether we have to loop over 6 derivatives or just 3.
for(unsigned int x=start_index;x<(start_index+n_dofs);++x)
{
unsigned int k=std_map_indicies[x].first;
unsigned int l=std_map_indicies[x].second;
if(k!=l)/*Compare to Voigt notation since only SymmetricTensor instead of Tensor*/
{
Tangent[i][j][k][l] = 0.5*derivs[x];
Tangent[i][j][l][k] = 0.5*derivs[x];
}
else
Tangent[i][j][k][l] = derivs[x];
}
}
}
template<int dim>
SymmetricTensor<4,dim> SymTensor<dim>::get_tangent( SymmetricTensor<2,dim,fad_double> &sigma )
{
SymmetricTensor<4,dim> Tangent;
this->get_tangent(Tangent, sigma);
return Tangent;
}
template<int dim>
void SymTensor<dim>::get_tangent( SymmetricTensor<2,dim> &Tangent, fad_double &argument )
{
double *derivs = &argument.fastAccessDx(0); // Access derivatives
for(unsigned int x=start_index;x<(start_index+n_dofs);++x)
{
unsigned int k=std_map_indicies[x].first;
unsigned int l=std_map_indicies[x].second;
Tangent[k][l] = derivs[x]; // ToDo: check whether the 0.5* is necessary here too
// Correct the off-diagonal terms by the factor of 0.5
if(k!=l)/*Compare to Voigt notation since only SymmetricTensor instead of Tensor*/
Tangent[k][l] *= 0.5; // ToDo: check whether the 0.5* is necessary here too
}
}
// @todo these return types don't work, Why?
template<int dim>
SymmetricTensor<2,dim> SymTensor<dim>::get_tangent( fad_double &argument )
{
SymmetricTensor<2,dim> Tangent;
this->get_tangent(Tangent, argument);
return Tangent;
}
template<int dim>
void SymTensor<dim>::get_values ( SymmetricTensor<2,dim> &tensor_double )
{
for ( unsigned int i=0; i<dim; ++i)
for ( unsigned int j=0; j<dim; ++j )
tensor_double[i][j] = ((*this)[i][j]).val();
}
template<int dim>
SymmetricTensor<2,dim> SymTensor<dim>::get_value ()
{
SymmetricTensor<2,dim> tmp;
(*this).get_values(tmp);
return tmp;
}
template<int dim>
SymmetricTensor<2,dim> SymTensor<dim>::val()
{
SymmetricTensor<2,dim> tmp;
(*this).get_values(tmp);
return tmp;
}
//###########################################################################################################//
template <int dim>
class SymTensor2: public SymmetricTensor<2,dim, Sacado::Fad::DFad<DFadType> >
{
public:
SymTensor2( )
{
get_index_map<dim>( std_map_indicies );
}
// To simplify the access to the dofs we define a map that relate the components of our strain tensor to the dof-nbr
std::map<unsigned int,std::pair<unsigned int,unsigned int>> std_map_indicies;
unsigned int start_index = 0;
static const unsigned int n_dofs = ((dim==2)?3:6); // ToDo: Find a way to use eps.n_independent_components(); that gives ((dim==2)?3:6) for a SymmetricTensor
void init_set_dofs ( SymmetricTensor<2,dim> &tensor_double, const unsigned int nbr_total_dofs=n_dofs );
void get_tangent (SymmetricTensor<4,dim> &Tangent, SymmetricTensor<2,dim, Sacado::Fad::DFad<DFadType> > &sigma);
void get_tangent( SymmetricTensor<2,dim> &Tangent, Sacado::Fad::DFad<DFadType> &argument );
void get_tangent( SymmetricTensor<2,dim, Sacado::Fad::DFad<DFadType> > &Tangent, Sacado::Fad::DFad<DFadType> &argument );
void get_curvature( SymmetricTensor<4,dim> &Curvature, Sacado::Fad::DFad<DFadType> &argument );
//
// void get_values ( SymmetricTensor<2,dim> &tensor_double );
};
/*
* Initialization of the \a SymTensor2 data type with the values from a normal double \a SymmetricTensor
*/
template<int dim>
void SymTensor2<dim>::init_set_dofs( SymmetricTensor<2,dim> &tensor_double, const unsigned int nbr_total_dofs )
{
for ( unsigned int x=0; x<n_dofs; ++x )
{
unsigned int i=std_map_indicies[x].first;
unsigned int j=std_map_indicies[x].second;
((*this)[i][j]).diff( x, nbr_total_dofs); // set up the "inner" derivatives
((*this)[i][j]).val() = fad_double(nbr_total_dofs, x, tensor_double[i][j]); // set up the "outer" derivatives
}
}
template<int dim>
void SymTensor2<dim>::get_tangent( SymmetricTensor<2,dim> &Tangent, Sacado::Fad::DFad<DFadType> &argument )
{
for ( unsigned int x=0; x<n_dofs; ++x )
{
unsigned int i=std_map_indicies[x].first;
unsigned int j=std_map_indicies[x].second;
if ( i!=j )
Tangent[i][j] = 0.5 * argument.dx(x).val();
else
Tangent[i][j] = argument.dx(x).val();
}
}
template<int dim>
void SymTensor2<dim>::get_tangent( SymmetricTensor<4,dim> &Tangent, SymmetricTensor<2,dim, Sacado::Fad::DFad<DFadType> > &argument )
{
for(unsigned int x=0;x<n_dofs;++x)
for(unsigned int y=0;y<n_dofs;++y)
{
const unsigned int i=std_map_indicies[y].first;
const unsigned int j=std_map_indicies[y].second;
const unsigned int k=std_map_indicies[x].first;
const unsigned int l=std_map_indicies[x].second;
if(k!=l)/*Compare to Voigt notation since only SymmetricTensor instead of Tensor*/
Tangent[i][j][k][l] = 0.5 * argument[k][l].dx(y).val(); // ToDo: check this on paper (was more like a gut feeling)
else
Tangent[i][j][k][l] = argument[k][l].dx(y).val();
}
}
/*
* Compute the tangent still containing all the second derivatives
*/
template<int dim>
void SymTensor2<dim>::get_tangent( SymmetricTensor<2,dim, Sacado::Fad::DFad<DFadType> > &Tangent, Sacado::Fad::DFad<DFadType> &argument )
{
for ( unsigned int x=0; x<n_dofs; ++x )
{
unsigned int i=std_map_indicies[x].first;
unsigned int j=std_map_indicies[x].second;
if ( i!=j )
Tangent[i][j] = 0.5 * argument.dx(x);
else
Tangent[i][j] = argument.dx(x);
}
}
template<int dim>
void SymTensor2<dim>::get_curvature( SymmetricTensor<4,dim> &Curvature, Sacado::Fad::DFad<DFadType> &argument )
{
for(unsigned int x=0;x<n_dofs;++x)
for(unsigned int y=0;y<n_dofs;++y)
{
const unsigned int i=std_map_indicies[y].first;
const unsigned int j=std_map_indicies[y].second;
const unsigned int k=std_map_indicies[x].first;
const unsigned int l=std_map_indicies[x].second;
double deriv = argument.dx(x).dx(y); // Access the derivatives of the (i,j)-th component of \a sigma
if ( k!=l && i!=j )
Curvature[i][j][k][l] = 0.25* deriv;
else if(k!=l)/*Compare to Voigt notation since only SymmetricTensor instead of Tensor*/
{
Curvature[i][j][k][l] = 0.5*deriv;
Curvature[i][j][l][k] = 0.5*deriv;
}
else
Curvature[i][j][k][l] = deriv;
}
}
//###########################################################################################################//
/*
* The same as the class above, just for data type fad_double
*/
template<int dim>
class SW_double: public fad_double
{
public:
// SW_double( double &sdf );
// :
// (*this)(sdf)
// {
// }
// Assignment operator: \n
// According to https://stackoverflow.com/questions/31029007/c-assignment-operator-in-derived-class
// the operator= is not derived from the base class fad_double and needs to be set explicitly:
SW_double & operator=(double double_init) { fad_double::operator =( double_init ) ;return *this;}
SW_double & operator=(fad_double fad_assignment) { fad_double::operator =( fad_assignment ) ;return *this;}
static const unsigned int n_dofs = 1; // a double is just a single number, so it represents a single dof
unsigned int start_index = 0;
void init ( const double &double_init );
void set_dofs ( unsigned int nbr_total_dofs=n_dofs );
void reset_its_deriv ( );
void reset_other_deriv ( const SW_double<dim> &other_SW_double );
void set_deriv ( const SW_double<dim> &other_SW_double, const double deriv_value );
void get_tangent (SymmetricTensor<2,dim> &Tangent, SymmetricTensor<2,dim, fad_double> &sigma);
SymmetricTensor<2,dim> get_tangent (SymmetricTensor<2,dim, fad_double> &sigma);
void get_tangent ( double &Tangent, fad_double &argument );
void get_values ( double &return_double );
};
template<int dim>
void SW_double<dim>::init ( const double &double_init )
{
(*this) = double_init;
}
template<int dim>
void SW_double<dim>::set_dofs ( unsigned int nbr_total_dofs )
{
(*this).diff( this->start_index, nbr_total_dofs );
}
template<int dim>
void SW_double<dim>::reset_its_deriv ( )
{
double *derivs = &(this)->fastAccessDx(0);
derivs[this->start_index] = 1.;
}
template<int dim>
void SW_double<dim>::reset_other_deriv ( const SW_double<dim> &other_SW_double )
{
double *derivs = &(this)->fastAccessDx(0);
derivs[other_SW_double.start_index] = 0.;
}
template<int dim>
void SW_double<dim>::set_deriv ( const SW_double<dim> &other_SW_double, const double deriv_value )
{
double *derivs = &(this)->fastAccessDx(0);
derivs[this->start_index] = deriv_value;
}
template<int dim>
void SW_double<dim>::get_tangent (SymmetricTensor<2,dim> &Tangent, SymmetricTensor<2,dim, fad_double> &sigma)
{
// reassemble the tangent as a SECOND order tensor
for ( unsigned int i=0; i<dim; ++i)
for ( unsigned int j=0; j<dim; ++j )
{
double *derivs = &sigma[i][j].fastAccessDx(0); // Access derivatives
Tangent[i][j] = derivs[ this->start_index ]; // ToDo: check whether the 0.5* is necessary here too
}
}
template<int dim>
SymmetricTensor<2,dim> SW_double<dim>::get_tangent (SymmetricTensor<2,dim, fad_double> &sigma)
{
SymmetricTensor<2,dim> Tangent;
this->get_tangent(Tangent, sigma);
return Tangent;
}
template<int dim>
void SW_double<dim>::get_tangent ( double &Tangent, fad_double &argument )
{
double *derivs = &argument.fastAccessDx(0);
Tangent = derivs[ this->start_index ];
}
template<int dim>
void SW_double<dim>::get_values ( double &return_double )
{
return_double = (*this).val();
}
//###########################################################################################################//
/*
* The same as the class above, just for data type fad_double
*/
template<int dim>
class SW_double2: public Sacado::Fad::DFad<DFadType>
{
public:
// SW_double2( double &sdf );
// :
// (*this)(sdf)
// {
// }
// Assignment operator: \n
// According to https://stackoverflow.com/questions/31029007/c-assignment-operator-in-derived-class
// the operator= is not derived from the base class fad_double and needs to be set explicitly:
SW_double2 & operator=(double double_init) { Sacado::Fad::DFad<DFadType>::operator =( double_init ) ;return *this;}
SW_double2 & operator=(Sacado::Fad::DFad<DFadType> fad_assignment) { Sacado::Fad::DFad<DFadType>::operator =( fad_assignment ) ;return *this;}
static const unsigned int n_dofs = 1; // a double is just a single number, so it represents a single dof
unsigned int start_index = 0;
void init_set_dofs ( const double &double_init, unsigned int nbr_total_dofs=n_dofs );
void get_tangent (double &Tangent, Sacado::Fad::DFad<DFadType> &argument);
void get_tangent (SymmetricTensor<2,dim> &Tangent, SymmetricTensor<2,dim, Sacado::Fad::DFad<DFadType> > &argument, SymTensor2<dim> &eps);
void get_curvature (double &Curvature, Sacado::Fad::DFad<DFadType> &argument);
void get_curvature (SymmetricTensor<2,dim> &Curvature, SymmetricTensor<2,dim, Sacado::Fad::DFad<DFadType> > &argument, SymTensor2<dim> &eps );
void get_curvature (SymmetricTensor<2,dim> &Curvature, Sacado::Fad::DFad<DFadType> &argument, SymTensor2<dim> &eps );
// void get_values ( double &return_double );
};
template<int dim>
void SW_double2<dim>::init_set_dofs ( const double &double_init, unsigned int nbr_total_dofs )
{
(*this).diff( start_index , nbr_total_dofs );
(*this).val() = fad_double(nbr_total_dofs, start_index, double_init);
}
template<int dim>
void SW_double2<dim>::get_tangent (double &Tangent, Sacado::Fad::DFad<DFadType> &argument)
{
Tangent = argument.dx(this->start_index).val();
}
template<int dim>
void SW_double2<dim>::get_tangent (SymmetricTensor<2,dim> &Tangent, SymmetricTensor<2,dim, Sacado::Fad::DFad<DFadType> > &argument, SymTensor2<dim> &eps)
{
for(unsigned int x=0;x<eps.n_dofs;++x)
{
const unsigned int i=eps.std_map_indicies[x].first;
const unsigned int j=eps.std_map_indicies[x].second;
// ToDo: find a better way to loop over the indices than using eps as input argument
Tangent[i][j] = argument[i][j].dx(start_index).val();
}
}
template<int dim>
void SW_double2<dim>::get_curvature (double &Curvature, Sacado::Fad::DFad<DFadType> &argument)
{
Curvature = argument.dx(this->start_index).dx(this->start_index);
}
/*
* Compute Curvature d_argument / d_phi, where argument is already the derivative with respect to d_eps
*/
template<int dim>
void SW_double2<dim>::get_curvature (SymmetricTensor<2,dim> &Curvature, SymmetricTensor<2,dim, Sacado::Fad::DFad<DFadType> > &argument, SymTensor2<dim> &eps )
{
for(unsigned int x=0;x<eps.n_dofs;++x)
{
const unsigned int i=eps.std_map_indicies[x].first;
const unsigned int j=eps.std_map_indicies[x].second;
// if ( i!=j )
// Curvature[i][j] = 0.5 * argument[i][j].val().dx(start_index); // ToDo: check the factor 0.5
// else
Curvature[i][j] = argument[i][j].val().dx(start_index);
}
}
/*
* Compute Curvature d2_argument / d_phi_d_eps
*/
template<int dim>
void SW_double2<dim>::get_curvature (SymmetricTensor<2,dim> &Curvature, Sacado::Fad::DFad<DFadType> &argument, SymTensor2<dim> &eps )
{
for(unsigned int x=0;x<eps.n_dofs;++x)
{
const unsigned int i=eps.std_map_indicies[x].first;
const unsigned int j=eps.std_map_indicies[x].second;
if ( i!=j )
Curvature[i][j] = 0.5 * argument.dx(start_index).dx(x); // ToDo: check the factor 0.5
else
Curvature[i][j] = argument.dx(start_index).dx(x);
}
}
//###########################################################################################################//
template<int dim>
class DoFs_summary
{
public:
void set_dofs( SymTensor<dim> &eps, SW_double<dim> &double_arg );
void init_set_dofs( SymTensor2<dim> &eps, SymmetricTensor<2,dim> &eps_init, SW_double2<dim> &double_arg, double &double_init );
void get_curvature( SymmetricTensor<2,dim> &Curvature, Sacado::Fad::DFad<DFadType> &argument, SymTensor2<dim> &eps, SW_double2<dim> &double_arg );
void get_curvature( SymmetricTensor<2,dim> &Curvature, Sacado::Fad::DFad<DFadType> &argument, SW_double2<dim> &double_arg, SymTensor2<dim> &eps );
void set_dofs( SymTensor<dim> &eps, SW_double<dim> &double_arg1, SW_double<dim> &double_arg2, SW_double<dim> &double_arg3 );
// e.g. for strain, gamma_p and gamma_d
void set_dofs( SymTensor<dim> &eps, SW_double<dim> &double_arg1, SW_double<dim> &double_arg2 );
};
template<int dim>
void DoFs_summary<dim>::set_dofs(SymTensor<dim> &eps, SW_double<dim> &double_arg)
{
const unsigned int nbr_total_dofs = eps.n_dofs + double_arg.n_dofs;
eps.start_index = 0;
double_arg.start_index = eps.n_dofs;
eps.set_dofs( nbr_total_dofs );
double_arg.set_dofs( nbr_total_dofs );
}
template<int dim>
void DoFs_summary<dim>::init_set_dofs(SymTensor2<dim> &eps, SymmetricTensor<2,dim> &eps_init, SW_double2<dim> &double_arg, double &double_init )
{
const unsigned int nbr_total_dofs = eps.n_dofs + double_arg.n_dofs;
eps.start_index = 0;
double_arg.start_index = eps.n_dofs;
eps.init_set_dofs( eps_init, nbr_total_dofs);
double_arg.init_set_dofs( double_init, nbr_total_dofs );
}
template<int dim>
void DoFs_summary<dim>::set_dofs(SymTensor<dim> &eps, SW_double<dim> &double_arg1, SW_double<dim> &double_arg2, SW_double<dim> &double_arg3 )
{
const unsigned int nbr_total_dofs = eps.n_dofs + double_arg1.n_dofs + double_arg2.n_dofs + double_arg3.n_dofs ;
eps.start_index = 0;
double_arg1.start_index = eps.n_dofs;
double_arg2.start_index = eps.n_dofs + double_arg1.n_dofs;
double_arg3.start_index = eps.n_dofs + double_arg1.n_dofs + double_arg2.n_dofs;
eps.set_dofs( nbr_total_dofs );
double_arg1.set_dofs( nbr_total_dofs );
double_arg2.set_dofs( nbr_total_dofs );
double_arg3.set_dofs( nbr_total_dofs );
}
template<int dim>
void DoFs_summary<dim>::set_dofs(SymTensor<dim> &eps, SW_double<dim> &double_arg1, SW_double<dim> &double_arg2 )
{
const unsigned int nbr_total_dofs = eps.n_dofs + double_arg1.n_dofs + double_arg2.n_dofs ;
eps.start_index = 0;
double_arg1.start_index = eps.n_dofs;
double_arg2.start_index = eps.n_dofs + double_arg1.n_dofs;
eps.set_dofs( nbr_total_dofs );
double_arg1.set_dofs( nbr_total_dofs );
double_arg2.set_dofs( nbr_total_dofs );
}
/*
*
* example call: DoFs_summary.get_curvature(d2_energy_d_eps_d_phi, energy, eps_fad, phi_fad)
*/
template<int dim>
void DoFs_summary<dim>::get_curvature( SymmetricTensor<2,dim> &Curvature, Sacado::Fad::DFad<DFadType> &argument, SymTensor2<dim> &eps, SW_double2<dim> &double_arg )
{
SymmetricTensor<2,dim, Sacado::Fad::DFad<DFadType> > d_arg_d_eps;
eps.get_tangent(d_arg_d_eps, argument);
double_arg.get_curvature(Curvature, d_arg_d_eps, eps);
}
/*
*
* example call: DoFs_summary.get_curvature(d2_energy_d_phi_d_eps, energy, phi_fad, eps_fad)
*/
template<int dim>
void DoFs_summary<dim>::get_curvature( SymmetricTensor<2,dim> &Curvature, Sacado::Fad::DFad<DFadType> &argument, SW_double2<dim> &double_arg, SymTensor2<dim> &eps )
{
double_arg.get_curvature(Curvature, argument, eps);
}
}