Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
KapilKhanal authored Jan 12, 2025
1 parent 1340f29 commit cbdc205
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,17 @@ cptmesh = cpt.mesh_sphere(name="sphere", radius=radius, center=(0, 0, 0), resolu
cptmesh.keep_immersed_part(inplace=true)

# declare it Julia mesh
mesh = Mesh(cptmesh)
mesh = Mesh(cptmesh)
ω = 1.03
ζ = [0,0,1] # HEAVE: will be more verbose in future iteration. define it again even if defined in Capytaine.
F = DiffractionForce(mesh,ω,ζ)
A,B = calculate_radiation_forces(mesh,ζ,ω)
```

5. **Differentiability** :
For differentiability with respect to mesh dimension, use `paper/MeshGradients_singlebody.jl`
Differentiability needs an AD engine: use Zygote
```julia
using Zygote
A_w_grad, = Zygote.gradient(w -> calculate_radiation_forces(mesh,dof,w)[1],ω)
```

0 comments on commit cbdc205

Please sign in to comment.