The template modules: Examples


The templates module provides a collection of examples to :


fdgrid.templates.circle(xn, zn)[source]

Curvilinear coordinates: test case 3. The circle.

fdgrid.templates.curv(xn, zn)[source]

Curvilinear coordinates: test case 1. Physical == numerical.

fdgrid.templates.curvx(xn, zn)[source]

Curvilinear coordinates: test case 2. Following x.

fdgrid.templates.curvz(xn, zn)[source]

Curvilinear coordinates: test case 2. Following z.

fdgrid.templates.helmholtz(nx, nz, cavity=(0.2, 0.2), neck=(0.1, 0.1))[source]

Geometry: Helmholtz resonator.

Parameters
  • nx (int) – Width of the domain.

  • nz (int) – Height of the domain.

  • cavity (tuple, optional) – Normalized (width, height) of the cavity.

  • neck (tuple, optional) – Normalized (width, height) of the neck.

fdgrid.templates.helmholtz_double(nx, nz, cavity=(0.2, 0.2), neck=(0.1, 0.1))[source]

Geometry: Double Helmholtz resonator.

Parameters
  • nx (int) – Width of the domain.

  • nz (int) – Height of the domain.

  • cavity (tuple, optional) – Normalized (width, height) of the cavity.

  • neck (tuple, optional) – Normalized (width, height) of the neck.

fdgrid.templates.moving_square(nx, nz, size_percent=20)[source]

Geometry: Square with moving bc.

Parameters
  • nx (int) – Width of the domain.

  • nz (int) – Height of the domain.

  • size_percent (float) – size of the square (percent of the largest dimension of the domain).

fdgrid.templates.plus(nx, nz, ix0=None, iz0=None, size=20)[source]

Geometry: Plus sign.

Parameters
  • nx (int) – Width of the domain.

  • nz (int) – Height of the domain.

  • ix0 (int, optional) – x-location of the pattern.

  • iz0 (int, optional) – z-location of the pattern.

  • size (int) – Width of the pattern.

fdgrid.templates.section(xn, zn, variation=25, zmin=5, zmax=- 5)[source]

Curvilinear coordinates: test case 4. The section change.

fdgrid.templates.square(nx, nz, size_percent=20)[source]

Geometry: Square at the center of the domain.

Parameters
  • nx (int) – Width of the domain.

  • nz (int) – Height of the domain.

  • size_percent (float) – size of the square (percent of the largest dimension of the domain).

fdgrid.templates.street(nx, nz)[source]

Geometry: Street model.

Parameters
  • nx (int) – Width of the domain.

  • nz (int) – Height of the domain.

fdgrid.templates.testcase1(nx, nz)[source]

Geometry: Test case 1. Complex geometry.

fdgrid.templates.testcase2(nx, nz)[source]

Geometry: Test case 2. Periodic bc.