@@ -157,7 +157,7 @@ function JacobianReturnMapping(γα, Ce, Se, Se_trial, ∂Se∂Ce, F, λα)
157157 ∂res1_∂λα = - (1 - γα) * Ge
158158 ∂res2_∂Ce = Ge
159159 res = [get_array (res1)[:]; res2]
160- ∂res = MMatrix {10,10} (zeros (10 , 10 ))
160+ ∂res = MMatrix {10,10} (zeros (10 , 10 )) # TODO : It'd be nice to use hvcat: ∂res = [∂res1_Ce ∂res1_∂λα; ∂res2_∂Ce 0.0]
161161 ∂res[1 : 9 , 1 : 9 ] = get_array (∂res1_∂Ce)
162162 ∂res[1 : 9 , 10 ] = get_array (∂res1_∂λα)[:]
163163 ∂res[10 , 1 : 9 ] = (get_array (∂res2_∂Ce)[:])'
309309
310310function Energy (obj:: ViscousIncompressible , Δt:: Float64 ,
311311 Ψe:: Function , Se_:: Function , ∂Se∂Ce_:: Function ,
312- F:: TensorValue , Fn:: TensorValue , stateVars:: VectorValue )
313- state_vars = get_array (stateVars)
314- Uvn = TensorValue {3,3} (Tuple (state_vars[1 : 9 ])) # TODO : Update tensor slicing until next Gridap version has been released
315- λαn = state_vars[10 ]
312+ F:: TensorValue , Fn:: TensorValue , A:: VectorValue )
313+ Uvn = TensorValue {3,3} (A[1 : 9 ]. .. )
314+ λαn = A[10 ]
316315 # ------------------------------------------
317316 # Get kinematics
318317 # ------------------------------------------
@@ -343,17 +342,16 @@ end
343342- `∂Se∂Ce_`: 2nd Piola Derivatives (function of C)
344343- `F`: Current deformation gradient
345344- `Fn`: Previous deformation gradient
346- - `stateVars `: State variables (Uvα and λα)
345+ - `A `: State variables (Uvα and λα)
347346
348347# Return
349348- `Pα::Gridap.TensorValues.TensorValue`
350349"""
351350function Piola (obj:: ViscousIncompressible , Δt:: Float64 ,
352351 Se_:: Function , ∂Se∂Ce_:: Function ,
353- F:: TensorValue , Fn:: TensorValue , stateVars:: VectorValue )
354- state_vars = get_array (stateVars)
355- Uvn = TensorValue {3,3} (Tuple (state_vars[1 : 9 ])) # TODO : Update tensor slicing until next Gridap version has been released
356- λαn = state_vars[10 ]
352+ F:: TensorValue , Fn:: TensorValue , A:: VectorValue )
353+ Uvn = TensorValue {3,3} (A[1 : 9 ]. .. )
354+ λαn = A[10 ]
357355 # ------------------------------------------
358356 # Get kinematics
359357 # ------------------------------------------
@@ -386,17 +384,16 @@ Visco-Elastic model for incompressible case
386384- `∂Se∂Ce_`: 2nd Piola Derivatives (function of C)
387385- `∇u_`: Current deformation gradient
388386- `∇un_`: Previous deformation gradient
389- - `stateVars `: State variables (Uvα and λα)
387+ - `A `: State variables (Uvα and λα)
390388
391389# Return
392390- `Cα::Gridap.TensorValues.TensorValue`
393391"""
394392function Tangent (obj:: ViscousIncompressible , Δt:: Float64 ,
395393 Se_:: Function , ∂Se∂Ce_:: Function ,
396- F:: TensorValue , Fn:: TensorValue , stateVars:: VectorValue )
397- state_vars = get_array (stateVars)
398- Uvn = TensorValue {3,3} (Tuple (state_vars[1 : 9 ])) # TODO : Update tensor slicing until next Gridap version has been released
399- λαn = state_vars[10 ]
394+ F:: TensorValue , Fn:: TensorValue , A:: VectorValue )
395+ Uvn = TensorValue {3,3} (A[1 : 9 ]. .. )
396+ λαn = A[10 ]
400397 # ------------------------------------------
401398 # Get kinematics
402399 # ------------------------------------------
@@ -432,18 +429,17 @@ end
432429 - `∂Se∂Ce_::Function`: Piola Derivatives (function of C)
433430 - `∇u_::TensorValue`
434431 - `∇un_::TensorValue`
435- - `stateVars ::VectorValue`: State variables (10-component vector gathering Uvα and λα)
432+ - `A ::VectorValue`: State variables (10-component vector gathering Uvα and λα)
436433
437434 # Return
438435 - `::bool`: indicates whether the state variables should be updated
439436 - `::VectorValue`: State variables at new time
440437"""
441438function ReturnMapping (obj:: ViscousIncompressible , Δt:: Float64 ,
442439 Se_:: Function , ∂Se∂Ce_:: Function ,
443- F:: TensorValue , Fn:: TensorValue , stateVars:: VectorValue )
444- state_vars = get_array (stateVars)
445- Uvn = TensorValue {3,3} (Tuple (state_vars[1 : 9 ])) # TODO : Update tensor slicing until next Gridap version has been released
446- λαn = state_vars[10 ]
440+ F:: TensorValue , Fn:: TensorValue , A:: VectorValue )
441+ Uvn = TensorValue {3,3} (A[1 : 9 ]. .. )
442+ λαn = A[10 ]
447443 # ------------------------------------------
448444 # Get kinematics
449445 # ------------------------------------------
468464
469465function ViscousDissipation (obj:: ViscousIncompressible , Δt:: Float64 ,
470466 Se_:: Function , ∂Se∂Ce_:: Function ,
471- F:: TensorValue , Fn:: TensorValue , stateVars:: VectorValue )
472- state_vars = get_array (stateVars)
473- Uvn = TensorValue {3,3} (Tuple (state_vars[1 : 9 ])) # TODO : Update tensor slicing until next Gridap version has been released
474- λαn = state_vars[10 ]
467+ F:: TensorValue , Fn:: TensorValue , A:: VectorValue )
468+ Uvn = TensorValue {3,3} (A[1 : 9 ]. .. )
469+ λαn = A[10 ]
475470 # ------------------------------------------
476471 # Get kinematics
477472 # ------------------------------------------
0 commit comments