Skip to content

Commit cea93d3

Browse files
committed
Claude generated: Update of the light-up specific comments
Had Claude help generate all of the new comments for the light-up related scripts such that we no longer have the cubic related stuff in it.
1 parent 0954f4c commit cea93d3

File tree

3 files changed

+226
-75
lines changed

3 files changed

+226
-75
lines changed

src/options.toml

Lines changed: 49 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -629,38 +629,75 @@ grain_file = "grains.txt"
629629
avg_elastic_strain_fname = "avg_elastic_strain.txt"
630630

631631
# ===== Crystal Orientation Analysis (Light-Up) =====
632-
# Tracks which crystals are favorably oriented for slip
633-
# Useful for: texture evolution, identifying active grains
632+
# Tracks which crystals are favorably oriented for slip across all crystal systems
633+
# Supports cubic, hexagonal, trigonal, rhombohedral, tetragonal, orthorhombic, monoclinic, triclinic
634+
# Useful for: texture evolution, identifying active grains, powder diffraction simulation
634635
[[PostProcessing.light_up]]
635636
# Enable this analysis
636637
enabled = true
637638

638639
# Which material to analyze (must match Materials.material_name)
639640
material_name = "aluminum_alloy"
641+
642+
# Crystal system type - determines symmetry operations and lattice parameter requirements
643+
# Supported values: 'CUBIC', 'HEXAGONAL', 'TRIGONAL', 'RHOMBOHEDRAL',
644+
# 'TETRAGONAL', 'ORTHORHOMBIC', 'MONOCLINIC', 'TRICLINIC'
645+
laue_type = 'CUBIC'
640646

641647
# Crystal directions to monitor [h,k,l]
642648
# These are Miller indices in crystal coordinates
643-
# Example: [1,1,1] = octahedral slip, [1,1,0] = prismatic
649+
# Examples: [1,1,1] = octahedral planes, [1,0,0] = cube faces, [1,1,0] = cube edges
650+
# For hexagonal: [1,0,0] = basal, [0,0,1] = c-axis, [1,1,0] = prismatic
644651
hkl_directions = [[1, 1, 1], [1, 0, 0], [1, 1, 0]]
645652

646653
# Angular tolerance in radians
647-
# Grains within this angle of target are "lit up"
648-
# 0.0873 radians ≈ 5 degrees
654+
# Grains within this angle of target direction are considered "in-fiber"
655+
# 0.0873 radians ≈ 5 degrees, 0.1745 radians ≈ 10 degrees
649656
distance_tolerance = 0.0873
650657

651658
# Sample direction in lab coordinates [x,y,z]
652-
# Used as reference for orientation analysis
653-
# [0,0,1] = Z direction (loading direction)
659+
# Used as reference for orientation analysis and lattice strain calculations
660+
# [0,0,1] = Z direction (typical loading direction)
661+
# [1,0,0] = X direction, [0,1,0] = Y direction
654662
sample_direction = [0.0, 0.0, 1.0]
655663

656-
# Crystal lattice parameters [a, b, c] in Angstroms
657-
# For cubic: a=b=c, for hexagonal: a=b≠c
658-
# Used for crystallographic calculations
659-
lattice_parameters = [3.6, 3.6, 3.6]
664+
# Crystal lattice parameters - requirements vary by crystal system:
665+
# CUBIC: [a] (lattice parameter in Angstroms)
666+
# HEXAGONAL: [a, c] (basal and c-axis parameters in Angstroms)
667+
# TRIGONAL: [a, c] (basal and c-axis parameters in Angstroms)
668+
# RHOMBOHEDRAL: [a, alpha] (lattice parameter in Angstroms, angle in radians)
669+
# TETRAGONAL: [a, c] (basal and c-axis parameters in Angstroms)
670+
# ORTHORHOMBIC: [a, b, c] (three lattice parameters in Angstroms)
671+
# MONOCLINIC: [a, b, c, beta] (three lattice parameters in Angstroms, monoclinic angle in radians)
672+
# TRICLINIC: [a, b, c, alpha, beta, gamma] (three lattice parameters in Angstroms, three angles in radians)
673+
lattice_parameters = [3.6] # Cubic aluminum: a = 3.6 Angstroms
660674

661675
# Base name for output files
662-
# Creates files like: lattice_avg_111.txt, lattice_avg_100.txt
676+
# Creates files like: lattice_avg_directional_stiffness.txt, lattice_avg_dpeff.txt, lattice_avg_strains.txt...
677+
# File naming automatically includes region number as well as quantity related to it
663678
lattice_basename = "lattice_avg_"
679+
680+
# Example: Hexagonal crystal system (e.g., titanium, zinc)
681+
# [[PostProcessing.light_up]]
682+
# enabled = true
683+
# material_name = "titanium_alloy"
684+
# laue_type = 'HEXAGONAL'
685+
# hkl_directions = [[1, 0, 0], [0, 0, 1], [1, 1, 0]] # basal, c-axis, prismatic
686+
# distance_tolerance = 0.0873
687+
# sample_direction = [0.0, 0.0, 1.0]
688+
# lattice_parameters = [2.95, 4.68] # a = 2.95 Å, c = 4.68 Å for Ti
689+
# lattice_basename = "ti_lattice_"
690+
691+
# Example: Rhombohedral crystal system (e.g., some ceramics, bismuth)
692+
# [[PostProcessing.light_up]]
693+
# enabled = true
694+
# material_name = "rhombohedral_ceramic"
695+
# laue_type = 'RHOMBOHEDRAL'
696+
# hkl_directions = [[1, 1, 1], [1, 0, 0], [1, 1, 0]]
697+
# distance_tolerance = 0.0873
698+
# sample_direction = [0.0, 0.0, 1.0]
699+
# lattice_parameters = [4.75, 1.0472] # a = 4.75 Å, alpha = 60° = 1.0472 radians
700+
# lattice_basename = "rhombo_lattice_"
664701

