From f5c842c6a170663ced4a20e5e5108d89835199e8 Mon Sep 17 00:00:00 2001
From: Behzad Safaei <iwia103h@a0522.nhr.fau.de>
Date: Thu, 13 Mar 2025 19:56:39 +0100
Subject: [PATCH] Remove utility functions from pairs/sim

---
 src/pairs/code_gen/interface.py     |  9 --------
 src/pairs/sim/copper_fcc_lattice.py | 34 -----------------------------
 src/pairs/sim/dem_sc_grid.py        | 29 ------------------------
 src/pairs/sim/thermo.py             | 19 ----------------
 4 files changed, 91 deletions(-)
 delete mode 100644 src/pairs/sim/copper_fcc_lattice.py
 delete mode 100644 src/pairs/sim/dem_sc_grid.py
 delete mode 100644 src/pairs/sim/thermo.py

diff --git a/src/pairs/code_gen/interface.py b/src/pairs/code_gen/interface.py
index 20a27fd..1f15c49 100644
--- a/src/pairs/code_gen/interface.py
+++ b/src/pairs/code_gen/interface.py
@@ -20,7 +20,6 @@ from pairs.sim.domain_partitioners import DomainPartitioners
 from pairs.ir.print import PrintCode
 from pairs.ir.assign import Assign
 from pairs.sim.contact_history import BuildContactHistory, ClearUnusedContactHistory, ResetContactHistoryUsageStatus
-from pairs.sim.thermo import ComputeThermo
 
 class InterfaceModules:
     def __init__(self, sim):
@@ -40,9 +39,6 @@ class InterfaceModules:
                 self.build_contact_history(self.sim.reneighbor_frequency)
             self.reset_contact_history()
 
-        if self.sim._compute_thermo != 0:
-            self.compute_thermo(self.sim._compute_thermo)
-
         self.rank()
         self.nlocal()
         self.nghost()
@@ -164,11 +160,6 @@ class InterfaceModules:
         self.sim.add_statement(ResetContactHistoryUsageStatus(self.sim, self.sim._contact_history))
         self.sim.add_statement(ClearUnusedContactHistory(self.sim, self.sim._contact_history))
 
-    @pairs_interface_block
-    def compute_thermo(self):
-        self.sim.module_name('compute_thermo')
-        self.sim.add_statement(ComputeThermo(self.sim))
-
     @pairs_interface_block
     def rank(self):
         self.sim.module_name('rank')
diff --git a/src/pairs/sim/copper_fcc_lattice.py b/src/pairs/sim/copper_fcc_lattice.py
deleted file mode 100644
index ba966a5..0000000
--- a/src/pairs/sim/copper_fcc_lattice.py
+++ /dev/null
@@ -1,34 +0,0 @@
-from pairs.ir.assign import Assign
-from pairs.ir.block import pairs_inline
-from pairs.ir.functions import Call_Int, Call_Void
-from pairs.ir.particle_attributes import ParticleAttributeList
-from pairs.ir.types import Types
-from pairs.sim.grid import Grid3D
-from pairs.sim.lowerable import Lowerable
-
-
-class CopperFCCLattice(Lowerable):
-    def __init__(self, sim, nx, ny, nz, rho, temperature, ntypes):
-        super().__init__(sim)
-        self._nx = nx
-        self._ny = ny
-        self._nz = nz
-        self._rho = rho
-        self._temperature = temperature
-        self._ntypes = ntypes
-        lattice = pow((4.0 / rho), (1.0 / 3.0))
-        self._xprd = nx * lattice
-        self._yprd = ny * lattice
-        self._zprd = nz * lattice
-        sim.set_domain([0.0, 0.0, 0.0, self._xprd, self._yprd, self._zprd])
-
-    @pairs_inline
-    def lower(self):
-        Assign(self.sim, self.sim.nlocal,
-            Call_Int(self.sim, "pairs::copper_fcc_lattice",
-                [self._nx, self._ny, self._nz,
-                 self._xprd, self._yprd, self._zprd,
-                 self._rho, self._ntypes]))
-
-        Call_Void(self.sim, "pairs::adjust_thermo",
-            [self.sim.nlocal, self._xprd, self._yprd, self._zprd, self._temperature])
diff --git a/src/pairs/sim/dem_sc_grid.py b/src/pairs/sim/dem_sc_grid.py
deleted file mode 100644
index c7ef027..0000000
--- a/src/pairs/sim/dem_sc_grid.py
+++ /dev/null
@@ -1,29 +0,0 @@
-from pairs.ir.assign import Assign
-from pairs.ir.block import pairs_inline
-from pairs.ir.functions import Call_Int
-from pairs.sim.lowerable import Lowerable
-
-
-class DEMSCGrid(Lowerable):
-    def __init__(
-        self, sim, xmax, ymax, zmax, spacing, diameter, min_diameter, max_diameter, initial_velocity, particle_density, ntypes):
-
-        super().__init__(sim)
-        self._xmax = xmax
-        self._ymax = ymax
-        self._zmax = zmax
-        self._spacing = spacing
-        self._diameter = diameter
-        self._min_diameter = min_diameter
-        self._max_diameter = max_diameter
-        self._initial_velocity = initial_velocity
-        self._particle_density = particle_density
-        self._ntypes = ntypes
-        #sim.set_domain([0.0, 0.0, 0.0, self._xprd, self._yprd, self._zprd])
-
-    @pairs_inline
-    def lower(self):
-        Assign(self.sim, self.sim.nlocal,
-            Call_Int(self.sim, "pairs::dem_sc_grid",
-                [self._xmax, self._ymax, self._zmax, self._spacing, self._diameter, self._min_diameter, self._max_diameter,
-                 self._initial_velocity, self._particle_density, self._ntypes]))
diff --git a/src/pairs/sim/thermo.py b/src/pairs/sim/thermo.py
deleted file mode 100644
index 557a756..0000000
--- a/src/pairs/sim/thermo.py
+++ /dev/null
@@ -1,19 +0,0 @@
-from pairs.ir.assign import Assign
-from pairs.ir.block import pairs_inline
-from pairs.ir.functions import Call_Int, Call_Void
-from pairs.ir.particle_attributes import ParticleAttributeList
-from pairs.ir.types import Types
-from pairs.sim.grid import Grid3D
-from pairs.sim.lowerable import Lowerable
-
-
-class ComputeThermo(Lowerable):
-    def __init__(self, sim):
-        super().__init__(sim)
-
-    @pairs_inline
-    def lower(self):
-        xprd = self.sim.grid.length(0)
-        yprd = self.sim.grid.length(1)
-        zprd = self.sim.grid.length(2)
-        Call_Void(self.sim, "pairs::compute_thermo", [self.sim.nlocal, xprd, yprd, zprd, 1])
-- 
GitLab