diff --git a/joss.06599/paper.jats/10.21105.joss.06599.jats b/joss.06599/paper.jats/10.21105.joss.06599.jats new file mode 100644 index 0000000000..b028b82fa8 --- /dev/null +++ b/joss.06599/paper.jats/10.21105.joss.06599.jats @@ -0,0 +1,652 @@ + + +
+ + + + +Journal of Open Source Software +JOSS + +2475-9066 + +Open Journals + + + +6599 +10.21105/joss.06599 + +ComFiT: a Python library for computational field theory +with topological defects + + + +https://orcid.org/0000-0003-4941-6886 + +Skogvoll +Vidar + + + + +https://orcid.org/0000-0001-5289-7276 + +Rønning +Jonas + + + + + +Department of Physics, University of Oslo, +Norway + + + + +Okinawa Institute of Science and Technology, +Japan + + + + +30 +5 +2024 + +9 +98 +6599 + +Authors of papers retain copyright and release the +work under a Creative Commons Attribution 4.0 International License (CC +BY 4.0) +2022 +The article authors + +Authors of papers retain copyright and release the work under +a Creative Commons Attribution 4.0 International License (CC BY +4.0) + + + +computational field theory +topological defects +Bose-Einstein condensates +phase-field crystal + + + + + + Statement of need +

Field theories described by partial differential equations (PDEs) + are the backbone of many areas in physics. Examples of such field + theories include the Navier-Stokes equations, which describe how air + flows around the wing of an airplane; the Schrödinger equation, which + governs how microscopic particles behave; Maxwell’s equations, which + explain the behavior of electromagnetic fields; and the Nobel + Prize-winning Ginzburg-Landau theory, which explains how + superconductors work. Despite their importance, simulating field + theories often requires specialized software and programming + expertise. Even though there exist specialized software packages like + FEniCS + (Alnaes + et al., 2015) for solving PDEs, these are often focused on + numerical efficiency at the cost of legibility or user-friendliness + and fall short in offering functionalities for visualizing and + analyzing outcomes. In particular, in the realm of many field + theories, the study of topological defects - small structures like + vortices in fluids - is essential for understanding phenomena such as + phase transitions, turbulence and pattern formation. Due to the shared + mathematical structures of these topological defects, recent research + has shown that a common computational framework can be used to study + them across different physical systems, ranging from Bose-Einstein + condensates to nematic liquid crystals and crystalline solids + (Skogvoll + et al., 2023). However, a unified computational framework that + brings all these systems together is lacking. ComFiT aims to close + this gap, catering to both researchers and educators in physics, by + providing a user-friendly, object-oriented framework for setting up a + physical system, solving PDEs in one, two and three dimensions, + visualizing results, and tracking topological defects. In so doing, + ComFiT also brings advanced models of phase-field crystal modeling and + nematic liquid crystals to the Python ecosystem, which are currently + scarcely available in the open-source community, especially for three + dimensions.

+

ComFiT sets itself apart from existing open-source Python software + for solving PDEs in these ways:

+ + +

Spectral Methods: Like Dedalus + (Burns + et al., 2020), ComFiT employs spectral methods for + differentiation and integration, which is more accessible for + those familiar with Fourier analysis, unlike more complex finite + element/volume approaches common in performance-driven libraries, + e.g., FEniCS + (Alnaes + et al., 2015), PyClaw + (Ketcheson + et al., 2012), and Firedrake + (Ham + et al., 2023).

+
+ +

Built-in Visualization: Unlike the aforementioned + libraries, ComFiT includes tailored plotting tools for physical + systems, saving users the effort of integrating with external + libraries.

+
+ +

Topological Defect Analysis: ComFiT’s defect + identification and tracking algorithms provide unique insights + crucial for studying physical phenomena. To the best of our + knowledge, no other integrated Python library for PDEs offers this + functionality.

+
+
+
+ + Summary +

The core functionality of ComFiT is provided in the + BaseSystem class, which defines a computational + domain, auxiliary quantities, methods for time evolution, + visualization tools and algorithms for identifying and tracking + topological defects. To simulate a physical system, a user can create + a class inheriting from BaseSystem and + implement the specific equations and parameters of the model. The + library also provides a range of predefined models, which inherit from + the BaseSystem class, such as + QuantumMechanics, + BoseEinsteinCondensate, + NematicLiquidCrystal, and + PhaseFieldCrystal, each tailored to a specific + field theory, which may be used to quickly get started with + simulations for research or educational purposes.

+ +

Four example setups of the ComFiT library. (a) The + function + + f(x,y)=x/a0y/a0 + where + + a0 + is a length scale, (b) a quantum mechanical wavepacket with a + nonzero velocity in three dimensions, (c) a Bose-Einstein condensate + vortex ring in three dimensions with vortex nodes identified and (d) + a square phase-field crystal simulation containing a dislocation + dipole. More details of the systems are given in the package + documentation, and the code used to make these figures is given in + the appendix.

+ +
+

