Skip to content

Releases: vidarsko/ComFiT

ComFiT v1.5.0

30 May 12:42
Compare
Choose a tag to compare

ComFiT v1.5.0

Release Date: 30 May 2024

Summary

ComFiT (Computational Field Theory) is a Python library designed for solving partial differential equations with a focus on topological defects.
The package includes the following features:

  • Spectral Methods: Employs spectral methods for differentiation and integration, which is user-friendly for those familiar with Fourier analysis.
  • Built-in Visualization: Includes tailored plotting tools for physical systems, allowing for seamless integration and visualization of results.
  • Topological Defect Analysis: Provides unique algorithms for identifying and tracking topological defects, crucial for studying various physical phenomena.

For more information, see the documentation.

Installation

pip install comfit==1.5.0

Usage example

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)