class ExplicitEuler: def __init__(self): self.accessor = Accessor() self.accessor.require("position", "walberla::mesa_pd::Vec3", access="gs") self.accessor.require("linearVelocity", "walberla::mesa_pd::Vec3", access="gs") self.accessor.require("invMass", "walberla::real_t", access="g") self.accessor.require("force", "walberla::mesa_pd::Vec3", access="gs") self.accessor.require("flags", "walberla::mesa_pd::data::particle_flags::FlagT", access="g") def getRequirements(self): return self.accessor def generate(self, path): context = dict() context["interface"] = self.accessor.properties generateFile(path, 'kernel/ExplicitEuler.templ.h', context) context["InterfaceTestName"] = "ExplicitEulerInterfaceCheck" context["KernelInclude"] = "kernel/ExplicitEuler.h" context[ "ExplicitInstantiation"] = "template void kernel::ExplicitEuler::operator()(const size_t p_idx1, Accessor& ac) const;" generateFile( path, 'tests/CheckInterface.templ.cpp', context, '../../tests/mesa_pd/kernel/interfaces/ExplicitEulerInterfaceCheck.cpp' )
class ClearNextNeighborSync: def __init__(self): self.accessor = Accessor() self.accessor.require("flags", "walberla::mesa_pd::data::particle_flags::FlagT", access="g") self.accessor.require("ghostOwners", "std::vector<int>", access="r") def getRequirements(self): return self.accessor def generate(self, path): context = dict() context["interface"] = self.accessor.properties generateFile(path, 'mpi/ClearNextNeighborSync.templ.h', context)
class SingleCast: def __init__(self, shapes): self.shapes = shapes self.accessor = Accessor() self.accessor.require("shape", "BaseShape*", access="g") def getRequirements(self): return self.accessor def generate(self, path): context = dict() context["interface"] = self.accessor.properties context["shapes"] = self.shapes generateFile(path, 'kernel/SingleCast.templ.h', context)
class DoubleCast: def __init__(self, shapes): self.shapes = shapes self.accessor = Accessor() self.accessor.require("shape", "BaseShape*", access="g") def getRequirements(self): return self.accessor def generate(self, path): context = dict() context["interface"] = self.accessor.properties context["shapes"] = self.shapes generateFile(path, 'kernel/DoubleCast.templ.h', context)
class TemperatureIntegration: def __init__(self): self.accessor = Accessor() self.accessor.require("temperature", "walberla::real_t", access="gs") self.accessor.require("heatFlux", "walberla::real_t", access="gs") self.accessor.require("type", "uint_t", access="g") def getRequirements(self): return self.accessor def generate(self, path): context = dict() context["parameters"] = ["invHeatCapacity"] context["interface"] = self.accessor.properties generateFile(path, 'kernel/TemperatureIntegration.templ.h', context) context["InterfaceTestName"] = "TemperatureIntegrationInterfaceCheck" context["KernelInclude"] = "kernel/TemperatureIntegration.h" context["ExplicitInstantiation"] = "template void kernel::TemperatureIntegration::operator()(const size_t p_idx1, Accessor& ac) const;" generateFile(path, 'tests/CheckInterface.templ.cpp', context, '../../tests/mesa_pd/kernel/interfaces/TemperatureIntegrationInterfaceCheck.cpp')
class ForceLJ: def __init__(self): self.accessor = Accessor() self.accessor.require("position", "walberla::mesa_pd::Vec3", access="g") self.accessor.require("force", "walberla::mesa_pd::Vec3", access="r") self.accessor.require("type", "uint_t", access="g") def getRequirements(self): return self.accessor def generate(self, path): context = dict() context["parameters"] = ["epsilon", "sigma"] context["interface"] = self.accessor.properties generateFile(path, 'kernel/ForceLJ.templ.h', context) context["InterfaceTestName"] = "ForceLJInterfaceCheck" context["KernelInclude"] = "kernel/ForceLJ.h" context[ "ExplicitInstantiation"] = "template void kernel::ForceLJ::operator()(const size_t p_idx1, const size_t p_idx2, Accessor& ac) const;" generateFile( path, 'tests/CheckInterface.templ.cpp', context, '../../tests/mesa_pd/kernel/interfaces/ForceLJInterfaceCheck.cpp')
class DetectAndStoreContacts: def __init__(self): self.accessor = Accessor() self.accessor.require("uid", "walberla::id_t", access="g") self.accessor.require("flags", "walberla::mesa_pd::data::particle_flags::FlagT", access="g") self.accessor.require("position", "walberla::mesa_pd::Vec3", access="g") self.accessor.require("rotation", "walberla::mesa_pd::Rot3", access="g") self.accessor.require("shape", "BaseShape*", access="g") def getRequirements(self): return self.accessor def generate(self, path): context = dict() context["interface"] = self.accessor.properties generateFile(path, 'kernel/DetectAndStoreContacts.templ.h', context)
class ExplicitEuler: def __init__(self): self.accessor = Accessor() self.accessor.require("position", "walberla::mesa_pd::Vec3", access="gs") self.accessor.require("linearVelocity", "walberla::mesa_pd::Vec3", access="gs") self.accessor.require("invMass", "walberla::real_t", access="g" ) self.accessor.require("force", "walberla::mesa_pd::Vec3", access="gs" ) self.accessor.require("flags", "walberla::mesa_pd::data::particle_flags::FlagT", access="g") def getRequirements(self): return self.accessor def generate(self, path): context = dict() context["interface"] = self.accessor.properties generateFile(path, 'kernel/ExplicitEuler.templ.h', context) context["InterfaceTestName"] = "ExplicitEulerInterfaceCheck" context["KernelInclude"] = "kernel/ExplicitEuler.h" context["ExplicitInstantiation"] = "template void kernel::ExplicitEuler::operator()(const size_t p_idx1, Accessor& ac) const;" generateFile(path, 'tests/CheckInterface.templ.cpp', context, '../../tests/mesa_pd/kernel/interfaces/ExplicitEulerInterfaceCheck.cpp')
class InsertParticleIntoLinkedCells: def __init__(self): self.accessor = Accessor() self.accessor.require("position", "walberla::mesa_pd::Vec3", access="g") self.accessor.require("flags", "walberla::mesa_pd::data::particle_flags::FlagT", access="g") self.accessor.require("nextParticle", "size_t", access="gs") def getRequirements(self): return self.accessor def generate(self, path): context = dict() context["interface"] = self.accessor.properties generateFile(path, 'kernel/InsertParticleIntoLinkedCells.templ.h', context)
class HeatConduction: def __init__(self): self.accessor = Accessor() self.accessor.require("temperature", "walberla::real_t", access="g") self.accessor.require("heatFlux", "walberla::real_t", access="gsr") self.accessor.require("type", "uint_t", access="g") def getRequirements(self): return self.accessor def generate(self, path): context = dict() context["parameters"] = ["conductance"] context["interface"] = self.accessor.properties generateFile(path, 'kernel/HeatConduction.templ.h', context) context["InterfaceTestName"] = "HeatConductionInterfaceCheck" context["KernelInclude"] = "kernel/HeatConduction.h" context["ExplicitInstantiation"] = "template void kernel::HeatConduction::operator()(const size_t p_idx1, const size_t p_idx2, Accessor& ac) const;" generateFile(path, 'tests/CheckInterface.templ.cpp', context, '../../tests/mesa_pd/kernel/interfaces/HeatConductionInterfaceCheck.cpp')
class ForceLJ: def __init__(self): self.accessor = Accessor() self.accessor.require("position", "walberla::mesa_pd::Vec3", access="g") self.accessor.require("force", "walberla::mesa_pd::Vec3", access="r" ) self.accessor.require("type", "uint_t", access="g") def getRequirements(self): return self.accessor def generate(self, path): context = dict() context["parameters"] = ["epsilon", "sigma"] context["interface"] = self.accessor.properties generateFile(path, 'kernel/ForceLJ.templ.h', context) context["InterfaceTestName"] = "ForceLJInterfaceCheck" context["KernelInclude"] = "kernel/ForceLJ.h" context["ExplicitInstantiation"] = "template void kernel::ForceLJ::operator()(const size_t p_idx1, const size_t p_idx2, Accessor& ac) const;" generateFile(path, 'tests/CheckInterface.templ.cpp', context, '../../tests/mesa_pd/kernel/interfaces/ForceLJInterfaceCheck.cpp')
class VelocityVerletWithShape: def __init__(self): self.accessor = Accessor() self.accessor.require("position", "walberla::mesa_pd::Vec3", access="gs") self.accessor.require("linearVelocity", "walberla::mesa_pd::Vec3", access="gs") self.accessor.require("invMass", "walberla::real_t", access="g" ) self.accessor.require("force", "walberla::mesa_pd::Vec3", access="gs" ) self.accessor.require("oldForce", "walberla::mesa_pd::Vec3", access="gs" ) self.accessor.require("rotation", "walberla::mesa_pd::Rot3", access="gs") self.accessor.require("angularVelocity", "walberla::mesa_pd::Vec3", access="gs") self.accessor.require("invInertiaBF", "walberla::mesa_pd::Mat3", access="g" ) self.accessor.require("torque", "walberla::mesa_pd::Vec3", access="gs" ) self.accessor.require("oldTorque", "walberla::mesa_pd::Vec3", access="gs" ) self.accessor.require("flags", "walberla::mesa_pd::data::particle_flags::FlagT", access="g") def getRequirements(self): return self.accessor def generate(self, path): context = dict() context["interface"] = self.accessor.properties generateFile(path, 'kernel/VelocityVerletWithShape.templ.h', context) context["InterfaceTestName"] = "VelocityVerletWithShapeInterfaceCheck" context["KernelInclude"] = "kernel/VelocityVerletWithShape.h" context["ExplicitInstantiation"] = "template void kernel::VelocityVerletWithShapePreForceUpdate::operator()(const size_t p_idx1, Accessor& ac) const;\n" +\ "template void kernel::VelocityVerletWithShapePostForceUpdate::operator()(const size_t p_idx1, Accessor& ac) const;" generateFile(path, 'tests/CheckInterface.templ.cpp', context, '../../tests/mesa_pd/kernel/interfaces/VelocityVerletWithShapeInterfaceCheck.cpp')
class LinearSpringDashpot: def __init__(self): self.accessor = Accessor() self.accessor.require("uid", "walberla::id_t", access="g") self.accessor.require("position", "walberla::mesa_pd::Vec3", access="g") self.accessor.require("linearVelocity", "walberla::mesa_pd::Vec3", access="g") self.accessor.require("force", "walberla::mesa_pd::Vec3", access="r") self.accessor.require("angularVelocity", "walberla::mesa_pd::Vec3", access="g") self.accessor.require("torque", "walberla::mesa_pd::Vec3", access="r") self.accessor.require("type", "uint_t", access="g") self.accessor.require( "contactHistory", "std::map<walberla::id_t, walberla::mesa_pd::Vec3>", access="gs") def getRequirements(self): return self.accessor def generate(self, path): context = dict() context["parameters"] = [ "stiffnessN", "stiffnessT", "dampingN", "dampingT", "frictionCoefficientStatic", "frictionCoefficientDynamic" ] context["interface"] = self.accessor.properties generateFile(path, 'kernel/LinearSpringDashpot.templ.h', context)
class VelocityVerletWithShape: def __init__(self): self.accessor = Accessor() self.accessor.require("position", "walberla::mesa_pd::Vec3", access="gs") self.accessor.require("linearVelocity", "walberla::mesa_pd::Vec3", access="gs") self.accessor.require("invMass", "walberla::real_t", access="g") self.accessor.require("force", "walberla::mesa_pd::Vec3", access="gs") self.accessor.require("oldForce", "walberla::mesa_pd::Vec3", access="gs") self.accessor.require("rotation", "walberla::mesa_pd::Rot3", access="gs") self.accessor.require("angularVelocity", "walberla::mesa_pd::Vec3", access="gs") self.accessor.require("invInertiaBF", "walberla::mesa_pd::Mat3", access="g") self.accessor.require("torque", "walberla::mesa_pd::Vec3", access="gs") self.accessor.require("oldTorque", "walberla::mesa_pd::Vec3", access="gs") self.accessor.require("flags", "walberla::mesa_pd::data::particle_flags::FlagT", access="g") def getRequirements(self): return self.accessor def generate(self, path): context = dict() context["interface"] = self.accessor.properties generateFile(path, 'kernel/VelocityVerletWithShape.templ.h', context) context["InterfaceTestName"] = "VelocityVerletWithShapeInterfaceCheck" context["KernelInclude"] = "kernel/VelocityVerletWithShape.h" context["ExplicitInstantiation"] = "template void kernel::VelocityVerletWithShapePreForceUpdate::operator()(const size_t p_idx1, Accessor& ac) const;\n" +\ "template void kernel::VelocityVerletWithShapePostForceUpdate::operator()(const size_t p_idx1, Accessor& ac) const;" generateFile( path, 'tests/CheckInterface.templ.cpp', context, '../../tests/mesa_pd/kernel/interfaces/VelocityVerletWithShapeInterfaceCheck.cpp' )
class NonLinearSpringDashpot: def __init__(self): self.accessor = Accessor() self.accessor.require("uid", "walberla::id_t", access="g") self.accessor.require("position", "walberla::mesa_pd::Vec3", access="g") self.accessor.require("linearVelocity", "walberla::mesa_pd::Vec3", access="g") self.accessor.require("force", "walberla::mesa_pd::Vec3", access="r" ) self.accessor.require("angularVelocity", "walberla::mesa_pd::Vec3", access="g") self.accessor.require("torque", "walberla::mesa_pd::Vec3", access="r" ) self.accessor.require("type", "uint_t", access="g") self.accessor.require("contactHistory", "std::map<walberla::id_t, walberla::mesa_pd::Vec3>", access="gs") def getRequirements(self): return self.accessor def generate(self, path): context = dict() context["parameters"] = ["lnCORsqr", "meff", "stiffnessT", "dampingT", "frictionCoefficientStatic", "frictionCoefficientDynamic"] context["interface"] = self.accessor.properties generateFile(path, 'kernel/NonLinearSpringDashpot.templ.h', context)
class SpringDashpot: def __init__(self): self.accessor = Accessor() self.accessor.require("position", "walberla::mesa_pd::Vec3", access="g") self.accessor.require("linearVelocity", "walberla::mesa_pd::Vec3", access="g") self.accessor.require("force", "walberla::mesa_pd::Vec3", access="r" ) self.accessor.require("angularVelocity", "walberla::mesa_pd::Vec3", access="g") self.accessor.require("torque", "walberla::mesa_pd::Vec3", access="r" ) self.accessor.require("type", "uint_t", access="g") self.accessor.require("contactHistory", "std::map<walberla::id_t, walberla::mesa_pd::Vec3>", access="gs") def getRequirements(self): return self.accessor def generate(self, path): context = dict() context["parameters"] = ["stiffness", "dampingN", "dampingT", "friction"] context["interface"] = self.accessor.properties generateFile(path, 'kernel/SpringDashpot.templ.h', context) context["InterfaceTestName"] = "SpringDashpotInterfaceCheck" context["KernelInclude"] = "kernel/SpringDashpot.h" context["ExplicitInstantiation"] = "template void kernel::SpringDashpot::operator()(const size_t p_idx1, const size_t p_idx2, Accessor& ac, const Vec3& contactPoint, const Vec3& contactNormal, const real_t& penetrationDepth) const;" generateFile(path, 'tests/CheckInterface.templ.cpp', context, '../../tests/mesa_pd/kernel/interfaces/SpringDashpotInterfaceCheck.cpp')