(section:IE)=
# Infinite Elements

In this section, we describe how to use infinite elements for acoustics. The
elements enforce high-order absorbing boundary conditions.
As a post processing step, it is also possible to evaluate the solution at
far-field points outside of the acoustic mesh.

The infinite element specification begins with a sideset on the Exodus file of
interest. That sideset has to be a spherical surface or part of a
spherical surface. Thus, a full spherical surface, hemispherical surface, or a
quarter of a sphere would all be acceptable. Note that the infinite element
accuracy will degrade if the element surfaces on the spherical boundary do not
adequately represent the spherical surface. The finite element surfaces will be
faceted, but enough elements on the boundary are needed to represent the
spherical curvature.

Once a sideset is identified for the infinite element surface, the
`boundary` section in the input deck would be modified as follows.

:::{input}
BOUNDARY
  sideset 1
  infinite_element
  use block 57
END

BLOCK 57
  infinite_element
  radial_poly = Legendre
    order = 5
    source = 0 0 0
    neglect_mass = yes
END
:::

Where block 57 contains the infinite element parameters. The number 57 is arbitrary; the user
can pick any number that is not assigned to a block in the input mesh Exodus file.
The parameters are summarized in Table {numref}`%s <infiniteelem_params>`.

:::{table} Available parameters for the infinite element section.
:name: infiniteelem_params

| Parameter    | Description                                        | Options            | default  |
| :----------- | :------------------------------------------------- | :----------------- | :------- |
| radial_poly  | the type of polynomial for radial expansion        | Legendre           | Legendre |
| order        | the order of the radial basis                      | 0-19               | 0        |
| source       | the location of the source point                   | any 3 real numbers | 0 0 0    |
| neglect_mass | indicates whether to neglect infinite element mass | yes or no          | yes      |
:::

Only Legendre polynomials are available for the radial basis.
The order of the polynomial can vary from $0$ to $19$. Order $0$
corresponds to a simple absorbing boundary condition. Higher orders will be more accurate, but also more
computationally expensive. The source point is the location of the center of the spherical surface from which
the infinite elements originate. This would coincide with the origin of a spherical coordinate system that is
anchored to the spherical surface of the infinite elements. The `neglect_mass` option indicates
whether to neglect the mass matrix contributions from the infinite elements. Note that for a spherical surface,
the mass matrix contributions from an infinite element are identically zero. However, when numerically
generated, small entries will be present in the mass matrix, and thus an option is provided to include these
terms in the analysis. It is recommended to neglect the mass in most cases, and thus it would
typically be set to `yes`. By default, `neglect_mass` is set to yes.

Note that infinite elements only require a specification of a sideset on the surface of interest. No
elements need be set up explicitly on this interface. Internally, Sierra/SD constructs virtual elements and
virtual nodes that define the actual infinite elements, but the analyst need not build a layer of elements
on the boundary of the sideset.

Currently, infinite elements are only set up to work in the time domain. We expect to provide the frequency
domain version in an upcoming release.

The infinite element formulation in Sierra/SD uses a Petrov-Galerkin formulation, rather than a standard
Galerkin formulation. As a result, nonsymmetric system matrices are encountered with infinite elements.
This restricts the solver options to the GDSW solver. In addition, special options have to be selected in
`GDSW` block to invoke the nonsymmetric solver for the linear solves.
If infinite elements are specified, Sierra/SD automatically selects the GDSW solver and the correct
options for solving. This makes the process easier for the analyst. However, we list the GDSW options
internally selected for completeness.
A [full input](/tests/Salinas_rtest/training/exampleproblem/transient/acoustic/air/infinite_100elem_transient.inp) for infinite elements is attached,
with exodus mesh as shown in {numref}`mesh:ie`.

:::{figure-md} mesh:ie

![](infinite_100elem.png)

[Infinite Element Mesh](/tests/Salinas_rtest/training/exampleproblem/transient/acoustic/air/infinite_100elem.exo)
:::

:::{input}
GDSW
  matrix_type   nonsymmetric
  krylov_method 1
  solver_tol    1.0e-9
  scale_option  1
  coarse_solver LDM
  I_solver      LDM
  O_solver      LDM
END
:::

Note that the `nonsymmetric` option lets the solver know that it should be expecting a nonsymmetric
matrix.

## Far-Field Postprocessing

Due to the infinite element formulation, as a post processing step
the response outside of the acoustic mesh may be output.
It can be computed at any point outside the mesh, and for any period.
The `linesample` capability may be used to write out the far-field data.
This data may be written in a readable MATLAB format, which can easily be read in to
create plots of the data.
Linesample is placed in the `linesample` section as follows.

:::{input}
linesample
   samples per line 10
   endpoint 0 0 0      1 0 0
   endpoint 0 0 0      0 1 0
   format mfile
end
:::

This example creates two lines, with 10 samples per line.
The first line runs from the origin for one unit in the $X$ direction.
The second line extends from the origin in the $Y$ direction.
For example, the following section,

:::{input}
linesample
   samples per line 2
   endpoint 0 0 50     0 0 50.001
end
:::

will instruct Sierra/SD to output the acoustic results at the 2 points
$(0,0,50)$ and $(0,0,50.001)$.
Since these 2 points are very close, the output will be almost the same. Thus, this is an example
of using linesample to output the results at a fixed point in space.

The output will be written to a `Matlab` m-file with the name
"linedata.m". One file is written
per analysis (results are joined analogous to history file output). For example,
reading this file in will create vectors `Time` and
`Displacement`. In our case
Displacement is just a placeholder for the acoustic pressure.

The infinite element output in the far-field is always given with respect to
some time shift. This is due to the properties of the inverse Fourier
transform. Details of this are given in the theory notes on infinite
elements. The time shifts are included in the
linesample output for the analyst to use. These will allow for plotting the
time histories against the appropriate time vectors. For example, to apply
the time shift to the first point in the linesample data, one could use the
following MATLAB command.

:::{matlab}
shifted_time = time + TimeDelay(1);
:::

One TimeDelay value is available for each sample point in the linesample
output.

Once the time data is properly shifted, the following command in MATLAB will
plot the pressure for the first sample point.

:::{matlab}
plot(shifted_time,Displacement(1,:))
:::
