Introduction

Despite the monumental strides in the extended durability and lifetime of materials, the tendency of many materials to undergo wear and tear over time remains one of their most fundamental impediments that could ultimately result in limited use and operational failure. This inherent and critical limitation has sparked a growing demand to explore alternative smart material architectures that encode some animate abilities to quickly and efficiently repair themselves and restore their original properties1,2,3. As a result, self-healing materials have gained significant attention, and major efforts have been dedicated to developing amorphous self-healable materials such as polymers1,2,3,4,5,6. More recently, the concept of dynamic crystals7,8,9,10,11,12,13,14,15,16,17 was expanded to include the self-healing of molecular crystals as an emergent materials class of ordered, solid entities, leading to some exciting advancements18,19,20,21,22,23,24,25,26,27 that are thought to hold the potential to circumvent some of the natural limitations of the commonly used polymers. Since the first reported example of self-healing molecular crystals, where a modest healing efficiency of 6.7% was achieved using dynamic covalent bonds18, this breakthrough opened doors to exploring other crystalline systems. The manifold of examples has been expanded to accomplish this feat using a variety of interactions such as ionic diffusion19,20,21, crystal-polymer interactions22, and other mechanisms23,24,25,26,27. As the field advanced, the healing efficiency in molecular crystals was improved to 67% by using dynamic covalent chemistry23, and more recently, self-healing efficiencies of 82% were accomplished by ionic diffusion in single crystals of a hybrid perovskite19. Although the research community has eventually endorsed the concept of self-healing molecular crystals, the progress has not been paralleled with the development of the methodology used for its characterization, and except for occasional quantification that uses optical means26, the proneness of molecular crystals to heal is exclusively tested mechanically. More importantly, translating the concept of self-healing molecular crystals into practice is seen as impractical, as it requires a very long contact time, typically at least 24 h, and attaining a nearly perfect alignment between the fragments to maximize the contact remains challenging. Additional technical challenges related to the misalignment, such as fallout or accumulation of debris over repeated attachment, add further to this concept currently being restricted to academic research curiosity. Here, we report the efficient, rapid, and robust healing capabilities of an organic ionic crystal, anilinium bromide (AniHBr), that can heal up to 95% via ferroelastic detwinning by mild compression. A combination of surface analysis by scanning electron microscopy (SEM), atomic force microscopy (AFM), and computerized tomography (CT) corroborated the temporal mechanism of the healing of crystals over time, and digital image correlation (DIC) aided the spatial visualization of the strain developed during the reversible twinning, fracture, and self-repair. The thorough exploration of the robust self-healing properties of this material not only presents a fresh approach in the quest for organic materials with enhanced ability to maintain and recover their macroscopic mechanical integrity, but it also uncovers the potential of using structural traits that are available with and specific to the ordered solid state to overcome the key challenges that currently stand in the way of more comprehensive practical implementation of organic crystals in organic electronics and photonics.

Results and discussion

