serac icon indicating copy to clipboard operation
serac copied to clipboard

Improvements for LIDO

Open samuelpmishLLNL opened this issue 1 year ago • 0 comments

Re: https://github.com/LLNL/serac/issues/774

Here's a summary of some of the issues and which have been addressed so far in this PR (:heavy_check_mark: => addressed, :x: => still working):

:heavy_check_mark: 1. (Bug) Some missing implementation for 0th-order (constant) L2 spaces. :heavy_check_mark: 2. (QoL) Be more explicit about not supporting L2 spaces on boundary integrals. :heavy_check_mark: 3. (QoL) User-specified arguments per q-function.

:heavy_check_mark: 3. (QoL) User-specified arguments per q-function.

Before: q-functions had to accept all parameters present in the problem:

SolidFunctional<p, dim, Parameters<This, That, TheOtherThing> > solid_solver(...);
solid_solver.setMaterial([](auto x, auto du_dx, auto this_q, auto that_q, auto the_other_thing_q){
   ...
});

Now, you can write the following instead:

SolidFunctional<p, dim, Parameters<This, That, TheOtherThing> > solid_solver(...);
solid_solver.setMaterial(DependsOn<0, 2>{}, [](auto x, auto du_dx, auto this_q, auto the_other_thing_q){
   ...
});

:heavy_check_mark: 4. (QoL) Clarify these types for specifying loads and tractions :x: 5. (QoL) Member functions that require explicit template parameters :heavy_check_mark: 6. (Bug) some boundary integral arrays were being sized incorrectly :heavy_check_mark: 7. (Bug) update signatures for quantity of interest member function aliases AddVolumeIntegral() and AddAreaIntegral() :heavy_check_mark: 8. (Bug) fix indexing bug when using vector-valued trial spaces in volume integrals for quantities of interest. :x: 9. (QoL) update readthedocs entries for Functional to include expectations of q-function interface for Quantities of Interest

:x: 10. (QoL) give users an option to bypass setMaterial calls and register a custom q-function to the residual.

Before: material models make a lot of assumptions (materials don't depend on spatial coordinate or displacement vector explicitly, homogeneous mass density in reference configuration, ... )

SolidFunctional<p, dim> solid_solver(...);
solid_solver.setMaterial(NeoHookean{rho, K, G});

Now, there's another option, where you can write something like:

double lambda = ...;
double mu = ...;
solid_solver.addCustomDomainIntegral(DependsOn<>{}, [=](auto x, auto displacement, auto acceleration){
  auto du_dx = serac::get<1>(displacement);

  auto I       = Identity<dim>();
  auto epsilon = 0.5 * (transpose(du_dx) + du_dx);
  auto stress = lambda * tr(epsilon) * I + 2.0 * mu * epsilon;
 
  auto d2u_dt2 = serac::get<0>(acceleration);
  double rho = 1.0 + x[0]; // spatially-varying density
 
  return serac::tuple{rho * d2u_dt2, stress};
});

Note: this feature is experimental, and not thoroughly tested yet.


For reference: much of the credit for these bugfixes goes to @kswartz92, for uncovering a lot of gaps in our test suite coverage

samuelpmishLLNL avatar Aug 30 '22 21:08 samuelpmishLLNL