The project aims to be highly community-driven, continuously + improving the code stability, efficiency and usability, and to be a + platform for sharing and developing new models and methods for field + theories and topological defects. + The + documentation is hosted with MkDocs and contains a range of + theoretical backgrounds for all the subclasses, tutorials, and + examples to guide users through the process of setting up and running + simulations, as well as visualizing and analyzing the results.

+
+ + Research projects +

ComFiT is a synthesized code base that was originally written in + Matlab and used to fuel research into projects exploring the + statistical properties and similarities between the dynamics of + topological defects between Bose-Einstein condensates and phase-field + crystals + (Skaugen, + 2018). It was built on the framework for evolving stiff + numerical systems described by Cox & Matthews + (2002) + and the methods for tracking defects developed by Mazenko + (1997), + Mazenko + (1999), + and Angheluta et al. + (2012). + The code base was further improved, stabilized and extended in the PhD + projects of the paper authors + (Rønning, + 2023; + Skogvoll, + 2023). ComFiT has been used for research into a range of + physical systems, including active matter + (Rønning + et al., 2023), stirred Bose-Einstein condensates + (Rønning + et al., 2020; + Rønning + & Angheluta, 2023), and phase-field crystals + (Skogvoll, + Skaugen, Angheluta, & Viñals, 2021; + Skogvoll, + Skaugen, & Angheluta, 2021; + Skogvoll, + Angheluta, et al., 2022; + Skogvoll, + Salvalaglio, et al., 2022). In all of these applications, the + role of topological defects is central to understanding the critical + dynamics and the statistical properties of the systems. For example, + in Bose-Einstein condensates, the formation of vortices marks the + transition to quantum turbulence, whereas in crystals, the formation + of dislocations is central to understanding how materials buckle. The + library is, at the time of publication, being used to research + turbulence in 3D active nematics and the dynamics of 3D vortex + structures in Bose-Einstein condensates. The phase-field crystal + framework is currently under exploration at the Njord Centre at the + University of Oslo for modeling crack propagation in Earth’s upper + crust and the basic framework is used as a foundation for several + projects in the theoretical physics group at Porelab at the University + of Oslo.

+
+ + Appendix +

The code used to produce the illustration is given below.

