File: DivCurl

package info (click to toggle)
dxsamples 4.4.0-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 26,340 kB
  • sloc: ansic: 10,079; sh: 8,445; java: 1,772; makefile: 1,102
file content (28 lines) | stat: -rw-r--r-- 884 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Import the electron density data
electrondensity = Import("watermolecule");

// Partition the data for parallelism
electrondensity = Partition(electrondensity);

// Compute the gradient of the electron density
gradientdensity = Gradient(electrondensity);

// Compute the divergence and curl of the gradient field
divergence, curl = DivCurl(gradientdensity);

// compute an isosurface of the divergence field at the mean value (default
// behavior of isosurface)
isodiv = Isosurface(divergence);

// create a set of approximately 50 samples of the data field
samples = Sample(curl, 50);

// create vector glyphs at each of the samples
glyphs = AutoGlyph(samples,"arrow");

// Collect the glyphs with the isosurface
collected = Collect(isodiv, glyphs);

// Display the collection
camera = AutoCamera(collected,"off-diagonal",resolution = 300, aspect = 1);
Display(collected,camera);