Monoclinic crystals (P21/m) of AniHBr (Fig. 1a, b) were grown by mixing hydrobromic acid (>48%) with freshly distilled aniline in methanol and allowing the solution to evaporate slowly. The material is known to have several phases28,29, including two solid phases around room temperature—a high-temperature orthorhombic above and a monoclinic one below ca. 23.85 °C28. The material handling was facilitated by the large size of the crystals that typically separate from the solution as well-formed rectangular plates of up to 10 mm × 4 mm × 1 mm. The crystals are, however susceptible to degradation by extended exposure to humid environments or repeated heating and cooling, and therefore the temperature effects could not be studied in detail. Although AniHBr is not inherently fluorescent, the crystals were found to emit green light under UV radiation due to the occlusion of small amounts of phenazine (P) obtained by oxidation of aniline in air30, and this impurity turned out to be a convenient probe for visualization of the structural changes upon twinning (vide infra). The identity of the guest was confirmed by its fluorescence at 472 and 500 nm (Fig. 1c) with a lifetime of 1.4 ns (Fig. 1d), as well as from the mass spectrum of a benzene extract of the pulverized crystals (Supplementary Fig. 1). The inclusion of minute amounts of small molecules in organic crystals is fairly common, and the guest frequently adopts the preferred orientation within the host crystal31,32,33,34,35,36. The orientation of the statistically isolated molecules of P in AniHBr (P@AniHBr) was confirmed from the linearly polarized microscopic images (Supplementary Fig. 2), where the emission is strongest when the b axis is in the plane of the polarized light and is the lowest when it is orthogonal, indicating alignment of the transition dipole moment vector of the guest along the crystallographic b axis of the host lattice. An attempt was made to quantify the amount of P by Scanning Fluorescence Correlation Spectroscopy (sFCS; Fig. 1d‒f), which provides the local concentration and diffusion rates of fluorescently tagged biomolecules in solution37. However, the molecules of P are embedded and restricted within the crystal structure, preventing translational diffusion and rendering sFCS unsuitable for that purpose. The sample plane was continuously scanned by the excitation volume to generate intensity fluctuations that can be analyzed by calculating the signal autocorrelation function. The fluorescent bursts that were generated each time the laser beam passed by the guest molecules fixed in the crystal matrix were used to analyze the autocorrelation function (for details, see the Methods section). The concentration of P in the crystal averaged over ten different locations was found to be about 3.32 µM (Fig. 1f), and its lifetime distribution was identical throughout the parent and twinned domains, τ = 1.4 ± 0.1 ns (Fig. 1d, e).

Fig. 1: Spectroscopic and physical properties of the ferroelastic P@AniHBr crystals.
figure 1

a, b Chemical structures of anilinium bromide (AniHBr) and phenazine (P) occluded at a concentration of about 3.32 µM in the host crystal (a), and optical (a) and fluorescence (b) images of a partially twinned P@AniHBr crystal. The twinned domain is seen as a strip running diagonally in the middle of the crystal. c Fluorescence spectra of crystalline P@AniHBr (red), pure AniHBr dissolved in methanol (black), and P dissolved in methanol (blue). d, e Fluorescence lifetime mapping of the parent and twinned domains. f Auto-correlation traces were obtained using Scanning Fluorescence Correlation Spectroscopy (sFCS) of the parent domain. g Optical and fluorescence images of a single crystal upon partial twinning and detwinning. h Schematic representation of the mechanism of ferroelastic deformation that occurs upon reversible twinning with the molecular arrangement shown within the parent and twinned domains.

The crystals of AniHBr are capable of ferroelastic twinning in response to mechanical pressure on their (100)/(\(\bar{1}\)00) facets (Fig. 1g, h). Application of force on (010)/(0\(\bar{1}\)0) switches the twinned domain back to its original orientation and detwins the crystal (henceforward, “detwinned” is used to distinguish this reverted domain from sectors of the crystal that have not been subject to twinning, since they were found to be spectroscopically different, vide infra). The twinned domain is easily identifiable as a phase boundary running at ca. 48° relative to the long axis of the crystal along its (110) plane (Fig. 1b), and its structure was further confirmed by face indexing based on X-ray diffraction images collected from a larger twinned region of the crystal (Supplementary Fig. 3). Crystals of AniHBr are also known to undergo thermally induced ferroelastic phase transition between the orthorhombic and monoclinic phases28.

During the mechanical tests, we observed that cracked crystals of P@AniHBr are capable of robust self-repair. If additional force is applied to an already twinned crystal, a crack develops along its a axis (|| [100]). Once the crystal has been visibly fractured, the application of force along the b axis (|| [010]) results in a complete and visually rather impressive restoration of the integrity of the crystal (Fig. 2a‒d, Supplementary Movie 1). Typically, the restoration occurs without observable permanent scarring, though occasionally visible defects remain when the healing is incomplete. Additionally, if the crystals are completely separated into two pieces, they are unable to be reattached, presumably due to poor interfacial alignment. The operations of partial separation and healing were replicated by in situ mechanical analysis under a scanning electron microscope, where a crystal of P@AniHBr was mounted on a tensile tester and then imaged while it was subjected to controlled tension and compression (Supplementary Movies 2 and 3). The crystal was first pulled into tension to generate a single twinned domain, and the tension was continued until a crack evolved along the [100] direction (Fig. 2e). The sample was subsequently compressed until the crack had almost completely disappeared and the crystal had healed (Fig. 2e–h). The cracking and healing cycles under tension and compression were performed three times, confirming reversibility of the process. Additionally, self-healing the crystal under the high-vacuum conditions within the SEM confirms that self-healing occurs without the necessity of the presence of atmospheric water.

