1 #ifndef MODEL_SOLID_FINITE_NEOHOOKEANPREDEFORMED_H_
2 #define MODEL_SOLID_FINITE_NEOHOOKEANPREDEFORMED_H_
32 virtual void Print(std::ostream& out)
const override
34 out <<
"mu = " <<
mu <<
" kappa = " <<
kappa <<
" F0 = " <<
F0;
44 ret.
F0 = Set::Matrix::Zero();
70 value.
F0 = eps0 + Set::Matrix::Identity();
74 value.
F0 = Set::Matrix::Identity();
79 #define OP_CLASS NeoHookeanPredeformed
80 #define OP_VARS X(kappa) X(mu) X(F0)
95 return 2 + AMREX_SPACEDIM * AMREX_SPACEDIM;
102 if (i == 0)
return name +
"_mu";
103 if (i == 1)
return name +
"_kappa";
104 #if AMREX_SPACEDIM==2
105 if (i == 2)
return name +
"_F0xx";
106 if (i == 3)
return name +
"_F0xy";
107 if (i == 4)
return name +
"_F0yx";
108 if (i == 5)
return name +
"_F0yy";
109 #elif AMREX_SPACEDIM==3
111 if (i == 2)
return name +
"_F0xx";
112 if (i == 3)
return name +
"_F0xy";
113 if (i == 4)
return name +
"_F0yx";
114 if (i == 5)
return name +
"_F0yy";
123 for (amrex::MFIter mfi(a_dst, amrex::TilingIfNotGPU()); mfi.isValid(); ++mfi)
125 const amrex::Box& bx = mfi.growntilebox(amrex::IntVect(a_nghost));
128 amrex::Array4<const Model::Solid::Finite::NeoHookeanPredeformed>
const& src = ((*this)[a_lev])->array(mfi);
129 amrex::Array4<Set::Scalar>
const& dst = a_dst.array(mfi);
130 amrex::ParallelFor(bx, [=] AMREX_GPU_DEVICE(
int i,
int j,
int k)
132 dst(i, j, k, a_dstcomp + 0) = src(i, j, k).mu;
133 dst(i, j, k, a_dstcomp + 1) = src(i, j, k).kappa;
134 #if AMREX_SPACEDIM==2
135 dst(i, j, k, a_dstcomp + 2) = src(i, j, k).F0(0, 0);
136 dst(i, j, k, a_dstcomp + 3) = src(i, j, k).F0(0, 1);
137 dst(i, j, k, a_dstcomp + 4) = src(i, j, k).F0(1, 0);
138 dst(i, j, k, a_dstcomp + 5) = src(i, j, k).F0(1, 1);
139 #elif AMREX_SPACEDIM==3
140 dst(i, j, k, a_dstcomp + 2) = src(i, j, k).F0(0, 0);
141 dst(i, j, k, a_dstcomp + 3) = src(i, j, k).F0(0, 1);
142 dst(i, j, k, a_dstcomp + 4) = src(i, j, k).F0(1, 0);
143 dst(i, j, k, a_dstcomp + 5) = src(i, j, k).F0(1, 1);