RenderableSimulationBox

Inherits Renderable

Renders a molecular dynamics simulation with multiple molecule types in a periodic boundary box. This can for example be used to show the distribution of different molecules or atoms in a specific spatial region, such as a planet’s atmosphere.

Multiple molecules can be provided and for each the path containing the structural data and the count of molecules has to be provided. Specifying the trajectory file that describes the movement of each individual molecule in its own relative frame, is optional.

Members

Name

Documentation

Type

Description

Optional

AngularVelocity

Average angular velocity at the start of the simulation (radians/s).

Double

Value of type ‘Double’

No

CollisionRadius

Radius of the collision sphere around molecules.

Double

Value of type ‘Double’

No

LinearVelocity

Average linear velocity at the start of the simulation (m/s).

Double

Value of type ‘Double’

No

Molecules

The list of files that are used to initiate this simulation box.

Table

Table parameters

No

SimulationBox

Size of the periodic simulation box.

Vector3<double>

Value of type ‘Vector3

No

AnimationSpeed

Playback speed of the animation (in frames per second).

Double

Value of type ‘Double’

Yes

CircleColor

Color of the circle outlining the simulation.

Vector4<double>

Value of type ‘Vector4

Yes

CircleFalloff

Falloff exponent of the circle outlining the simulation.

Double

Value of type ‘Double’

Yes

CircleWidth

Width of the circle outlining the simulation.

Double

Value of type ‘Double’

Yes

Coloring

Uniform, The color mapping for the atoms.

String

In list { Cpk, AtomIndex, ResId, ResIndex, ChainId, ChainIndex, SecondaryStructure }

Yes

DimInAtmosphere

Decides if the object should be dimmed (i.e. faded out) when the camera is in the sunny part of an atmosphere.

Boolean

Value of type ‘Boolean’

Yes

Enabled

Determines whether this object will be visible or not.

Boolean

Value of type ‘Boolean’

Yes

Filter

The filter used to remove parts of the dataset.

String

Value of type ‘String’

Yes

Opacity

This value determines the opacity of this renderable. A value of 0 means completely transparent.

Double

In range: ( 0, 1)

Yes

RenderBinMode

A value that specifies if the renderable should be rendered in the Background, Opaque, Pre-/PostDeferredTransparency, Overlay, or Sticker rendering step.

String

In list { Background, Opaque, PreDeferredTransparent, Overlay, PostDeferredTransparent, Sticker }

Yes

Representation

The visual representation type to use for the molecule.

String

In list { SpaceFill, Licorice, Ribbons, Cartoon }

Yes

RepScale

Thickness of the atoms when using the Space Fill or Licorice representations.

Double

Value of type ‘Double’

Yes

SimulationSpeed

Adjust the speed of the simulation (seconds per second).

Double

Value of type ‘Double’

Yes

Tag

A single tag or a list of tags that this renderable will respond to when setting properties.

Table, or String

Value of type ‘Table’, or Value of type ‘String’

Yes

Type

The type of the renderable.

String

Value of type ‘String’

Yes

Inherited members from Renderable

Name

Documentation

Type

Description

Optional

DimInAtmosphere

Decides if the object should be dimmed (i.e. faded out) when the camera is in the sunny part of an atmosphere.

Boolean

Value of type ‘Boolean’

Yes

Enabled

Determines whether this object will be visible or not.

Boolean

Value of type ‘Boolean’

Yes

Opacity

This value determines the opacity of this renderable. A value of 0 means completely transparent.

Double

In range: ( 0, 1)

Yes

RenderBinMode

A value that specifies if the renderable should be rendered in the Background, Opaque, Pre-/PostDeferredTransparency, Overlay, or Sticker rendering step.

String

In list { Background, Opaque, PreDeferredTransparent, Overlay, PostDeferredTransparent, Sticker }

Yes

Tag

A single tag or a list of tags that this renderable will respond to when setting properties.

Table, or String

Value of type ‘Table’, or Value of type ‘String’

Yes

Type

The type of the renderable.

String

Value of type ‘String’

Yes

Table parameters for Molecules

The list of files that are used to initiate this simulation box.

  • Optional: No

Name

Documentation

Type

Description

Optional

*

Table

Table parameters

Yes

Table parameters for *

  • Optional: Yes

Name

Documentation

Type

Description

Optional

Count

How many of this type of molecule should be rendered in the simulation box.

Integer

Greater or equal to: 0

No

MoleculeFile

The path to a molecule file that contains the structural information for the molecule.

String

Value of type ‘String’

No

TrajectoryFile

If provided, this trajectory file is used to move the individual atoms of the molecule. In addition, each molecule as a whole will be moving through the simulation box on a straight path, even if no trajectory file is provided.

String

Value of type ‘String’

Yes

Asset Examples

 1local marsAsset = asset.require("scene/solarsystem/planets/mars/globe")
 2
 3
 4
 5local moleculeCO2 = asset.resource({
 6  Name = "Molecule CO2",
 7  Type = "HttpSynchronization",
 8  Identifier = "molecule_dynamics_co2",
 9  Version = 1
10})
11
12
13local Latitude = 58.5877
14local Longitude = 16.1924
15
16local MarsMolecules1km = {
17  Identifier = "MarsMolecules1km",
18  Parent = marsAsset.Mars.Identifier,
19  Transform = {
20    Translation = {
21      Type = "GlobeTranslation",
22      Globe = marsAsset.Mars.Identifier,
23      Latitude = Latitude,
24      Longitude = Longitude,
25      Altitude = 1000.0
26    }
27  },
28  Renderable = {
29    Type = "RenderableSimulationBox",
30    Molecules = {
31      {
32        MoleculeFile = moleculeCO2 .. "co2.arc",
33        TrajectoryFile = moleculeCO2 .. "co2.arc",
34        Count = 1
35      }
36    },
37    LinearVelocity = 10.0,
38    AngularVelocity = math.rad(60.0),
39    SimulationBox = { 100.0, 100.0, 100.0 },
40    CollisionRadius = 2.0,
41    AnimationSpeed = 100
42  },
43  Tag = { "molecule_visualization", "molecule_atmosphere" },
44  GUI = {
45    Name = "Mars 1km",
46    Path = "/Microcosmos/Atmosphere",
47    Description = [[Visualizes Mars' atmosphere at a height of approximately 1km above the
48      surface. As Mars' atmosphere almost exclusively consists of carbon dioxide, only
49      that molecule is shown in the simulation box at an approximate density.]]
50  }
51}
52
53
54asset.onInitialize(function()
55  openspace.addSceneGraphNode(MarsMolecules1km)
56end)
57
58asset.onDeinitialize(function()
59  openspace.removeSceneGraphNode(MarsMolecules1km)
60end)
61
62asset.export(MarsMolecules1km)
63
64
65
66asset.meta = {
67  Name = "Mars Atmosphere",
68  Description = [[Visualizes Mars' atmosphere at the molecular scale.]],
69  Author = "OpenSpace Team",
70  URL = "https://openspaceproject.com",
71  License = "MIT license"
72}