Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce arbitrary orientation for lumped ports #75

Merged
merged 21 commits into from
Aug 22, 2023

Commits on Aug 22, 2023

  1. Introduce ability to have arbitrarily oriented lumped ports and surfa…

    …ce currents.
    
    The original specification using keywords still works, but now also provide an optional interface
    to specify the direction using a 3 vector.
    hughcars authored and sebastiangrimberg committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    013b4c8 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    bbbcc4e View commit details
    Browse the repository at this point in the history
  3. Introduce ComputeBoundingBox and ComputeBoundingBall

    * Both make use of a reduce/gather paradigm to compute bounding boxes/balls
    for a collection of points. Given this, they do not scale well with growing ranks.
    They are however capable of handling arbitrary orientation of two dimensional ports.
    * The algorithms rely on sorting tricks applied to containers of the vertices
    * The uniform lumped port was tested by applying a 30 degree rotation about all three axes
    to all the vertices of the rings mesh.
    * The uniform lumped port also performs an axis snapping for user specified direction vectors,
    this means the resulting calculations are forgiving on precision issues.
    * Calculations were tested by applying rotations to the global mesh and checking that the resulting areas agree with
    the integrated values
    hughcars authored and sebastiangrimberg committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    522581a View commit details
    Browse the repository at this point in the history
  4. Change to report warning and eventually error if user direction devia…

    …tes from a discovered axis, rather than snap to axis
    hughcars authored and sebastiangrimberg committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    aa0b9b6 View commit details
    Browse the repository at this point in the history
  5. Regenerate rings example data with a pi/3 rotation about the axis (0,…

    …0,1).
    
    - Most of the values are perturbed only on the 3rd sf or so.
    - For the probe data, it is necessary to apply the axis angle transformation on the original data
      - In julia:
    
    ```
    julia> AngleAxis(pi/3, 0,0,1) * [-6.975740032e-01,        -3.331547360e+00,        +1.022439079e+02]
    3-element StaticArraysCore.SVector{3, Float64} with indices SOneTo(3):
       2.5364176460709804
      -2.269890487790808
     102.2439079
    
    julia> AngleAxis(pi/3, 0,0,1) * [-2.108257694e-03,        -1.094675073e-02,        +1.007018922e+01]
    3-element StaticArraysCore.SVector{3, Float64} with indices SOneTo(3):
      0.008426035374075847
     -0.007299180085728002
     10.07018922
    ```
    which agree fairly closely with the newly generated values
    ```
                i,                  B_x[1],                  B_y[1],                  B_z[1]
     1.000000e+00,        -2.744244415e+00,        +2.362252272e+00,        +1.021127464e+02
     2.000000e+00,        -8.553328102e-03,        +7.180956729e-03,        +1.007140281e+01
    ```
    hughcars authored and sebastiangrimberg committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    09ba502 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    28bae3b View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    49a6096 View commit details
    Browse the repository at this point in the history
  8. Regenerate rings data for pi/6 around (0,0,1)

    - All the non-probe data is very close to the original values, modulo a few sf
    - The probe data requires a transformation of the rebaselined data:
    ```
    julia> Ref(AngleAxis(pi/6, 0,0,1)) .* [[-1.934600007e+00, +1.332005966e+00, +1.007689041e+02],
    				       [-2.056769746e-03, +3.073509047e-03, +1.007227123e+01]]
    2-element Vector{StaticArraysCore.SVector{3, Float64}}:
     [-2.3414157352235527, 0.18625100104843154, 100.7689041]
     [-0.0033179693732712672, 0.0016333520404633007, 10.07227123]
    ```
    which compares to
    ```
                i,                  B_x[1],                  B_y[1],                  B_z[1]
     1.000000e+00,        -2.471968830e+00,        +3.021551217e-01,        +1.012769086e+02
     2.000000e+00,        -7.789873394e-03,        +1.048294735e-03,        +1.006816729e+01
    ```
    the additional discrepancy can be partially attributed to breaking of rotational symmetry, as the axis
    does not pass through a vertex of the bounding box of the domain. Better agreement can be found with
    pi/3 around (1,1,1), but (0,0,1) is chosen for ease of understanding in the examples.
    
    Note: the data was generated on a mac M1 with a tighter tolerance of 1e-9, as this was required to reduce discrepancy
    in the values of the second probe and to agree with CI.
    hughcars authored and sebastiangrimberg committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    ea1512a View commit details
    Browse the repository at this point in the history
  9. Various fixes

    - Update schema to account for CoordinateSystem
    - Fix bugs with config parsing and update some more config files
    - Refactor point cloud calculations to reduce duplication and hide local functions
    hughcars authored and sebastiangrimberg committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    67afec1 View commit details
    Browse the repository at this point in the history
  10. Addressing PR comments

    hughcars authored and sebastiangrimberg committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    cb0c4a0 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    8db5574 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    b7ea86e View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    a89c9fd View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    c0ac588 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    c33e25d View commit details
    Browse the repository at this point in the history
  16. Merge remote-tracking branch 'origin/sjg/lumped-port-orientation-fixe…

    …s' into hughcars/lumped-port-orientation-dev
    hughcars authored and sebastiangrimberg committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    df8ac71 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    6b63439 View commit details
    Browse the repository at this point in the history
  18. Further style fixes prior to merge, including column-width for docs a…

    …nd comments and allowing GlobalMinLoc/MaxLoc to use arbitrary type for the second argument as supported by the available MPI types
    sebastiangrimberg committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    f5a06cd View commit details
    Browse the repository at this point in the history
  19. Fix for axis aligned boxes that are not floating point exact. Search …

    …for maximally separated points to define initial diagonal/diameter
    hughcars authored and sebastiangrimberg committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    ae976db View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    b9c26d7 View commit details
    Browse the repository at this point in the history
  21. Address PR comments

    sebastiangrimberg committed Aug 22, 2023
    Configuration menu
    Copy the full SHA
    fa13b91 View commit details
    Browse the repository at this point in the history