Fig. 2: Self-healing in a fractured, twinned crystal of P@AniHBr.
figure 2

ad Optical images of a crystal of P@AniHBr that has been partially separated and then healed by light compression taken at time points 0, 17, 28, and 49 s. eh A series of electron micrographs of a crystal being compressed and healed in situ by using a tensile tester. i, j Optical images of a crystal that has been partially separated (i) and subsequently partially healed (j). k, l Contrast contour map extracted from the optical data in (i) and (j) with the purple color representing the crack and the light blue color portraying the pristine and healed regions. m, n Atomic force microscopy was performed on the edge of the crack of the partially healed region (m), and the height profiles of lines 1 (black) and 2 (blue) extracted (n), showing the continuous surface found on line 2 and the tip of the cracked surface of line 1. ot Computed microtomography (CT) scan of the surface of a crystal that is pristine (o), partially broken (p), and healed (q), and two-dimensional cross-sectional slices of the CT scan of the pristine (r), cracked (s), and healed (t) crystal.

The nanoscopic features of the healing in a cracked and then healed crystal (Fig. 2i, j) were observed on a crystal that was cracked and subsequently only partially healed to provide an area of reference for the region where the healing occurred. In the contrast contour map in Fig. 2k, l, the region initially marked in purple, depicting the crack, notably shrinks and shifts to light blue, confirming the healing. The height profiles recorded by AFM on the area right below and above the tip of the crack, labeled as lines 2 and 1, respectively, in Fig. 2m, are shown in Fig. 2n. While the height profile of line 1 shows the expected separation between the two pieces, the height profile of line 2 shows that the healed region just below the crack is continuous, and the healed region is uniform, with the surrounding surfaces being devoid of scarring. Since the interior of the crystal is not accessible with microscopy, we turned to computerized tomography (CT) to reconstruct the density of its bulk. Initially, a pristine single crystal of P@AniHBr was scanned, and two-dimensional slices of the three-dimensional scan were generated (Fig. 2o, r). Subsequently, the crystal was compressed to initiate twinning and compressed further to induce partial fracture (Fig. 2p, s). The fracture was clearly visible and is shown in Fig. 2p as a black region with nearly zero density. When the crystal was compressed along the [010] direction, the two pieces were brought together, facilitating healing and complete recovery of the density (Fig. 2q, t).

To investigate the strain developed by ferroelasticity and its generation in self-healed crystals, Digital Image Correlation (DIC) analysis was used to capture real-time strain maps of the dynamic process of ferroelastic deformation. The spatial strain distribution during the generation of twin domains, their growth, and reversible detwinning occurred without any physical intervention with the sample during deformation38,39,40. A paint-speckled sample was subjected to uniaxial extension, and a high-definition camera was used to track the position of speckled features during deformation. The DIC algorithm divided images into subsets and tracked the deformed frame relative to the reference frame through temporal matching and correlation functions41,42. To that end, the surface of a single flat crystal of P@AniHBr was speckled, a procedure that did not affect the crystallinity or the internal structure of the sample, as confirmed by X-ray diffraction analysis (Supplementary Fig. 4). The crystal was affixed to a universal testing machine (UTM) at both ends (clamped boundary condition), subjected to uniaxial load by imposing a triangular displacement profile (Supplementary Methods), and partially twinned by application of tensile load along the [010] (defined as x) direction (Fig. 3a). This triangular profile comprises a linear increase (i.e., tension) with time for 25 μm at a displacement rate of 0.3 mm min–1, followed by a symmetric linear decrease (i.e., compression) at the same rate back to the starting point. The process was video-recorded (Supplementary Movie 4), while simultaneously recording the force (F) with a sensitive force sensor. Figure 3b shows the equivalent strain map, εV (von Mises strain), for the tensile portion of the test at 0 and 24 μm. The recorded force-displacement profile shown in Fig. 3c for cycle 1 reveals a rapid increase in F of up to 0.2 μm, followed by a plateau at ~0.33 N, maintained until 24 μm. The onset of this plateau coincides with the onset of twinning, while the plateau reflects ductile deformation, in line with the one observed upon application of flexural load on crystals (Supplementary Fig. 5). The strain maps for δ = 0–24 μm provide quantification of the strain, which demonstrates the gradual emergence and progression of the twinning band within the crystal (Supplementary Movie 4). The progression of the twin domain extended to 24 μm, with a maximum strain of εV = 0.1. At 24 μm, the displacement was reversed in direction, resulting in a change in force that reached F = –0.32 N for compression. During this stage, the twinned domain shown in the strain map quickly subsided and disappeared when the rigid crosshead of the UTM returned to its starting point. Thus, the strain maps demonstrate full detwinning of the twinned region during compression (Fig. 3b). The twinning-detwinning cycle was repeated twice, inducing a rupture during the third cycle, as evidenced in both the load–displacement and strain–time curves (Fig. 3c, d). Figure 3d reveals that the crystal is capable of undergoing two complete cycles with a negligible deterioration in peak force. However, during the third cycle, the crystal seems to have exhausted its twining capacity due to permanent changes at a molecular level, possibly due to the accumulation of defects.

