Skip to content

Commit

Permalink
add more details to SimpleTrap example
Browse files Browse the repository at this point in the history
  • Loading branch information
Nem0x committed Oct 28, 2022
1 parent 8ec807a commit 3c161c3
Show file tree
Hide file tree
Showing 16 changed files with 319 additions and 48 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,13 +212,13 @@ in the terminal. Remote execution on Berkeley HPC (Savio) requires running
sbatch saviojob.sh
```

The data will be saved as VTK files. The file named as ```<prefix>_<electrode name>.vtk``` stores potential, field (RF only), and field square (RF only). The file named as ```<prefix>_<electrode name>_mesh.vtk``` stores the charge distribution, and the final mesh after adaptive mesh during simulation.
The data will be saved as VTK files. The file named as ```<prefix>_<electrode_name>.vtk``` stores potential, field (RF only), and field square (RF only). The file named as ```<prefix>_<electrode_name>_mesh.vtk``` stores the charge distribution, and the final mesh after adaptive mesh during simulation.

### 4. Result analysis <div id='id-6'/>

Lastly, after we get the results, we can visualize the result by simply calling
```
Result.view(prefix, '<electrode name>')
Result.view(prefix, '<electrode_name>')
```
For example, if we want to visualize the field square of the SimpleTrap's RF electrode, we can simply call ```Result.view(prefix, 'RF')``` in the same folder as the result VTK files. Here is the visualization example

Expand Down
2 changes: 0 additions & 2 deletions bem/area_constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,12 @@ def __init__(self, start, end, radius, *a, **k):

def lookup(self, x):
# http://mathworld.wolfram.com/Point-LineDistance3-Dimensional.html
print((self.start-x).shape)
d = np.linalg.norm(np.cross(self.start-x, self.end-x), axis=1)/np.linalg.norm(self.end-self.start)
dmax = np.sqrt(np.linalg.norm(self.start-self.end)**2 + self.radius**2)
dx1 = np.linalg.norm(self.start - x, axis=1)
dx2 = np.linalg.norm(self.end - x, axis=1)
# return np.where((d<self.radius), self.inside, self.outside)
return np.where((d<self.radius)&(dx1<dmax)&(dx2<dmax), self.inside, self.outside)
# FIXME: cylinder has infinite length

class Box(Constraint):
def __init__(self, start=None, center=None, diagonal=None, end=None,
Expand Down
361 changes: 317 additions & 44 deletions examples/SimpleTrap/SimpleTrap.ipynb

Large diffs are not rendered by default.

Binary file modified examples/SimpleTrap/SimpleTrap_DC1.vtk
Binary file not shown.
Binary file modified examples/SimpleTrap/SimpleTrap_DC1_mesh.vtk
Binary file not shown.
Binary file modified examples/SimpleTrap/SimpleTrap_DC2.vtk
Binary file not shown.
Binary file modified examples/SimpleTrap/SimpleTrap_DC2_mesh.vtk
Binary file not shown.
Binary file modified examples/SimpleTrap/SimpleTrap_DC3.vtk
Binary file not shown.
Binary file modified examples/SimpleTrap/SimpleTrap_DC3_mesh.vtk
Binary file not shown.
Binary file modified examples/SimpleTrap/SimpleTrap_DC4.vtk
Binary file not shown.
Binary file modified examples/SimpleTrap/SimpleTrap_DC4_mesh.vtk
Binary file not shown.
Binary file modified examples/SimpleTrap/SimpleTrap_DC5.vtk
Binary file not shown.
Binary file modified examples/SimpleTrap/SimpleTrap_DC5_mesh.vtk
Binary file not shown.
Binary file modified examples/SimpleTrap/SimpleTrap_RF.vtk
Binary file not shown.
Binary file modified examples/SimpleTrap/SimpleTrap_RF_mesh.vtk
Binary file not shown.
Binary file modified examples/SimpleTrap/SimpleTrap_mesh.vtk
Binary file not shown.

0 comments on commit 3c161c3

Please sign in to comment.