Beispiel #1
0
            and (not args.force)):
        raise RuntimeError(
            args.path +
            " is not the path to a waLBerla root directory! Specify -f to generate the files anyway."
        )

    os.makedirs(args.path + "/src/mesa_pd/common", exist_ok=True)
    os.makedirs(args.path + "/src/mesa_pd/data", exist_ok=True)
    os.makedirs(args.path + "/src/mesa_pd/domain", exist_ok=True)
    os.makedirs(args.path + "/src/mesa_pd/kernel", exist_ok=True)
    os.makedirs(args.path + "/src/mesa_pd/mpi/notifications", exist_ok=True)
    os.makedirs(args.path + "/src/mesa_pd/vtk", exist_ok=True)

    shapes = ["Sphere", "HalfSpace"]

    ps = data.ParticleStorage()
    ch = data.ContactHistory()
    lc = data.LinkedCells()
    ss = data.ShapeStorage(ps, shapes)

    ps.addProperty("position",
                   "walberla::mesa_pd::Vec3",
                   defValue="real_t(0)",
                   syncMode="ALWAYS")
    ps.addProperty("linearVelocity",
                   "walberla::mesa_pd::Vec3",
                   defValue="real_t(0)",
                   syncMode="ALWAYS")
    ps.addProperty("invMass",
                   "walberla::real_t",
                   defValue="real_t(1)",
Beispiel #2
0
from mesa_pd import Module
import mesa_pd.data as data
import mesa_pd.mpi as mpi

import argparse

if __name__ == '__main__':
    parser = argparse.ArgumentParser(
        description=
        'Generate all necessary files for the HyTeG convection particles module.'
    )
    parser.add_argument('path', help='path to the HyTeG top level directory')
    args = parser.parse_args()

    mpd = Module(args.path, 'convection_particles')
    ps = mpd.add(data.ParticleStorage())
    ps.add_property("velocity",
                    "walberla::mesa_pd::Vec3",
                    defValue="real_t(0)",
                    syncMode="ALWAYS")

    ps.add_include("blockforest/BlockForest.h")
    ps.add_property("currentBlock",
                    "blockforest::BlockID",
                    defValue="",
                    syncMode="NEVER")

    ps.add_include("hyteg/indexing/Common.hpp")
    ps.add_include("hyteg/PrimitiveID.hpp")
    ps.add_include("hyteg/edgedofspace/EdgeDoFIndexing.hpp")