Fig. 3: Digital image correlation (DIC) analysis of reversible twinning of a P@AniHBr crystal.
figure 3

a A crystal placed in a UTM and subjected to uniaxial, controlled displacement, \(\delta\). F is the recorded force. b An equivalent strain map corresponding to a single cycle of twinning and detwinning. εV is the von Mises strain (equivalent strain). c Force–displacement curves for three cycles of tension and compression. d Percent strain–time curve for three cycles of tension and compression. e, f Optical images of the same pristine, cracked (the fracture is marked by an orange arrow), and healed sample are shown before (e) and after (f) speckling. f shows images of the speckled sample tested under uniaxial tensile loading. The fracture is indicated by a red arrow. g Equivalent strain maps of a healed crystal that was subjected to uniaxial tension. The red circle indicates the previously healed region and the yellow arrow highlights the location of the newly formed crack. h Force–displacement curves showing the processes of twinning, followed by a fracture of a crystal that has been previously ruptured and healed.

Further understanding of the detwinning at an atomistic level was provided by molecular dynamics simulations of the effect of repeated tensile and compression loading (Supplementary Fig. 6). The results show that the anilinium ions first approach a flattened intermediate state at ~10% tensile strain along (100)/(\(\bar{1}\)00). Upon further tension, most ions return to the crystalline states, while some ions rotate strongly to form a new domain along the [110] direction. Under reversed compression (7%) along (100)/(\(\bar{1}\)00), the ions in the new domain adopt an ordered alignment by a 90°-rotation relative to the parent phase, which matches the twin domain observed experimentally. As shown in the energy-strain profile of Supplementary Fig. 6, the twin domain is energetically unfavorable, and hence most ions in that domain are reoriented by undergoing another 90°-rotation under further reversed compression to zero strain. Due to a kinetic reason, a minor fraction of the ions may be trapped and retain their orientation during the detwinning, and thus, the energy of the whole system becomes slightly higher after the tension-compression cycle. Continuation of the tension-compression cycles on the same model results in a more active response of these locally trapped ions to the external strains relative to the other ions. Therefore, the twinning domain occurs at the same location and, at least mechanistically, resembles a structural memory effect.

We further explored the possibility of repeated self-healing of P@AniHBr by DIC analysis on previously healed crystals (Fig. 3e–h, Supplementary Fig. 7, Supplementary Movie 5). A crystal was first cracked and healed, and then the same crystal was speckled and ruptured on the tensile tester and analyzed by using DIC (Fig. 3f, g). The force-deflection curve exhibits the typical steep rise, followed by a plateau, indicative of a ferroelastic twin propagation (Fig. 3h). The sample was stretched until it ruptured, as seen from the sudden drop in force at δ = 62 μm (Supplementary Movie 5). Surprisingly, instead of the healed region designated in red in Fig. 3g—as would be expected from it being a defective site—the strain accumulated in a pristine region of the crystal, and as the crystal was pulled further, it fractured at a new location. This result indicates that the healed crack does not act as the weakest point in the crystal as one would expect from typical retesting of crack-healed materials43,44,45, and implies the overall mechanical integrity of the crystal has been largely recovered.

