altavir
05/08/2023, 1:02 PMaltavir
07/05/2023, 6:52 AMaltavir
07/19/2023, 7:23 PMelect
08/01/2023, 10:05 AMelect
08/01/2023, 10:07 AMaltavir
09/04/2023, 1:25 PMaltavir
12/14/2023, 6:02 PMaltavir
02/04/2024, 1:43 PMelect
07/08/2024, 12:36 PMsnap_descriptors_np = extract_compute_np(
lmp,
"bgrid",
0,
2,
(nz, ny, nx, self.fingerprint_length),
use_fp64=use_fp64,
)
lmp.close()
# switch from x-fastest to z-fastest order (swaps 0th and 2nd dimension)
snap_descriptors_np = snap_descriptors_np.transpose([2, 1, 0, 3])
where extract_compute_np
returns a flat doubleArray representing an ndarray of [nz, ny, nx, self.fingerprint_length]
now, I have to swap the 0 and 2nd dimensions and I'm trying to do this:
Array(nx) { x ->
Array(ny) { y ->
Array(nz) { z ->
val ofsX = x * (ny * nz * fingerprintLength)
val ofsY = y * (nz * fingerprintLength)
val ofsZ = z * fingerprintLength
DoubleArray(fingerprintLength) { doubles[ofsX + ofsY + ofsZ + it] }
}
}
}
but it looks like it's wrong, anyone spots the problem?Amir H. Ebrahimnezhad
08/14/2024, 6:14 PMAmir H. Ebrahimnezhad
08/14/2024, 6:16 PMAmir H. Ebrahimnezhad
08/14/2024, 6:21 PMaltavir
08/14/2024, 6:31 PMaltavir
08/14/2024, 6:33 PMAmir H. Ebrahimnezhad
08/14/2024, 6:34 PMaltavir
08/14/2024, 6:42 PMAmir H. Ebrahimnezhad
08/14/2024, 6:44 PMaltavir
08/14/2024, 6:45 PMaltavir
08/14/2024, 6:46 PMAmir H. Ebrahimnezhad
08/14/2024, 6:46 PMAmir H. Ebrahimnezhad
08/16/2024, 6:04 PMfun main() {
// a basket for your atoms
val env = Environment()
// add to it like any of these methods
env.add(atomOf(AtomicMass.C, Point(0, 0, 0), 1))
env.add(H2(Point.randomOrientation * 10))
// use sequence api to your advantage, or reinvent them yourselves
Grid3D(20, 20, 20)
.points
.map { it * 1.5 } // scale
// .map { it.rotateZ(45.toRad()) } // rotate
.map { it + (Point.xHat * 12) } // translate
.filter { it isInside sphereShape } // filter
.map { atomOf(AtomicMass.C, it,1) } // generate
.forEach { env.add(it) } // add
env.toLammpsInputFile("Hello.data")
// visualize a bit, it helps
KoolVisualizer()
.withDefaultConfig()
.addPlugin(AxisPlugin())
.addPlugin(BoxViewerPlugin(env.enclosingBox))
.init()
.addEnvironment(env)
.runAndWaitUntilExit()
}
val sphereShape = Sphere(Point(22,12,12), 10)
class H2(origin: Point) : Molecule(type = 3) {
init {
val eps = Point.xHat * 0.3
val h1 = Atom(origin - eps, AtomicMass.H.mass, 4)
val h2 = Atom(origin + eps, AtomicMass.H.mass, 4)
atoms.addAll(listOf(h1, h2))
// bonds.add()
}
}
altavir
08/21/2024, 11:58 AMAmir H. Ebrahimnezhad
08/21/2024, 2:12 PMAmir H. Ebrahimnezhad
08/21/2024, 2:18 PMaltavir
08/21/2024, 2:19 PMaltavir
10/11/2024, 6:31 PMaltavir
01/19/2025, 11:53 AMaltavir
02/04/2025, 6:30 AMaltavir
02/13/2025, 4:46 AMaltavir
03/21/2025, 8:41 AMVision
class from VisionForge and Plotly-kt server uses VisionForge
server mechanics. The package is chanced from plotlykt-...
to plotly-kt-...
and version now follows VisionForge versioninng. Meaning that from space.kscience:plotlykt-core:0.7.2
we are going to space.kscience:plotly-kt-core:0.5.0
.
Notebook versions are still not fully functional because Notebooks do not work properly with Kotlin 2.x. It will be fixed in the future (as soon it is fixed in notebook kernel).