How to code an array of FCC, BCC and HCP lattices in C++

8.4k views Asked by At

How could these structures be represented in an array or vector while still maintaining the lengths between atoms in C++?

I would like to construct a three dimensional vector to represent the configuration of:

An FCC Lattice. FCC

A BCC Lattice BCC

A HCP Lattice. HCP

A standard three dimensional vector is essentially a SC Lattice: SC

The above are depictions of unit cells, the full lattices look like: Structures And for HCP: HCP structure

The reasons behind it is to more accurately represent the crystal structure of a material using an Ising Model. I would like the lattice to preserve lengths in order to give an accurate calculation of the exchange constant.

1

There are 1 answers

5
Ben Voigt On BEST ANSWER

BCC is two SC lattices offset from each other. HCP is an SC lattice skewed.

You'll simply take the crystal structure into account for length calculations. Trying to make indices or memory address correspond to length is an exercise in futility. Just have a mapping function from indices to length.