Next, we studied the effect of contact time on the healing efficiency and mode of rupture using a larger number of healed crystals. The average strength of pristine crystals was 4.19 ± 2.30 MPa (n = 11, Fig. 4a, b; Supplementary Fig. 8, Supplementary Table 1). The crystals were compressed on their (100)/(\(\bar{1}\)00) pair of facets until a crack formed and then healed by detwinning (Supplementary Movie 6). These healed crystals were ruptured again, immediately or 100 min after the first healing. The fracturing occurred either along the a axis in a brittle manner (“brittle rupture”, Fig. 4c, d) or along the twin boundary (“twin rupture”, Fig. 4e, f). The brittle rupture was characterized by an increase in load, followed by an abrupt drop at the failure point. Crystals tested immediately after healing showed 49% healing (n = 7, Supplementary Fig. 9, Supplementary Table 2). The crystals that were aged 100 min, however, were healed at an impressive 95% recovery (n = 10, Supplementary Fig. 10, Supplementary Table 3) due to more efficient diffusion over prolonged time. Compared with other self-healed single crystals, the AniHBr crystals demonstrated the highest healing efficiency (Fig. 4l), but not the fastest, which measured in tens of milliseconds26. The method for measuring the kinetics of self-healing however, has not been standardized, and therefore the rates of healing reported in different studies, at present, are not directly comparable. The twin rupture was characterized by a constant load with increasing displacement, indicative of the ferroelastic transition, followed by a sudden drop in the load when the material ruptures along the (110) plane. In this mode, crystals that were tested immediately and after a 100-min delay showed healing efficiencies of 20% (n = 12) and 10% (n = 2), respectively. The decrease of crystallinity during the healing is marginal, as indicated by small and expected increases in the mosaicity determined by X-ray diffraction (Supplementary Fig. 11). As shown in Fig. 4g, h, j, during both brittle and twin rupture, the intermolecular interactions on the two fracture planes [(010) for brittle and (110) for twin] are similar and primarily ionic, with distances of 3.3256(7) and 3.3400 (15) Å (Fig. 4i, j). The difference in the ultimate tensile stress probably reflects the collective contribution of the ionic interactions across the respective fracture planes. We believe that the lack of directionality of the isotropy of the ionic bonds, in addition to higher interaction energies relative to other intermolecular interactions, plays a crucial role in the re-establishment of effective contact across the contact interface.

Fig. 4: Mechanical properties of pristine and healed P@AniHBr crystals.
figure 4

Optical images (recorded under UV light by using the phenazine emission for enhanced contrast) and stress-strain profiles of a pristine crystal (a, b), healed crystal that fails by a normal rupture (c, d), and healed crystal that fails by a ferroelastic rupture at a twin boundary (e, f). The crystal structure visually demonstrates the molecular-level orientation of the brittle rupture (g) and the twin rupture (h). The zigzag lines indicate the planes across which the fracture occurs. i, j Crystal structure of AniHBr viewed perpendicularly on the bc and ab planes, showing the intermolecular interactions and distances between the anilinium nitrogen atoms and the bromide ions. k Ultimate tensile strength of healed crystals relative to their failure mechanism with time, the error bars represent the standard deviation in the tensile strength of the samples. l Comparison of the healing efficiency of different organic and hybrid organic-inorganic crystals: (1) P@AniHBr after 0 min (orange) and after 100 min (purple), (2) 3,3′,5,5′-tetramethyl-4,4′-bipyrazole26, (3) methylammoniumlead(II) iodide19, (4) 3,3-isopropoxyphenylboronic acid23, and (5) dipyrazolethiuram disulfide18. Note that in the case of compounds 2–4, the reported values are not average but instead the highest efficiencies reported for one single crystal in each case. In the case of the individual efficiency reported for the compound marked with an asterisk (3,3′,5,5′-tetramethyl-4,4′-bipyrazole, 2) the self-healing was determined using Mueller matrix microscopy, and therefore, it is not directly comparable with the other results shown here.

