Elastodynamics

This tutorial adds time dependence to the static elasticity problem. It introduces displacement and velocity as state fields and advances them with the public IDAAdapter execution path. IDA solves the canonical residual F(t, y, ydot) = 0; the application accepts the resulting state before native output is written.

The executable is elastodynamics, from apps/app_elastodynamics.cc. The canonical 2D input is tutorials/elastodynamics/strong_dirichlet.prm.in:

# First-order standalone adaptation of tutorials/elasticity/strong_dirichlet.prm.
set dimension = 2
set space dimension = 2

subsection Elastodynamics
  set FE degree                  = 1
  set Output directory            = @TEST_OUTPUT_DIR@/tutorial-output/elastodynamics-strong
  set Output name                 = strong_dirichlet
  set Initial refinement          = 1
  set Number of refinement cycles = 5
  set Dirichlet boundary ids      = 0,1,2,3

  subsection Grid generation
    set Grid generator           = hyper_cube
    set Grid generator arguments = 0: 1: true
    set Triangulation type       = distributed
  end

  subsection Material
    set Density       = 1.0
    set Lame mu       = 1.0
    set Lame lambda   = 2.0
    set Damping shear = 0.0
    set Damping bulk  = 0.0
  end

  subsection Time interval
    set Initial time       = 0.0
    set Final time         = 0.01
    set Output time interval = 0.01
  end
  subsection Fixed step
    set Time step           = 0.01
    set Number of time steps = 1
    set Policy               = number_of_steps
  end

  subsection Functions
    subsection Body force
      set Function constants  =
      set Function expression = -2*x^2 - 12*x*y + 8*x - 8*y^2 + 14*y + 5*pi^2*sin(pi*x)*sin(pi*y) - 3; -8*x^2 - 12*x*y + 14*x - 2*y^2 + 8*y - 3*pi^2*cos(pi*x)*cos(pi*y) - 3
      set Variable names      = x,y,t
    end
    subsection Displacement boundary
      set Function constants  =
      set Function expression = x*y*(x - 1)*(y - 1) + sin(pi*x)*sin(pi*y); x*y*(x - 1)*(y - 1)
      set Variable names      = x,y,t
    end
    subsection Velocity boundary
      set Function constants  =
      set Function expression = 0; 0
      set Variable names      = x,y,t
    end
    subsection Initial displacement
      set Function constants  =
      set Function expression = x*y*(x - 1)*(y - 1) + sin(pi*x)*sin(pi*y); x*y*(x - 1)*(y - 1)
      set Variable names      = x,y,t
    end
    subsection Initial velocity
      set Function constants  =
      set Function expression = 0; 0
      set Variable names      = x,y,t
    end
    subsection Exact solution
      set Function constants  =
      set Function expression = x*y*(x - 1)*(y - 1) + sin(pi*x)*sin(pi*y); x*y*(x - 1)*(y - 1)
      set Variable names      = x,y,t
    end
  end

  subsection Solver
    subsection Control
      set Log frequency = 1
      set Log history   = false
      set Log result    = false
      set Max steps     = 500
      set Reduction     = 1.e-12
      set Tolerance     = 1.e-12
    end
  end
end

subsection Error
  set Enable computation of the errors = true
  set Error file name                  =
  set Error precision                  = 8
  set Exponent for p-norms             = 2
  set Extra columns                    = cells, dofs
  set List of error norms to compute   = L2_norm, Linfty_norm, H1_norm
  set Rate key                         = dofs
  set Rate mode                        = reduction_rate_log2
end

The application reads dimension and space dimension from the file. This input selects the full-dimensional 2D solver; the executable also supports the full-dimensional 3D instantiation. The input uses one time step and a manufactured displacement so it stays a small, deterministic smoke example.

Run it with:

cmake --build build -j
./build/elastodynamics_debug \
  build/tutorials/elastodynamics/strong_dirichlet.prm

Output is written below build/test_output/tutorial-output/elastodynamics-strong. The same input is exercised by AppExecutables.TutorialElastodynamics.

The physical model exposes separate mass, stiffness, and damping operators. The application registers the Problem directly with IDAAdapter, marks both displacement and velocity as differential Fields, and installs an accepted output callback. initial_acceleration() supplies a physically consistent initial derivative; accept_state() updates the Problem only after IDA has accepted or interpolated a state. Solver-neutral residual and execution-adapter concepts are described in Architecture concepts. The larger convergence cases remain in tutorials/elastodynamics/ and are listed in the verification reference.

Next, Reduced Poisson introduces a lower-dimensional geometry and coupling.