Alamo
Mechanics.H
Go to the documentation of this file.
1#ifndef INTEGRATOR_BASE_MECHANICS_H
2#define INTEGRATOR_BASE_MECHANICS_H
3
4#include "AMReX.H"
10#include "Numeric/Stencil.H"
11#include "Model/Solid/Solid.H"
14#include "Operator/Operator.H"
15#include "IC/Constant.H"
16#include "IC/Expression.H"
17#include "IC/Trig.H"
18
19namespace Integrator
20{
21namespace Base
22{
23template<class MODEL>
24class Mechanics: virtual public Integrator
25{
26public:
27
29
31 {}
32
34 {
35 delete ic_rhs;
36 delete velocity_ic;
37 delete bc;
38 }
39
40 // The mechanics integrator manages the solution of an elastic
41 // solve using the MLMG solver.
42 static void Parse(Mechanics& value, IO::ParmParse& pp)
43 {
44 BL_PROFILE("Integrator::Base::Mechanics::Parse");
45
46 // This lambda contains all the non-static options.
47 auto parse_nonstatic = [&] () {
48 // Treat mechanics fields as changing in time. [false]
49 // You should use this if you care about other physics driven by
50 // the output of this integrator.
51 pp_query_default("time_evolving", value.m_time_evolving,false);
52
53 pp_query_default("plot_disp", value.plot_disp, true); // Include displacement field in output
54 pp_query_default("plot_rhs", value.plot_rhs, true); // Include right-hand side in output
55 pp_query_default("plot_psi", value.plot_psi, true); // Include :math:`\psi` field in output
56 pp_query_default("plot_stress", value.plot_stress, true); // Include stress in output
57 pp_query_default("plot_strain", value.plot_strain, true); // Include strain in output
58
59 // Select the mechanical boundary conditions
61
62 pp_query_default("print_model", value.m_print_model, false); // Print out model variables (if enabled by model)
63
64 // initial condition for right hand side (body force)
66
67 // Timestep interval for elastic solves (default - solve every time)
68 pp_query_default("interval", value.m_interval, 0);
69
70 // Maximum multigrid coarsening level (default - none, maximum coarsening)
71 pp_query_default("max_coarsening_level", value.m_max_coarsening_level,-1);
72
73 // Whether to include residual output field
74 pp_query_default("print_residual", value.m_print_residual,false);
75
76 // Whether to refine based on elastic solution
77 pp_query_default("elastic_ref_threshold", value.m_elastic_ref_threshold,0.01);
78
79 // Set this to true to zero out the displacement before each solve.
80 // (This is a temporary fix - we need to figure out why this is needed.)
81 pp_query_default("zero_out_displacement", value.m_zero_out_displacement,false);
82
83 // Time to start doing the elastic solve (by default, start immediately)
84 pp_query_default("tstart", value.tstart,-1.0);
85
86 // Relative tolerance in mechanics solve
87 pp.query_default("tol_rel",value.tol_rel,1E-8);
88
89 // Absolute tolerance in mechanics solve
90 pp.query_default("tol_abs",value.tol_abs,1E-8);
91 };
92
93
94 // Type of mecahnics to use.
95 // Static: do full implicit solve.
96 // Dynamic: evolve dynamic equations with explicit dynamics
97 // Disable: do nothing.
98 pp.query_switch("type",
99 {
100 { "static", [&]() {
101 value.m_type = Type::Static;
102 // Read parameters for :ref:`Solver::Nonlocal::Newton` solver
103 pp.queryclass("solver", value.solver);
104
105 parse_nonstatic();
106 }},
107 { "dynamic", [&]() {
108 value.m_type = Type::Dynamic;
109
110 pp.forbid("viscous.mu","replaced with viscous.mu_dashpot");
111 pp.forbid("viscous.mu2","replaced with viscous.mu_newton");
112
113 // Dashpot damping (damps velocity)
114 pp.query_default("viscous.mu_dashpot", value.mu_dashpot,0.0);
115 // Newtonian viscous damping (damps velocity gradien
116 pp.query_default("viscous.mu_newton", value.mu_newton,0.0);
117
118 // Velocity field initial condition
119 pp.query_switch("velocity.ic.type", {
120 { "none", [&]() {} },
121 { "constant", [&]() {
122 auto *ic = new IC::Constant(value.geom, pp, "velocity.ic.constant");
123 if (IO::ParmParse::InTraversalMode()) delete ic;
124 else value.velocity_ic = ic;
125 }},
126 { "expression", [&]() {
127 auto *ic = new IC::Expression(value.geom, pp, "velocity.ic.expression");
128 if (IO::ParmParse::InTraversalMode()) delete ic;
129 else value.velocity_ic = ic;
130 }}
131 });
132
133 value.RegisterGeneralFab(value.vel_mf, 1, 2, "vel",true);
134 value.RegisterGeneralFab(value.disp_old_mf, 1, 2, "dispold");
135 value.RegisterGeneralFab(value.vel_old_mf, 1, 2, "velold");
136 value.RegisterGeneralFab(value.ddw_mf, 1, 2);
137
138 parse_nonstatic();
139 }},
140 { "disable", [&]() {
141 value.m_type = Type::Disable;
142 }}
143 });
144
145 if (value.m_type == Type::Disable) return;
146
147 value.RegisterGeneralFab(value.disp_mf, 1, 2, value.plot_disp, "disp", value.m_time_evolving);
148 value.RegisterGeneralFab(value.rhs_mf, 1, 2, value.plot_rhs, "rhs", value.m_time_evolving);
149 value.RegisterGeneralFab(value.stress_mf, 1, 2, value.plot_stress, "stress", value.m_time_evolving);
150 value.RegisterGeneralFab(value.strain_mf, 1, 2, value.plot_strain, "strain", value.m_time_evolving);
151
152 if (value.m_print_model) value.RegisterGeneralFab(value.model_mf, 1, 2, "model", value.m_time_evolving);
153 else value.RegisterGeneralFab(value.model_mf, 1, 2, value.m_time_evolving);
154
155
156 value.RegisterIntegratedVariable(&(value.disp_hi[0].data()[0]), "disp_xhi_x");
157 value.RegisterIntegratedVariable(&(value.disp_hi[0].data()[1]), "disp_xhi_y");
158 value.RegisterIntegratedVariable(&(value.disp_hi[1].data()[0]), "disp_yhi_x");
159 value.RegisterIntegratedVariable(&(value.disp_hi[1].data()[1]), "disp_yhi_y");
160 value.RegisterIntegratedVariable(&(value.trac_hi[0].data()[0]), "trac_xhi_x");
161 value.RegisterIntegratedVariable(&(value.trac_hi[0].data()[1]), "trac_xhi_y");
162 value.RegisterIntegratedVariable(&(value.trac_hi[1].data()[0]), "trac_yhi_x");
163 value.RegisterIntegratedVariable(&(value.trac_hi[1].data()[1]), "trac_yhi_y");
164
165 if (value.m_print_residual) value.RegisterGeneralFab(value.res_mf, 1, 2, "res", false);
166
167 }
168
169protected:
170 /// \brief Use the #ic object to initialize#Temp
171 void Initialize(int lev) override
172 {
173 BL_PROFILE("Integrator::Base::Mechanics::Initialize");
175
176 disp_mf[lev]->setVal(Set::Vector::Zero());
177 //disp_old_mf[lev]->setVal(Set::Vector::Zero());
178
179 if (m_type == Type::Dynamic)
180 if (velocity_ic)
181 {
183 }
184
185 if (ic_rhs) ic_rhs->Initialize(lev, rhs_mf);
186 else rhs_mf[lev]->setVal(Set::Vector::Zero());
187 }
188
189 virtual void UpdateModel(int a_step, Set::Scalar a_time) = 0;
190
191 virtual void TimeStepBegin(Set::Scalar a_time, int a_step) override
192 {
193 BL_PROFILE("Integrator::Base::Mechanics::TimeStepBegin");
195
196 for (int lev = 0; lev <= finest_level; ++lev)
197 {
198 rhs_mf[lev]->setVal(Set::Vector::Zero());
199 if (ic_rhs) ic_rhs->Initialize(lev, rhs_mf);
200 }
201
202 UpdateModel(a_step, a_time);
203
204 bc->SetTime(a_time);
205 bc->Init(rhs_mf, geom);
206
208 if (a_time < tstart) return;
209 if (m_interval && a_step % m_interval) return;
210
211 amrex::LPInfo info;
212 if (m_max_coarsening_level >= 0)
213 info.setMaxCoarseningLevel(m_max_coarsening_level);
214 const bool conservative_face_flux =
217 Geom(0, finest_level), grids, DistributionMap(0, finest_level),
218 info, conservative_face_flux);
219 elastic_op.SetUniform(false);
220 elastic_op.SetHomogeneous(false);
221 elastic_op.SetBC(bc);
222 IO::ParmParse pp("elasticop");
223
224 // Elastic operator
225 pp.queryclass(elastic_op);
226
227 solver.Define(elastic_op);
229
230 for (int lev = 0; lev <= finest_level; ++lev)
231 if (m_zero_out_displacement) disp_mf[lev]->setVal(Set::Vector::Zero());
232
235 solver.Clear();
236
237 for (int lev = 0; lev <= disp_mf.finest_level; lev++)
238 {
239 amrex::Box domain = geom[lev].Domain();
240 domain.convert(amrex::IntVect::TheNodeVector());
241
242 const amrex::Real* DX = geom[lev].CellSize();
243 for (MFIter mfi(*disp_mf[lev], false); mfi.isValid(); ++mfi)
244 {
245 amrex::Box bx = mfi.nodaltilebox();
246 bx.grow(2);
247 bx = bx & domain;
248 amrex::Array4<MODEL> const& model = model_mf[lev]->array(mfi);
249 amrex::Array4<Set::Matrix> const& stress = stress_mf[lev]->array(mfi);
250 amrex::Array4<Set::Matrix> const& strain = strain_mf[lev]->array(mfi);
251 amrex::Array4<const Set::Vector> const& disp = disp_mf[lev]->array(mfi);
252
253
254 amrex::ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k)
255 {
256 auto sten = Numeric::GetStencil(i, j, k, bx);
257 if (model(i, j, k).kinvar == Model::Solid::KinematicVariable::F)
258 {
259 Set::Matrix F = Set::Matrix::Identity() + Numeric::Gradient(disp, i, j, k, DX, sten);
260 stress(i, j, k) = model(i, j, k).DW(F);
261 strain(i, j, k) = F;
262 }
263 else
264 {
265 Set::Matrix gradu = Numeric::Gradient(disp, i, j, k, DX, sten);
266 stress(i, j, k) = model(i, j, k).DW(gradu);
267 strain(i, j, k) = 0.5 * (gradu + gradu.transpose());
268 }
269 });
270 }
271 stress_mf[lev]->setMultiGhost(true);
272 stress_mf[lev]->FillBoundaryAndSync(geom[lev].periodicity());
273 strain_mf[lev]->setMultiGhost(true);
274 strain_mf[lev]->FillBoundaryAndSync(geom[lev].periodicity());
275 }
276 }
277
278 void Advance(int lev, Set::Scalar time, Set::Scalar dt) override
279 {
280 BL_PROFILE("Integrator::Base::Mechanics::Advance");
282 const amrex::Real* DX = geom[lev].CellSize();
283
284 amrex::Box domain = geom[lev].Domain();
285 domain.convert(amrex::IntVect::TheNodeVector());
286 const amrex::Dim3 lo = amrex::lbound(domain), hi = amrex::ubound(domain);
287
288 if (m_type == Type::Dynamic)
289 {
290
291 std::swap(*disp_mf[lev], *disp_old_mf[lev]);
292 std::swap(*vel_mf[lev], *vel_old_mf[lev]);
293
294
295 for (amrex::MFIter mfi(*disp_mf[lev], amrex::TilingIfNotGPU()); mfi.isValid(); ++mfi)
296 {
300
301 Set::Patch<Set::Vector> unew = disp_mf.Patch(lev,mfi);
302 Set::Patch<Set::Vector> vnew = vel_mf.Patch(lev,mfi);
305 //Set::Patch<MATRIX4> ddw = ddw_mf.Patch(lev,mfi);
306 Set::Patch<MODEL> model = model_mf.Patch(lev,mfi);
307
308 amrex::Box bx = mfi.grownnodaltilebox() & domain;
309 amrex::ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k)
310 {
311 auto sten = Numeric::GetStencil(i,j,k,bx);
312 eps(i, j, k) = Numeric::Gradient(u, i, j, k, DX,sten);
313 sig(i, j, k) = model(i, j, k).DW(eps(i, j, k));
314 //ddw(i,j,k) = model(i,j,k).DDW(eps(i,j,k));
315 });
316
317 bx = mfi.nodaltilebox() & domain;
318 amrex::ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k)
319 {
320
321 bool AMREX_D_DECL(xmin = (i == lo.x), ymin = (j == lo.y), zmin = (k == lo.z));
322 bool AMREX_D_DECL(xmax = (i == hi.x), ymax = (j == hi.y), zmax = (k == hi.z));
323
324 if (AMREX_D_TERM(xmax || xmin, || ymax || ymin, || zmax || zmin))
325 {
326 auto sten = Numeric::GetStencil(i,j,k,domain);
327
328 auto bctype = bc->getType(i,j,k,domain);
329
330 for (int d = 0; d < AMREX_SPACEDIM; d++)
331 {
333 {
334 unew(i,j,k)(d) = b(i,j,k)(d);
335 }
337 {
338
339 Set::Vector N = Set::Normal(AMREX_D_DECL(xmin,ymin,zmin),
340 AMREX_D_DECL(xmax,ymax,zmax));
341
342 auto [phi, offdiag] = Numeric::GradientSplit(u,i,j,k,DX,sten);
343
344 Set::Matrix A = Set::Matrix::Zero();
345 Set::Vector rhs = b(i,j,k);
346 Set::Matrix DW_F0 = model(i,j,k).DW(Set::Matrix::Zero());
347 MATRIX4 ddw = model(i,j,k).DDW(eps(i,j,k));
348 //Util::Message(INFO,b(i,j,k).transpose());
349
350 for (int p = 0; p < AMREX_SPACEDIM; p++)
351 for (int q = 0; q < AMREX_SPACEDIM; q++)
352 {
353 for (int r = 0; r < AMREX_SPACEDIM; r++)
354 for (int s = 0; s < AMREX_SPACEDIM; s++)
355 {
356 A(p,r) += ddw(p,q,r,s) * phi(s) * N(q);
357
358 rhs(p) -= ddw(p,q,r,s) * eps(i,j,k)(r,s) * N(q);
359 }
360
361 rhs(p) -= DW_F0(p,q)*N(q);
362 }
363 Set::Vector delta_u = (A.inverse() * rhs);
364
365 unew(i,j,k)(d) = u(i,j,k)(d) + delta_u(d);
366 vnew(i,j,k)(d) = (unew(i,j,k)(d) - u(i,j,k)(d))/dt;
367 }
368 else
369 {
370 Util::Abort(INFO,"Elastic dynamics not supported for other BCs yet");
371 }
372 }
373 }
374 else
375 {
376 //Set::Matrix gradu = Numeric::Gradient(u,i,j,k,DX);
377 //Set::Matrix3 gradgradu = Numeric::Hessian(u,i,j,k,DX);
378
379 //Set::Vector f = ddw(i,j,k)*gradgradu;
380 Set::Vector f = Numeric::Divergence(sig, i, j, k, DX);
381
382 //MATRIX4 AMREX_D_DECL(
383 // Cgrad1 = (Numeric::Stencil<MATRIX4, 1, 0, 0>::D(ddw, i, j, k, 0, DX)),
384 // Cgrad2 = (Numeric::Stencil<MATRIX4, 0, 1, 0>::D(ddw, i, j, k, 0, DX)),
385 // Cgrad3 = (Numeric::Stencil<MATRIX4, 0, 0, 1>::D(ddw, i, j, k, 0, DX)));
386
387 //f += AMREX_D_TERM( ( Cgrad1*gradu).col(0),
388 // +(Cgrad2*gradu).col(1),
389 // +(Cgrad3*gradu).col(2));
390
391 Set::Vector lapv = Numeric::Laplacian(v, i, j, k, DX);
392 f += mu_newton * lapv + b(i,j,k) - mu_dashpot*v(i,j,k);
393
394 Set::Vector udotdot = f / rho;
395 vnew(i, j, k) = v(i, j, k) + dt * udotdot;
396 unew(i, j, k) = u(i, j, k) + dt * v(i, j, k);
397 }
398 });
399 }
400 }
401
402 for (amrex::MFIter mfi(*disp_mf[lev], false); mfi.isValid(); ++mfi)
403 {
404 amrex::Box bx = mfi.grownnodaltilebox() & domain;
405 amrex::Array4<Set::Matrix> const& eps = (*strain_mf[lev]).array(mfi);
406 amrex::Array4<Set::Matrix> const& sig = (*stress_mf[lev]).array(mfi);
407 amrex::Array4<MODEL> const& model = (*model_mf[lev]).array(mfi);
408 amrex::ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k)
409 {
410 model(i, j, k).Advance(dt, eps(i, j, k), sig(i, j, k),time);
411 });
412 }
413
414 model_mf[lev]->setMultiGhost(true);
415 model_mf[lev]->FillBoundaryAndSync(geom[lev].periodicity());
416 }
417
418 void Integrate(int amrlev, Set::Scalar /*time*/, int /*step*/,
419 const amrex::MFIter& mfi, const amrex::Box& a_box) override
420 {
421 BL_PROFILE("Integrator::Base::Mechanics::Integrate");
422 if (m_type == Type::Disable) return;
423
424 if (amrex::ParallelDescriptor::NProcs() > 1 && a_box.contains(amrex::IntVect::TheZeroVector()) &&
425 amrlev == 0)
426 {
427 Util::Warning(INFO,"There is a known bug when calculating trac/disp in Base::Mechanics in parallel.");
428 Util::Warning(INFO,"The thermo.dat values likely will not be correct; use the boxlib output instead.");
429 }
430
431 const amrex::Real* DX = geom[amrlev].CellSize();
432 amrex::Box domain = geom[amrlev].Domain();
433 domain.convert(amrex::IntVect::TheNodeVector());
434
435 amrex::Box box = a_box;
436 box.convert(amrex::IntVect::TheNodeVector());
437
438
439 //Set::Scalar dv = AMREX_D_TERM(DX[0], *DX[1], *DX[2]);
440#if AMREX_SPACEDIM == 2
441 Set::Vector da0(DX[1], 0);
442 Set::Vector da1(0, DX[0]);
443#elif AMREX_SPACEDIM == 3
444 Set::Vector da(DX[1] * DX[2], 0, 0);
445#endif
446
447 const Dim3 /*lo= amrex::lbound(domain),*/ hi = amrex::ubound(domain);
448 const Dim3 /*boxlo= amrex::lbound(box),*/ boxhi = amrex::ubound(box);
449
450 amrex::Array4<const Set::Matrix> const& stress = (*stress_mf[amrlev]).array(mfi);
451 amrex::Array4<const Set::Vector> const& disp = (*disp_mf[amrlev]).array(mfi);
452 amrex::ParallelFor(box, [=] AMREX_GPU_DEVICE(int i, int j, int k)
453 {
454#if AMREX_SPACEDIM == 2
455 if (i == hi.x && j < boxhi.y)
456 {
457 trac_hi[0] += (0.5 * (stress(i, j, k) + stress(i, j + 1, k)) * da0);
458 disp_hi[0] = disp(i, j, k);
459 }
460 if (j == hi.y && i < boxhi.x)
461 {
462 trac_hi[1] += (0.5 * (stress(i, j, k) + stress(i + 1, j, k)) * da1);
463 disp_hi[1] = disp(i, j, k);
464 }
465#elif AMREX_SPACEDIM == 3
466 if (i == hi.x && (j < boxhi.y && k < boxhi.z))
467 {
468 trac_hi[0] += (0.25 * (stress(i, j, k) + stress(i, j + 1, k)
469 + stress(i, j, k + 1) + stress(i, j + 1, k + 1)) * da);
470 disp_hi[0] = disp(i, j, k);
471 }
472#endif
473 });
474
475 }
476
477 void TagCellsForRefinement(int lev, amrex::TagBoxArray& a_tags, Set::Scalar /*time*/, int /*ngrow*/) override
478 {
479 BL_PROFILE("Integrator::Base::Mechanics::TagCellsForRefinement");
480 if (m_type == Type::Disable) return;
481
482 Set::Vector DX(geom[lev].CellSize());
483 Set::Scalar DXnorm = DX.lpNorm<2>();
484 for (amrex::MFIter mfi(*strain_mf[lev], TilingIfNotGPU()); mfi.isValid(); ++mfi)
485 {
486 amrex::Box bx = mfi.tilebox();
487 bx.convert(amrex::IntVect::TheCellVector());
488 amrex::Array4<char> const& tags = a_tags.array(mfi);
489 amrex::Array4<Set::Matrix> const& eps = strain_mf[lev]->array(mfi);
490 amrex::ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k)
491 {
492 Set::Matrix3 grad = Numeric::NodeGradientOnCell(eps, i, j, k, DX.data());
493 if (grad.norm() * DXnorm > m_elastic_ref_threshold)
494 tags(i, j, k) = amrex::TagBox::SET;
495 });
496 }
497 }
498
499protected:
504 bool psi_on = false;
505
506 int m_interval = 0;
508
514
515 // Only use these if using the "dynamics" option
519 //Set::Field<Set::Matrix4<AMREX_SPACEDIM,MODEL::sym>> ddw_mf;
523
524 //Set::Vector trac_lo[AMREX_SPACEDIM];
525 Set::Vector trac_hi[AMREX_SPACEDIM];
526 Set::Vector disp_hi[AMREX_SPACEDIM];
527
528
530
532
535
537 bool m_print_model = false;
538 bool m_print_residual = false;
539 bool m_time_evolving = false;
541
543
544 bool plot_disp = true;
545 bool plot_stress = true;
546 bool plot_strain = true;
547 bool plot_psi = true;
548 bool plot_rhs = true;
549
550
552
554};
555}
556}
557#endif
#define pp_query_default(...)
Definition ParmParse.H:120
#define INFO
Definition Util.H:24
void SetTime(const Set::Scalar a_time)
Definition Elastic.H:49
virtual void Init(amrex::MultiFab *a_rhs, const amrex::Geometry &a_geom, bool a_homogeneous=false) const =0
virtual std::array< Type, AMREX_SPACEDIM > getType(const int &i, const int &j, const int &k, const amrex::Box &domain)=0
Pure abstract IC object from which all other IC objects inherit.
Definition IC.H:23
void Initialize(const int &a_lev, Set::Field< T > &a_field, Set::Scalar a_time=0.0)
Definition IC.H:39
Initialize using a trigonometric series.
Definition Trig.H:23
void select_default(std::string name, PTRTYPE *&ic_eta, const std::source_location &location=std::source_location::current())
Definition ParmParse.H:1978
void queryclass(std::string name, T *value, const std::source_location &location=std::source_location::current())
Definition ParmParse.H:1767
void forbid(std::string name, std::string explanation, const std::source_location &location=std::source_location::current())
Definition ParmParse.H:301
static ForwardArgs< ForwardArgStorage< Args >... > forward_args(Args &&... args)
Definition ParmParse.H:153
int query_default(std::string name, T &value, T defaultvalue, const std::source_location &location=std::source_location::current())
Definition ParmParse.H:492
int query_switch(std::string name, std::initializer_list< std::pair< std::string, std::function< void()> > > cases, const std::source_location &location=std::source_location::current())
Definition ParmParse.H:714
static bool InTraversalMode()
Definition ParmParse.cpp:14
void select(std::string name, PTRTYPE *&ic_eta, const std::source_location &location=std::source_location::current())
Definition ParmParse.H:1883
Set::Field< Set::Vector > disp_mf
Definition Mechanics.H:509
virtual void TimeStepBegin(Set::Scalar a_time, int a_step) override
Definition Mechanics.H:191
Set::Field< Set::Matrix > strain_mf
Definition Mechanics.H:513
Set::Field< MATRIX4 > ddw_mf
Definition Mechanics.H:502
IC::IC< Set::Vector > * ic_rhs
Definition Mechanics.H:529
void Integrate(int amrlev, Set::Scalar, int, const amrex::MFIter &mfi, const amrex::Box &a_box) override
Definition Mechanics.H:418
Set::Field< Set::Vector > vel_old_mf
Definition Mechanics.H:518
Set::Field< Set::Vector > vel_mf
Definition Mechanics.H:517
static void Parse(Mechanics &value, IO::ParmParse &pp)
Definition Mechanics.H:42
Set::Scalar m_elastic_ref_threshold
Definition Mechanics.H:536
IC::IC< Set::Vector > * velocity_ic
Definition Mechanics.H:531
Set::Vector disp_hi[AMREX_SPACEDIM]
Definition Mechanics.H:526
void Initialize(int lev) override
Use the #ic object to initialize::Temp.
Definition Mechanics.H:171
Set::Matrix4< AMREX_SPACEDIM, MODEL::sym > MATRIX4
Definition Mechanics.H:500
void Advance(int lev, Set::Scalar time, Set::Scalar dt) override
Definition Mechanics.H:278
Set::Field< Set::Vector > disp_old_mf
Definition Mechanics.H:516
Solver::Nonlocal::Newton< MODEL > solver
Definition Mechanics.H:533
void TagCellsForRefinement(int lev, amrex::TagBoxArray &a_tags, Set::Scalar, int) override
Definition Mechanics.H:477
Set::Field< Set::Matrix > stress_mf
Definition Mechanics.H:512
Set::Field< Set::Vector > res_mf
Definition Mechanics.H:511
Set::Field< Set::Vector > rhs_mf
Definition Mechanics.H:510
BC::Operator::Elastic::Elastic * bc
Definition Mechanics.H:534
Set::Field< Set::Scalar > psi_mf
Definition Mechanics.H:503
virtual void UpdateModel(int a_step, Set::Scalar a_time)=0
Set::Field< MODEL > model_mf
Definition Mechanics.H:501
Set::Vector trac_hi[AMREX_SPACEDIM]
Definition Mechanics.H:525
std::vector< amrex::Box > box
Definition Integrator.H:465
amrex::Vector< amrex::Real > dt
Timesteps for each level of refinement.
Definition Integrator.H:394
void RegisterGeneralFab(Set::Field< T > &new_fab, int ncomp, int nghost, bool evolving=true)
Add a templated nodal field.
void RegisterIntegratedVariable(Set::Scalar *integrated_variable, std::string name, bool extensive=true)
Register a variable to be integrated over the spatial domain using the Integrate function.
void SetBC(::BC::Operator::Elastic::Elastic *a_bc)
The different types of Boundary Condtiions are listed in the BC::Operator::Elastic documentation.
Definition Elastic.H:63
void SetUniform(bool a_uniform)
Definition Elastic.H:107
virtual void SetHomogeneous(bool a_homogeneous) override
Definition Elastic.H:50
amrex::Array4< T > Patch(int lev, amrex::MFIter &mfi) const &
Definition Set.H:76
int finest_level
Definition Set.H:67
AMREX_FORCE_INLINE Set::Scalar norm()
Definition Matrix3.H:29
void setPsi(Set::Field< Set::Scalar > &a_psi)
Definition Newton.H:124
void Define(Operator::Elastic< T::sym > &a_op)
Definition Newton.H:108
bool usesConservativeFaceFlux() const
Definition Newton.H:134
void compLinearSolverResidual(Set::Field< Set::Vector > &a_res_mf, Set::Field< Set::Vector > &a_u_mf, Set::Field< Set::Vector > &a_b_mf)
Definition Newton.H:776
Set::Scalar solve(const Set::Field< Set::Vector > &a_u_mf, const Set::Field< Set::Vector > &a_b_mf, Set::Field< T > &a_model_mf, Real a_tol_rel, Real a_tol_abs, const char *checkpoint_file=nullptr)
Definition Newton.H:438
Collection of numerical integrator objects.
Definition AllenCahn.H:43
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Set::Vector Divergence(const amrex::Array4< const Set::Matrix > &dw, const int &i, const int &j, const int &k, const Set::Scalar DX[AMREX_SPACEDIM], std::array< StencilType, AMREX_SPACEDIM > stencil=DefaultType())
Definition Stencil.H:596
static AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE std::array< StencilType, AMREX_SPACEDIM > GetStencil(const int i, const int j, const int k, const amrex::Box domain)
Definition Stencil.H:51
AMREX_FORCE_INLINE Set::Vector NodeGradientOnCell(const amrex::Array4< const Set::Scalar > &f, const int &i, const int &j, const int &k, const Set::Scalar dx[AMREX_SPACEDIM])
Definition Stencil.H:875
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Set::Vector Gradient(const amrex::Array4< const Set::Scalar > &f, const int &i, const int &j, const int &k, const int &m, const Set::Scalar dx[AMREX_SPACEDIM], std::array< StencilType, AMREX_SPACEDIM > stencil=DefaultType())
Definition Stencil.H:687
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Set::Scalar Laplacian(const amrex::Array4< const Set::Scalar > &f, const int &i, const int &j, const int &k, const int &m, const Set::Scalar dx[AMREX_SPACEDIM], std::array< StencilType, AMREX_SPACEDIM > stencil=DefaultType())
Definition Stencil.H:561
AMREX_FORCE_INLINE std::pair< Set::Vector, Set::Matrix > GradientSplit(const amrex::Array4< const Set::Vector > &f, const int &i, const int &j, const int &k, const Set::Scalar dx[AMREX_SPACEDIM], std::array< StencilType, AMREX_SPACEDIM > stencil=DefaultType())
Definition Stencil.H:845
amrex::Real Scalar
Definition Base.H:19
Eigen::Matrix< amrex::Real, AMREX_SPACEDIM, 1 > Vector
Definition Base.H:21
AMREX_FORCE_INLINE Vector Normal(AMREX_D_DECL(bool xmin, bool ymin, bool zmin), AMREX_D_DECL(bool xmax, bool ymax, bool zmax))
Definition Base.H:159
Eigen::Matrix< amrex::Real, AMREX_SPACEDIM, AMREX_SPACEDIM > Matrix
Definition Base.H:24
void Warning(std::string file, std::string func, int line, Args const &... args)
Definition Util.H:213
AMREX_GPU_HOST_DEVICE void Abort(const char *msg)
Definition Util.cpp:406