The healing efficiency in the brittle rupture mode of 49% and 95% for the immediate and 100 min delay, respectively, are intriguing as the crystal appears visually recovered in both cases. Several earlier reports24,26,46,47 have used optical microscopy to observe self-healing, which is an important first step for establishing self-healing in molecular crystals, however as the results in this work show, it is not ideal for quantification of self-healing with respect to mechanical strength. To confirm the degree of self-healing, complementary analyses such as mechanical testing should be performed as exclusively using optical methods appears to be inadequate. As suggested by the aforementioned simulations and the proposed mechanism (Fig. 5), the healed sample does not return to the exact same crystal configuration due to the existence of locally trapped disordered ions (Fig. 5a–d, f). From a thermodynamic point of view, it is expected that prolonged equilibration of detwinned samples over a more extended time period, without compression, can further reduce the total energy by driving more disordered molecules to return to their original crystallographic alignment (Fig. 5e, f; Supplementary Movie 7). This initial disorder and subsequent reordering of the structure after the twinning/detwinning cycle appears to create a substantial difference in healing efficiency as the immediately healed crystals are more disordered than the crystals that have been allowed to equilibrate over 100 min. Furthermore, our results demonstrated that structural reordering accelerates at higher temperatures, leading to a more rapid reduction of the system’s total energy (Supplementary Fig. 12).

Fig. 5: A cartoon illustrates the proposed self-healing mechanism in AniHBr crystals with molecular dynamics simulations in the detwinned region.
figure 5

ad Summary of the mechanism of ferroelastically assisted self-healing. A crystal is initially partially cracked along the a axis during the twinning (a) and is partially healed by compression along the b axis (b). The integrity of the crystal is restored; however, closer to the crack in the detwinned region, the structure includes locally disordered regions (c). Over time, the ions reorient to their thermodynamic favorable position (d). e Molecular dynamics simulation of AniHBr crystal under equilibration after tensile-compressive loads. The plot displays the time-dependent evolution of potential energy during thermodynamic equilibration at 325 K. f Atomic snapshots of a detwinned region corresponding to different time stamps. The ions are color-coded based on their orientation to enhance clarity. The color map represents the magnitude in angstroms relative to their equilibrium positions, with blue indicating 0 Å and yellow indicating 3 Å.

Experimental evidence corroborating the molecular reorientation within AniHBr crystals was performed in this work and in an earlier study48 by observing the realignment of acridine orange (AO) molecules and other emissive molecules occluded inside AniHBr to a polarizer. Crystals of AO@AniHBr were grown by adding small amounts of AO to the crystallization solution. Crystals of AO@AniHBr were twinned, fractured, and healed, and the fluorescence intensity in the parent, twin, and detwinned regions was monitored over time using a confocal fluorescence microscope (Supplementary Fig. 13). The intensity was highest in the parent region, followed by the detwinned region, and the lowest in the twinned region, indicating that the AO molecules in the parent region were aligned to the polarizer. The AO molecules in the detwinned area have an intermediate emission intensity, signifying they were partially aligned with the polarizer (Supplementary Fig. 13). After 100 min, the fluorescence intensity gradually recovered in the detwinned region, indicating that the AO molecules realigned to the polarizer over time. The fluorescence recovery shows that the occluded molecules are mobile48 and strongly implies the anilinium ions can also reorientate. The results support the idea that there is a degree of flexibility within the crystal, which may explain why the crystal’s mechanical strength increases when it is allowed to rest for 100 min after healing.