+ !pip install comfit==1.5.0 +import comfit as cf +import matplotlib.pyplot as plt + +fig = plt.figure(figsize=(10, 10)) + +# Base System class instance +bs = cf.BaseSystem(2, xlim=[-3,3], ylim=[-3,3]) +field = bs.x - bs.y +ax1 = fig.add_subplot(2, 2, 1) +bs.plot_field(field, ax=ax1) + +# # Quantum Mechanical System +qm = cf.QuantumMechanics(3, xRes=41, yRes=41, zRes=41) +qm.conf_initial_condition_Gaussian(initial_velocity=[0,0.1,0.3]) +qm.evolve_schrodinger(200) +ax2 = fig.add_subplot(2, 2, 2, projection='3d') +qm.plot_complex_field(qm.psi, ax=ax2) + +# Bose Einstein Condensate System +bec = cf.BoseEinsteinCondensate(3, xRes=41, yRes=41, zRes=41) +bec.conf_initial_condition_Thomas_Fermi() +bec.conf_insert_vortex_ring() +bec.evolve_relax(100) +vortex_nodes = bec.calc_vortex_nodes() +ax3 = fig.add_subplot(2, 2, 3, projection='3d') +bec.plot_field(abs(bec.psi), alpha = 0.2, ax=ax3, colorbar=False) +bec.plot_vortex_nodes(vortex_nodes,ax=ax3) + +# Phase-field crystal system +pfc = cf.PhaseFieldCrystal2DSquare(15,15) +eta = pfc.calc_amplitudes_with_dislocation_dipole() +pfc.conf_PFC_from_amplitudes(eta) +pfc.evolve_PFC(100) +dislocation_nodes = pfc.calc_dislocation_nodes() +ax4 = fig.add_subplot(2, 2, 4) +pfc.plot_field(pfc.psi,ax=ax4) +pfc.plot_dislocation_nodes(dislocation_nodes,ax=ax4,grid=False) +
+ + + + + + + + MazenkoGene F. + + Vortex velocities in the O(n) symmetric time-dependent ginzburg-landau model + Phys. Rev. Lett. + 199701 + 78 + 3 + 10.1103/PhysRevLett.78.401 + 401 + 404 + + + + + + MazenkoGene F. + + Velocity distribution for strings in phase-ordering kinetics + Physical Review E + 199902 + 20200402 + 59 + 2 + 10.1103/PhysRevE.59.1574 + 1574 + 1584 + + + + + + AnghelutaLuiza + JeraldoPatricio + GoldenfeldNigel + + Anisotropic velocity statistics of topological defects under shear flow + Phys. Rev. E + American Physical Society + 201201 + 85 + 1 + 10.1103/PhysRevE.85.011153 + 011153 + + + + + + + CoxS. M. + MatthewsP. C. + + Exponential Time Differencing for Stiff Systems + Journal of Computational Physics + 200203 + 20200901 + 176 + 2 + 0021-9991 + 10.1006/jcph.2002.6995 + 430 + 455 + + + + + + SkaugenAudun + + A unified perspective on two-dimensional quantum turbulence and plasticity + The University of Oslo; https://www.duo.uio.no/handle/10852/66179 + 2018 + + + + + + SkogvollVidar + SkaugenAudun + AnghelutaLuiza + ViñalsJorge + + Dislocation nucleation in the phase-field crystal model + Physical Review B + American Physical Society + 202101 + 20210112 + 103 + 1 + 10.1103/PhysRevB.103.014107 + 014107 + + + + + + + SkogvollVidar + SkaugenAudun + AnghelutaLuiza + + Stress in ordered systems: Ginzburg-Landau-type density field theory + Physical Review B + American Physical Society + 202106 + 20210628 + 103 + 22 + 10.1103/PhysRevB.103.224107 + 224107 + + + + + + + SkogvollVidar + AnghelutaLuiza + SkaugenAudun + SalvalaglioMarco + ViñalsJorge + + A phase field crystal theory of the kinematics of dislocation lines + Journal of the Mechanics and Physics of Solids + 202209 + 20220607 + 166 + 0022-5096 + 10.1016/j.jmps.2022.104932 + 104932 + + + + + + + SkogvollVidar + SalvalaglioMarco + AnghelutaLuiza + + Hydrodynamic phase field crystal approach to interfaces, dislocations and multi-grain networks + Modelling and Simulation in Materials Science and Engineering + 202210 + 20220925 + 0965-0393 + 10.1088/1361-651X/ac9493 + + + + + + SkogvollVidar + RønningJonas + SalvalaglioMarco + AnghelutaLuiza + + A unified field theory of topological defects and non-linear local excitations + npj Computational Materials + Nature Publishing Group + 202307 + 20231203 + 9 + 1 + 2057-3960 + 10.1038/s41524-023-01077-6 + 1 + 13 + + + + + + SkogvollVidar + + Symmetry, topology, and crystal deformations: A phase-field crystal approach + https://www.duo.uio.no/handle/10852/102731 + 2023 + 20230924 + + + + + + RønningJonas + + Topological Defects and Flows in BECs and Active Matter + https://www.duo.uio.no/handle/10852/104678 + 2023 + 20240305 + + + + + + RønningJonas + RenaudJulian + DoostmohammadiAmin + AnghelutaLuiza + + Spontaneous flows and dynamics of full-integer topological defects in polar active matter + Soft Matter + The Royal Society of Chemistry + 202310 + 20240305 + 19 + 39 + 1744-6848 + 10.1039/D3SM00316G + 7513 + 7527 + + + + + + RønningJonas + SkaugenAudun + Hernández-GarcíaEmilio + LopezCristobal + AnghelutaLuiza + + Classical analogies for the force acting on an impurity in a Bose–Einstein condensate + New Journal of Physics + IOP Publishing + 202007 + 20220912 + 22 + 7 + 1367-2630 + 10.1088/1367-2630/ab95de + 073018 + + + + + + + RønningJonas + AnghelutaLuiza + + Precursory patterns to vortex nucleation in stirred Bose-Einstein condensates + Physical Review Research + American Physical Society + 202305 + 20240305 + 5 + 2 + 10.1103/PhysRevResearch.5.023108 + 023108 + + + + + + + AlnaesMartin S. + BlechtaJan + HakeJohan + JohanssonAugust + KehletBenjamin + LoggAnders + RichardsonChris N. + RingJohannes + RognesMarie E. + WellsGarth N. + + The FEniCS project version 1.5 + Archive of Numerical Software + 2015 + 3 + 10.11588/ans.2015.100.20553 + + + + + + KetchesonDavid I. + MandliKyle T. + AhmadiaAron J. + AlghamdiAmal + Quezada de LunaManuel + ParsaniMatteo + KnepleyMatthew G. + EmmettMatthew + + PyClaw: Accessible, extensible, scalable tools for wave propagation problems + SIAM Journal on Scientific Computing + 201211 + 34 + 4 + 10.1137/110856976 + C210 + C231 + + + + + + HamDavid A. + KellyPaul H. J. + MitchellLawrence + CotterColin J. + KirbyRobert C. + SagiyamaKoki + BouzianiNacime + VorderwuelbeckeSophia + GregoryThomas J. + BetteridgeJack + ShaperoDaniel R. + Nixon-HillReuben W. + WardConnor J. + FarrellPatrick E. + BrubeckPablo D. + MarsdenIndia + GibsonThomas H. + HomolyaMiklós + SunTianjiao + McRaeAndrew T. T. + LuporiniFabio + GregoryAlastair + LangeMichael + FunkeSimon W. + RathgeberFlorian + BerceaGheorghe-Teodor + MarkallGraham R. + + Firedrake user manual + Imperial College London and University of Oxford and Baylor University and University of Washington + 202305 + First edition + 10.25561/104839 + + + + + + BurnsKeaton J. + VasilGeoffrey M. + OishiJeffrey S. + LecoanetDaniel + BrownBenjamin P. + + Dedalus: A flexible framework for numerical simulations with spectral methods + Physical Review Research + 202004 + 2 + 023068 + https://arxiv.org/abs/1905.10388 + 10.1103/PhysRevResearch.2.023068 + 023068 + + + + + +