665702
# ===== Field Projections =====
666703
# Projects integration point data to nodes for visualization

src/postprocessing/mechanics_lightup.cpp

Lines changed: 55 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,34 @@ std::string get_lattice_basename(const std::string& lattice_basename, const int
8383
"_";
8484
}
8585

86+
/**
87+
* @brief Get crystallographic point group symmetry operations
88+
*
89+
* @param lattice_type Crystal system type specifying the point group
90+
* @return Vector of quaternions representing symmetry operations
91+
*
92+
* Returns the complete set of point group symmetry operations for the
93+
* specified crystal system as quaternions in the form [angle, x, y, z].
94+
* Each quaternion represents a rotation operation that maps crystallographic
95+
* directions to their symmetrically equivalent counterparts.
96+
*
97+
* The number and type of symmetry operations depend on the crystal system:
98+
* - Cubic: 24 operations (identity, 3-fold, 4-fold, 2-fold rotations)
99+
* - Hexagonal: 12 operations (identity, 6-fold, 3-fold, 2-fold rotations)
100+
* - Trigonal: 6 operations (identity, 3-fold, 2-fold rotations)
101+
* - Rhombohedral: 6 operations (identity, 3-fold about [111], 2-fold perpendicular to [111])
102+
* - Tetragonal: 8 operations (identity, 4-fold, 2-fold rotations)
103+
* - Orthorhombic: 4 operations (identity, three 2-fold rotations)
104+
* - Monoclinic: 2 operations (identity, one 2-fold rotation)
105+
* - Triclinic: 1 operation (identity only)
106+
*
107+
* These symmetry operations are used by LatticeTypeGeneral to generate
108+
* symmetrically equivalent HKL directions for lattice strain calculations
109+
* in powder diffraction simulations.
110+
*
111+
* @note Quaternions use the convention [angle, axis_x, axis_y, axis_z]
112+
* where angle is in radians and the axis is normalized.
113+
*/
86114
std::vector<std::array<double, 4>> GetSymmetryGroups(const LatticeType& lattice_type)
87115
{
88116
// If not mentioned specifically these are taken from:
@@ -209,44 +237,44 @@ std::vector<std::array<double, 4>> GetSymmetryGroups(const LatticeType& lattice_
209237
return lattice_symm;
210238
}
211239

212-
size_t GetNumberSymmetryOperations(const LatticeType& lattice_type) {
213-
return GetSymmetryGroups(lattice_type).size();
214-
}
215-
216240
/**
217-
* @brief Constructor for any lattice structure
241+
* @brief Get number of symmetry operations for a crystal system
242+
*
243+
* @param lattice_type Crystal system type specifying the point group
244+
* @return Number of symmetry operations in the point group
218245
*
219-
* @param lattice_param_a Array of lattice parameters
220-
* 'cubic' a
221-
* 'hexagonal' a, c
222-
* 'trigonal' a, c
223-
* 'rhombohedral' a, alpha (in radians)
224-
* 'tetragonal' a, c
225-
* 'orthorhombic' a, b, c
226-
* 'monoclinic' a, b, c, beta (in radians)
227-
* 'triclinic' a, b, c, alpha, beta, gamma (in radians)
228-
* @param lattice_param_type Crystallographic lattice type
246+
* Returns the total number of symmetry operations for the specified
247+
* crystal system's point group. This count includes the identity operation
248+
* and all rotational symmetries of the crystal structure.
229249
*
230-
* Initializes any lattice structure by computing reciprocal lattice
231-
* vectors and generating the various symmetry quaternions.
250+
* The count varies by crystal system:
251+
* - Cubic: 24 symmetry operations
252+
* - Hexagonal: 12 symmetry operations
253+
* - Trigonal: 6 symmetry operations
254+
* - Rhombohedral: 6 symmetry operations
255+
* - Tetragonal: 8 symmetry operations
256+
* - Orthorhombic: 4 symmetry operations
257+
* - Monoclinic: 2 symmetry operations
258+
* - Triclinic: 1 symmetry operation
259+
*
260+
* This function is used to initialize the NSYM member variable in
261+
* LatticeTypeGeneral and to allocate appropriate storage for
262+
* symmetry-related calculations.
263+
*
264+
* @see GetSymmetryGroups() for the actual symmetry operation quaternions
232265
*/
266+
size_t GetNumberSymmetryOperations(const LatticeType& lattice_type) {
267+
return GetSymmetryGroups(lattice_type).size();
268+
}
269+
270+
233271
LatticeTypeGeneral::LatticeTypeGeneral(const std::vector<double>& lattice_param_a, const LatticeType& lattice_type) :
234272
NSYM(GetNumberSymmetryOperations(lattice_type))
235273
{
236274
symmetric_quaternions(lattice_type);
237275
compute_lattice_b_param(lattice_param_a, lattice_type);
238276
}
239277

240-
/**
241-
* @brief Compute reciprocal lattice parameter matrix
242-
*
243-
* @param lparam_a Direct lattice parameters [a, b, c, alpha, beta, gamma]
244-
*
245-
* Computes the reciprocal lattice vectors (lattice_b matrix) from
246-
* direct lattice parameters. For cubic crystals, assumes 90-degree
247-
* angles between axes. The reciprocal lattice is used to transform
248-
* HKL indices to direction vectors in reciprocal space.
249-
*/
250278
void
251279
LatticeTypeGeneral::compute_lattice_b_param(const std::vector<double>& lparam_a, const LatticeType& lattice_type)
252280
{

0 commit comments

Comments
 (0)