Approaches to complete and instantaneous recovery are highly sought after but rarely achieved, as most of the known self-healing materials require either a chemical reaction or diffusion-based interactions to occur. This study has demonstrated the rapid and efficient healing of organic crystals of about 49% within seconds under mild compression, achieving a remarkable healing efficiency of over 95% after about 2 h. The high efficiency of the self-healing reported here relies on the ideal alignment of the surfaces across the interface, which is accomplished by reversed twinning whereby the contact between the two surfaces is maximized, and the non-directionality of the ionic interactions. Intriguingly, our observations revealed that strain develops in pristine regions of the crystal, and the healed crack does not act as the weakest point in the healed crystal, possibly due to the existence of other defects. We also demonstrated that the simple visual disappearance of the crack in a healed crystal may give the impression that the material has fully healed. However, the healing efficiency in such cases was only 49%. The results emphasize the critical importance of measuring self-healing crystals using mechanical methods to confirm their restoration, as optical and visual techniques alone may be insufficient to assess the physical integrity of a material. Overall, our findings show significant mechanical recovery in the healed organic crystals within seconds even without the need for prolonged compression, showcasing that the healing process in structured organic crystals can be as fast and robust as polymers and other amorphous soft materials, further dispelling the traditional perception of these materials as mechanically inferior to other materials classes.

Methods

Synthesis and crystallization

Aniline and 48% hydrobromic acid solution were purchased from Sigma-Aldrich. The aniline was purified by distillation before use, while the other reagents were used as received without further purification. AniHBr crystals doped with phenazine were crystallized by using 0.95 mL purified aniline mixed in a flask with 10 mL of methanol and 0.45 mL of 48% hydrobromic acid. The solution was left to crystallize for 4 days and yielded fluorescent plate-like crystals. For preparation of the AniHBr crystals doped with acridine orange, 2 mg acridine orange was added to the crystallization solution, and the crystals were grown under a gentle flow of nitrogen gas.

Scanning electron microscopy (SEM)

The samples were mounted on an MTII/Fullam SEMtester designed to operate inside FEI Quanta 450 field emission scanning electron microscope. Scanning electron microscopy images were obtained using the high-vacuum mode with a primary electron energy of 2 kV and a spot size of 3, which corresponds to a beam current of approximately 0.1 nA.

Tensile testing and SEM tensile testing

The tensile measurements were performed on an MTII/Fullam SEMtester tensile tester (MTI Instruments) using a 5 lbs load cell. The crystals were mounted onto the tensile tester using a small amount of UV curable resin (Qiao UV Resin Hard) and pulled at a rate of 0.3 mm min−1. For the pristine break analysis, pristine crystals were mounted and pulled on the tensile tester. For the self-healing analysis, pristine crystals were twinned, detwinned, and then either allowed to rest for 100 min or pulled apart immediately until the crystal ruptured. The in situ experiments were performed with a tester designed to be mounted inside a FEI Quanta 450 SEM. The crystals were initially twinned, partially detwinned, and mounted onto the tensile tester using a small amount of UV curable resin (Qiao UV Resin Hard). The crystals were pulled and compressed at a rate of 0.3 mm min−1. The images were obtained using the high-vacuum mode with a primary electron energy of 2 kV and a spot size of 3, which corresponds to a beam current of approximately 0.1 nA.

Atomic force microscopy (AFM)

The AFM images were acquired on the Bruker Dimension Icon Nano surface in tapping mode. A Scanasyst-air tip with a radius of 2 nm and a resonance frequency of 70 kHz was used to scan the surface. The acquired images were processed using Gwiddyon49.

Micro-computed tomography (CT) scanning

3D scans of pristine, broken, and healed crystals were acquired on Bruker Skyscan 1272. The scans were measured at a working voltage of 55 kV and 80 μA using an aluminium filter (0.25 mm). The crystal was mounted on a silicon wax and the voxel resolution of pristine, broken, and healed crystal was 4.3 μm, 4.7 μm, and 1.3 μm respectively. The images were reconstructed and processed on CTAn and CTVox (Bruker).

Fluorescence spectroscopy

Emission spectra of phenazine and pure aniline HBr were acquired on Jasco FP8500 spectrometer. The emission spectra of pure aniline HBr was recorded at an excitation wavelength of 290 nm and the emission spectra of phenazine were recorded at an excitation wavelength of 410 nm.

Confocal fluorescence microscopy

The confocal fluorescence imaging and emission spectra acquisition of P@AniHBr and acridine orange@AniHBr single crystals was performed on a Leica TCS SP8 microscope using a PicoQuant PDL 880-B 40 MHz pulsed 405 nm diode laser as an excitation source. A 488 nm excitation wavelength was used for exciting molecules of AO@AniHBr.

Single crystal X-ray diffraction

The X‐ray diffraction data were collected by using a Bruker APEX III diffractometer equipped with a Cobra cooling device (Oxford Cryosystems) with graphite‐monochromated MoKα radiation (λ = 0.71073 Å) or CuKα radiation (λ = 1.54178 Å) and CCD as area detector. The structure was solved by direct methods, implemented in SHELXS50. The structure refinement, using the OLEX2 interface, was performed by using the full-matrix least-squares method, based on F2 against all reflections51.

Digital image correlation (DIC)

AniHBr crystals were randomly speckled with white and black paint (Rust-Oleum Specialty White/Black Flat Finish Spray). The speckles were left to dry and settle. For the ferroelastic analysis, the speckled sample was mounted on the MTII/Fullam Semtester tensile tester by gluing the crystal’s ends with UV curable resin onto two steel (rigid) arms that are connected to the moving frame of the UTM. The crystal was subjected to tensile loading by imposing a displacement-controlled loading profile on the UTM frame. The profile comprised a linear ramp and decline (a triangular displacement profile) at a rate of 0.3 mm min–1, ensuring a single cycle of load where the ends return back to the starting point. A high-definition Dino-Lite camera was positioned on top of the testing rig to capture the frames during loading. The frames were then stored and post processed using an open-source DIC package (Ncorr)42. The Ncorr package performs frame seeding, subset allocation, real-time tracking of deformed subsets, and calculations of Lagrangian strain maps. Furthermore, we computed the von Mises strains (equivalent strain) to capture the overall deformation within the crystal, which is effective in revealing the progressive twinning in the crystal.

Scanning fluorescence correlation spectroscopy (sFCS)

Custom-built two-photon laser scanning system was used to measure the concentration of phenazine doped in the crystals. The system was based on an Olympus IX70 inverted microscope with a water immersion objective (Olympus 60, 1.2 NA). The two-photon excitation laser was a titanium-sapphire laser from Tsunami, Spectra Physics. The photons were detected by an Avalanche Photodiode from APD SPCM-AQR-14-FC, Perkin Elmer. To calculate the average number of molecules in specific detection volume (N), circular scanning fluorescence correlation spectroscopy was utilized, which uses two fast galvomirrors in the de-scanned fluorescence collection mode. The correlation traces were recorded by using an online hardware correlator (ALV5000, ALV GmbH, Germany) with an excitation power of <0.5 mW (830 nm) at the sample level. The average acquisition time was 100 s. For the circular scan, 256 points were sampled at a frequency of 390 Hz with a diameter of 1 μm. The obtained curves were fitted using the following equation:

$$G\left(\tau \right)=\,\frac{1}{N}\,\frac{1}{1+\frac{\tau }{{\tau }_{D}}}\,{e}^{-\frac{{R}^{2}{\sin }^{2}(\pi f\tau )}{{a}^{2}(1+\frac{\tau }{{\tau }_{D}})}}$$
(1)

where N is the number of molecules within the detection volume, D is the apparent diffusion time, R is the radius of the detection volume, f is the sampling frequency, and a is the beam waist.

Molecular dynamics simulations

In this work, we performed molecular dynamics simulation based on the LAMMPS package52 to simulate the uniaxial tension-compression loading on the AniHBr crystal at room temperature. To mimic the experimental mechanical tests, we first applied the tensile strain from 0 to 20% with a strain rate of 1 × 108 s–1 along the [010] direction, using an initial periodic cell of 12 nm × 42 nm × 5 nm. After 100 ps equilibration, the backward compression was applied to release the tensile strain to zero with the same rate. To check the time-history dependence, we repeated the tension-compression loading for 3 cycles to collect the relations between stress, strain, and system energy. Following our recent work53, we developed a computational pipeline to automate the generation of force fields in different styles for organic system simulation. In this work, we used the General Amber Force Field framework54 with atomic charges from the semi-empirical AM1-BCC method55. The scripts can be found at https://github.com/MaterSim/OST.