Due to a key rollover of our WebSSO provider there might be a short downtime of this Gitlab server on Friday, November 2.

Commit 2eeee982 authored by Martin Bauer's avatar Martin Bauer

Merge remote-tracking branch 'origin/master' into gpu

parents 44a42d08 b234daf1
Pipeline #16464 passed with stages
in 346 minutes and 3 seconds
...@@ -745,6 +745,97 @@ gcc_8_mpionly: ...@@ -745,6 +745,97 @@ gcc_8_mpionly:
gcc_8_hybrid: gcc_8_hybrid:
<<: *build_definition <<: *build_definition
image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:8 image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:8
variables:
<<: *build_hybrid_variables
WALBERLA_BUILD_WITH_CUDA: "OFF"
WALBERLA_ENABLE_GUI: 0
only:
variables:
- $ENABLE_NIGHTLY_BUILDS
tags:
- docker
gcc_8_serial_dbg:
<<: *build_definition
image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:8
variables:
<<: *build_serial_dbg_variables
WALBERLA_BUILD_WITH_CUDA: "OFF"
WALBERLA_ENABLE_GUI: 0
only:
variables:
- $ENABLE_NIGHTLY_BUILDS
tags:
- docker
gcc_8_mpionly_dbg:
<<: *build_definition
image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:8
variables:
<<: *build_mpionly_dbg_variables
WALBERLA_BUILD_WITH_CUDA: "OFF"
WALBERLA_ENABLE_GUI: 0
only:
variables:
- $ENABLE_NIGHTLY_BUILDS
tags:
- docker
gcc_8_hybrid_dbg:
<<: *build_definition
image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:8
variables:
<<: *build_hybrid_dbg_variables
WALBERLA_BUILD_WITH_CUDA: "OFF"
WALBERLA_ENABLE_GUI: 0
only:
variables:
- $ENABLE_NIGHTLY_BUILDS
tags:
- docker
gcc_8_hybrid_dbg_sp:
<<: *build_definition
image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:8
variables:
<<: *build_hybrid_dbg_sp_variables
WALBERLA_BUILD_WITH_CUDA: "OFF"
WALBERLA_ENABLE_GUI: 0
only:
variables:
- $ENABLE_NIGHTLY_BUILDS
tags:
- docker
gcc_9_serial:
<<: *build_definition
image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:9
variables:
<<: *build_serial_variables
WALBERLA_BUILD_WITH_CUDA: "OFF"
WALBERLA_ENABLE_GUI: 0
only:
variables:
- $ENABLE_NIGHTLY_BUILDS
tags:
- docker
gcc_9_mpionly:
<<: *build_definition
image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:9
variables:
<<: *build_mpionly_variables
WALBERLA_BUILD_WITH_CUDA: "OFF"
WALBERLA_ENABLE_GUI: 0
only:
variables:
- $ENABLE_NIGHTLY_BUILDS
tags:
- docker
gcc_9_hybrid:
<<: *build_definition
image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:9
stage: pretest stage: pretest
variables: variables:
<<: *build_hybrid_variables <<: *build_hybrid_variables
...@@ -756,9 +847,9 @@ gcc_8_hybrid: ...@@ -756,9 +847,9 @@ gcc_8_hybrid:
tags: tags:
- docker - docker
gcc_8_serial_dbg: gcc_9_serial_dbg:
<<: *build_definition <<: *build_definition
image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:8 image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:9
variables: variables:
<<: *build_serial_dbg_variables <<: *build_serial_dbg_variables
WALBERLA_BUILD_WITH_CUDA: "OFF" WALBERLA_BUILD_WITH_CUDA: "OFF"
...@@ -769,9 +860,9 @@ gcc_8_serial_dbg: ...@@ -769,9 +860,9 @@ gcc_8_serial_dbg:
tags: tags:
- docker - docker
gcc_8_mpionly_dbg: gcc_9_mpionly_dbg:
<<: *build_definition <<: *build_definition
image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:8 image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:9
variables: variables:
<<: *build_mpionly_dbg_variables <<: *build_mpionly_dbg_variables
WALBERLA_BUILD_WITH_CUDA: "OFF" WALBERLA_BUILD_WITH_CUDA: "OFF"
...@@ -782,9 +873,9 @@ gcc_8_mpionly_dbg: ...@@ -782,9 +873,9 @@ gcc_8_mpionly_dbg:
tags: tags:
- docker - docker
gcc_8_hybrid_dbg: gcc_9_hybrid_dbg:
<<: *build_definition <<: *build_definition
image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:8 image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:9
variables: variables:
<<: *build_hybrid_dbg_variables <<: *build_hybrid_dbg_variables
WALBERLA_BUILD_WITH_CUDA: "OFF" WALBERLA_BUILD_WITH_CUDA: "OFF"
...@@ -795,9 +886,9 @@ gcc_8_hybrid_dbg: ...@@ -795,9 +886,9 @@ gcc_8_hybrid_dbg:
tags: tags:
- docker - docker
gcc_8_hybrid_dbg_sp: gcc_9_hybrid_dbg_sp:
<<: *build_definition <<: *build_definition
image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:8 image: i10git.cs.fau.de:5005/walberla/buildenvs/gcc:9
variables: variables:
<<: *build_hybrid_dbg_sp_variables <<: *build_hybrid_dbg_sp_variables
WALBERLA_BUILD_WITH_CUDA: "OFF" WALBERLA_BUILD_WITH_CUDA: "OFF"
...@@ -1786,4 +1877,4 @@ benchmark_gcc8: ...@@ -1786,4 +1877,4 @@ benchmark_gcc8:
benchmark_clang8: benchmark_clang8:
<<: *benchmark_definition <<: *benchmark_definition
image: i10git.cs.fau.de:5005/walberla/buildenvs/clang:8.0 image: i10git.cs.fau.de:5005/walberla/buildenvs/clang:8.0
\ No newline at end of file
...@@ -57,6 +57,7 @@ ...@@ -57,6 +57,7 @@
#include "mesh/TriangleMeshes.h" #include "mesh/TriangleMeshes.h"
#include "mesh/MeshOperations.h" #include "mesh/MeshOperations.h"
#include "mesh/DistanceComputations.h" #include "mesh/DistanceComputations.h"
#include "mesh/DistanceFunction.h"
#include "mesh/MeshIO.h" #include "mesh/MeshIO.h"
#include "mesh/MatrixVectorOperations.h" #include "mesh/MatrixVectorOperations.h"
#include "mesh/blockforest/BlockForestInitialization.h" #include "mesh/blockforest/BlockForestInitialization.h"
...@@ -67,6 +68,7 @@ ...@@ -67,6 +68,7 @@
#include "mesh/boundary/BoundarySetup.h" #include "mesh/boundary/BoundarySetup.h"
#include "mesh/boundary/BoundaryInfo.h" #include "mesh/boundary/BoundaryInfo.h"
#include "mesh/boundary/BoundaryLocation.h" #include "mesh/boundary/BoundaryLocation.h"
#include "mesh/boundary/BoundaryLocationFunction.h"
#include "mesh/boundary/BoundaryUIDFaceDataSource.h" #include "mesh/boundary/BoundaryUIDFaceDataSource.h"
#include "mesh/boundary/ColorToBoundaryMapper.h" #include "mesh/boundary/ColorToBoundaryMapper.h"
#include "mesh/vtk/VTKMeshWriter.h" #include "mesh/vtk/VTKMeshWriter.h"
...@@ -84,47 +86,6 @@ ...@@ -84,47 +86,6 @@
namespace walberla { namespace walberla {
template< typename MeshDistanceType >
struct MeshDistanceFunction
{
MeshDistanceFunction( const shared_ptr< MeshDistanceType > & meshDistanceObject ) : meshDistanceObject_( meshDistanceObject ) { }
inline real_t operator()( const Vector3< real_t > & p ) const { return real_c( meshDistanceObject_->sqSignedDistance( mesh::toOpenMesh( p ) ) ); }
shared_ptr< MeshDistanceType > meshDistanceObject_;
};
template< typename MeshDistanceType >
inline MeshDistanceFunction< MeshDistanceType > makeMeshDistanceFunction( const shared_ptr< MeshDistanceType > & meshDistanceObject )
{
return MeshDistanceFunction< MeshDistanceType >( meshDistanceObject );
}
template< typename MeshDistanceType, typename MeshType >
struct BoundaryLocationFunction
{
BoundaryLocationFunction( const shared_ptr< MeshDistanceType > & meshDistanceObject, const shared_ptr< mesh::BoundaryLocation< MeshType > > & boundaryLocation )
: meshDistanceObject_( meshDistanceObject ), boundaryLocation_( boundaryLocation ) { }
inline const mesh::BoundaryInfo & operator()( const Vector3< real_t > & p ) const
{
typename MeshType::FaceHandle fh;
meshDistanceObject_->sqSignedDistance( mesh::toOpenMesh( p ), fh );
return (*boundaryLocation_)[ fh ];
}
shared_ptr< MeshDistanceType > meshDistanceObject_;
shared_ptr< mesh::BoundaryLocation< MeshType > > boundaryLocation_;
};
template< typename MeshDistanceType, typename MeshType >
inline BoundaryLocationFunction< MeshDistanceType, MeshType > makeBoundaryLocationFunction( const shared_ptr< MeshDistanceType > & meshDistanceObject, const shared_ptr< mesh::BoundaryLocation< MeshType > > & boundaryLocation )
{
return BoundaryLocationFunction< MeshDistanceType, MeshType >( meshDistanceObject, boundaryLocation );
}
template< typename MeshType > template< typename MeshType >
void vertexToFaceColor( MeshType & mesh, const typename MeshType::Color & defaultColor ) void vertexToFaceColor( MeshType & mesh, const typename MeshType::Color & defaultColor )
{ {
......
...@@ -74,19 +74,15 @@ class ParticleAccessorWithShape : public data::ParticleAccessor ...@@ -74,19 +74,15 @@ class ParticleAccessorWithShape : public data::ParticleAccessor
{ {
public: public:
ParticleAccessorWithShape(std::shared_ptr<data::ParticleStorage>& ps, std::shared_ptr<data::ShapeStorage>& ss) ParticleAccessorWithShape(std::shared_ptr<data::ParticleStorage>& ps, std::shared_ptr<data::ShapeStorage>& ss)
: ParticleAccessor(ps) : ParticleAccessor(ps)
, ss_(ss) , ss_(ss)
{} {}
const walberla::real_t& getInvMass(const size_t p_idx) const {return ss_->shapes[ps_->getShapeIDRef(p_idx)]->getInvMass();} const auto& getInvMass(const size_t p_idx) const {return ss_->shapes[ps_->getShapeID(p_idx)]->getInvMass();}
walberla::real_t& getInvMassRef(const size_t p_idx) {return ss_->shapes[ps_->getShapeIDRef(p_idx)]->getInvMass();}
void setInvMass(const size_t p_idx, const walberla::real_t& v) { ss_->shapes[ps_->getShapeIDRef(p_idx)]->getInvMass() = v;}
const auto& getInvInertiaBF(const size_t p_idx) const {return ss_->shapes[ps_->getShapeIDRef(p_idx)]->getInvInertiaBF();} const auto& getInvInertiaBF(const size_t p_idx) const {return ss_->shapes[ps_->getShapeID(p_idx)]->getInvInertiaBF();}
auto& getInvInertiaBFRef(const size_t p_idx) {return ss_->shapes[ps_->getShapeIDRef(p_idx)]->getInvInertiaBF();}
void setInvInertiaBF(const size_t p_idx, const Mat3& v) { ss_->shapes[ps_->getShapeIDRef(p_idx)]->getInvInertiaBF() = v;}
data::BaseShape* getShape(const size_t p_idx) const {return ss_->shapes[ps_->getShapeIDRef(p_idx)].get();} data::BaseShape* getShape(const size_t p_idx) const {return ss_->shapes[ps_->getShapeID(p_idx)].get();}
private: private:
std::shared_ptr<data::ShapeStorage> ss_; std::shared_ptr<data::ShapeStorage> ss_;
}; };
......
...@@ -99,19 +99,15 @@ class ParticleAccessorWithShape : public data::ParticleAccessor ...@@ -99,19 +99,15 @@ class ParticleAccessorWithShape : public data::ParticleAccessor
{ {
public: public:
ParticleAccessorWithShape(std::shared_ptr<data::ParticleStorage>& ps, std::shared_ptr<data::ShapeStorage>& ss) ParticleAccessorWithShape(std::shared_ptr<data::ParticleStorage>& ps, std::shared_ptr<data::ShapeStorage>& ss)
: ParticleAccessor(ps) : ParticleAccessor(ps)
, ss_(ss) , ss_(ss)
{} {}
const walberla::real_t& getInvMass(const size_t p_idx) const {return ss_->shapes[ps_->getShapeIDRef(p_idx)]->getInvMass();} const auto& getInvMass(const size_t p_idx) const {return ss_->shapes[ps_->getShapeID(p_idx)]->getInvMass();}
walberla::real_t& getInvMassRef(const size_t p_idx) {return ss_->shapes[ps_->getShapeIDRef(p_idx)]->getInvMass();}
void setInvMass(const size_t p_idx, const walberla::real_t& v) { ss_->shapes[ps_->getShapeIDRef(p_idx)]->getInvMass() = v;}
const auto& getInvInertiaBF(const size_t p_idx) const {return ss_->shapes[ps_->getShapeIDRef(p_idx)]->getInvInertiaBF();} const auto& getInvInertiaBF(const size_t p_idx) const {return ss_->shapes[ps_->getShapeID(p_idx)]->getInvInertiaBF();}
auto& getInvInertiaBFRef(const size_t p_idx) {return ss_->shapes[ps_->getShapeIDRef(p_idx)]->getInvInertiaBF();}
void setInvInertiaBF(const size_t p_idx, const Mat3& v) { ss_->shapes[ps_->getShapeIDRef(p_idx)]->getInvInertiaBF() = v;}
data::BaseShape* getShape(const size_t p_idx) const {return ss_->shapes[ps_->getShapeIDRef(p_idx)].get();} data::BaseShape* getShape(const size_t p_idx) const {return ss_->shapes[ps_->getShapeID(p_idx)].get();}
private: private:
std::shared_ptr<data::ShapeStorage> ss_; std::shared_ptr<data::ShapeStorage> ss_;
}; };
......
...@@ -33,6 +33,7 @@ if __name__ == '__main__': ...@@ -33,6 +33,7 @@ if __name__ == '__main__':
ch = data.ContactHistory() ch = data.ContactHistory()
lc = data.LinkedCells() lc = data.LinkedCells()
ss = data.ShapeStorage(ps, shapes) ss = data.ShapeStorage(ps, shapes)
cs = data.ContactStorage()
ps.addProperty("position", "walberla::mesa_pd::Vec3", defValue="real_t(0)", syncMode="ALWAYS") 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("linearVelocity", "walberla::mesa_pd::Vec3", defValue="real_t(0)", syncMode="ALWAYS")
...@@ -54,14 +55,37 @@ if __name__ == '__main__': ...@@ -54,14 +55,37 @@ if __name__ == '__main__':
ps.addProperty("oldContactHistory", "std::map<walberla::id_t, walberla::mesa_pd::data::ContactHistory>", defValue="", syncMode="ALWAYS") ps.addProperty("oldContactHistory", "std::map<walberla::id_t, walberla::mesa_pd::data::ContactHistory>", defValue="", syncMode="ALWAYS")
ps.addProperty("newContactHistory", "std::map<walberla::id_t, walberla::mesa_pd::data::ContactHistory>", defValue="", syncMode="NEVER") ps.addProperty("newContactHistory", "std::map<walberla::id_t, walberla::mesa_pd::data::ContactHistory>", defValue="", syncMode="NEVER")
ps.addProperty("temperature", "walberla::real_t", defValue="real_t(0)", syncMode="ALWAYS") ps.addProperty("temperature", "walberla::real_t", defValue="real_t(0)", syncMode="ALWAYS")
ps.addProperty("heatFlux", "walberla::real_t", defValue="real_t(0)", syncMode="NEVER") ps.addProperty("heatFlux", "walberla::real_t", defValue="real_t(0)", syncMode="NEVER")
# Properties for HCSITS
ps.addProperty("dv", "walberla::mesa_pd::Vec3", defValue="real_t(0)", syncMode="NEVER")
ps.addProperty("dw", "walberla::mesa_pd::Vec3", defValue="real_t(0)", syncMode="NEVER")
ch.addProperty("tangentialSpringDisplacement", "walberla::mesa_pd::Vec3", defValue="real_t(0)") ch.addProperty("tangentialSpringDisplacement", "walberla::mesa_pd::Vec3", defValue="real_t(0)")
ch.addProperty("isSticking", "bool", defValue="false") ch.addProperty("isSticking", "bool", defValue="false")
ch.addProperty("impactVelocityMagnitude", "real_t", defValue="real_t(0)") ch.addProperty("impactVelocityMagnitude", "real_t", defValue="real_t(0)")
cs.addProperty("id1", "walberla::id_t", defValue = "walberla::id_t(-1)", syncMode="NEVER")
cs.addProperty("id2", "walberla::id_t", defValue = "walberla::id_t(-1)", syncMode="NEVER")
cs.addProperty("distance", "real_t", defValue = "real_t(1)", syncMode="NEVER")
cs.addProperty("normal", "walberla::mesa_pd::Vec3", defValue = "real_t(0)", syncMode="NEVER")
cs.addProperty("position", "walberla::mesa_pd::Vec3", defValue = "real_t(0)", syncMode="NEVER")
cs.addProperty("t", "walberla::mesa_pd::Vec3", defValue = "real_t(0)", syncMode="NEVER")
cs.addProperty("o", "walberla::mesa_pd::Vec3", defValue = "real_t(0)", syncMode="NEVER")
cs.addProperty("r1", "walberla::mesa_pd::Vec3", defValue = "real_t(0)", syncMode="NEVER")
cs.addProperty("r2", "walberla::mesa_pd::Vec3", defValue = "real_t(0)", syncMode="NEVER")
cs.addProperty("mu", "real_t", defValue = "real_t(0)", syncMode="NEVER")
cs.addProperty("p", "walberla::mesa_pd::Vec3", defValue = "real_t(0)", syncMode="NEVER")
cs.addProperty("diag_nto", "walberla::mesa_pd::Mat3", defValue = "real_t(0)", syncMode="NEVER")
cs.addProperty("diag_nto_inv", "walberla::mesa_pd::Mat3", defValue = "real_t(0)", syncMode="NEVER")
cs.addProperty("diag_to_inv", "walberla::mesa_pd::Mat2", defValue = "real_t(0)", syncMode="NEVER")
cs.addProperty("diag_n_inv", "real_t", defValue = "real_t(0)", syncMode="NEVER")
cs.addProperty("p", "walberla::mesa_pd::Vec3", defValue = "real_t(0)", syncMode="NEVER")
kernels = [] kernels = []
kernels.append( kernel.DetectAndStoreContacts() )
kernels.append( kernel.DoubleCast(shapes) ) kernels.append( kernel.DoubleCast(shapes) )
kernels.append( kernel.ExplicitEuler() ) kernels.append( kernel.ExplicitEuler() )
kernels.append( kernel.ExplicitEulerWithShape() ) kernels.append( kernel.ExplicitEulerWithShape() )
...@@ -76,6 +100,7 @@ if __name__ == '__main__': ...@@ -76,6 +100,7 @@ if __name__ == '__main__':
kernels.append( kernel.VelocityVerlet() ) kernels.append( kernel.VelocityVerlet() )
kernels.append( kernel.VelocityVerletWithShape() ) kernels.append( kernel.VelocityVerletWithShape() )
ac = Accessor() ac = Accessor()
for k in kernels: for k in kernels:
ac.mergeRequirements(k.getRequirements()) ac.mergeRequirements(k.getRequirements())
...@@ -86,6 +111,7 @@ if __name__ == '__main__': ...@@ -86,6 +111,7 @@ if __name__ == '__main__':
comm.append(mpi.ClearNextNeighborSync()) comm.append(mpi.ClearNextNeighborSync())
comm.append(mpi.ReduceContactHistory()) comm.append(mpi.ReduceContactHistory())
comm.append(mpi.ReduceProperty()) comm.append(mpi.ReduceProperty())
comm.append(mpi.SyncGhostOwners(ps))
comm.append(mpi.SyncNextNeighbors(ps)) comm.append(mpi.SyncNextNeighbors(ps))
...@@ -93,6 +119,7 @@ if __name__ == '__main__': ...@@ -93,6 +119,7 @@ if __name__ == '__main__':
ch.generate(args.path + "/src/mesa_pd/") ch.generate(args.path + "/src/mesa_pd/")
lc.generate(args.path + "/src/mesa_pd/") lc.generate(args.path + "/src/mesa_pd/")
ss.generate(args.path + "/src/mesa_pd/") ss.generate(args.path + "/src/mesa_pd/")
cs.generate(args.path + "/src/mesa_pd/")
for k in kernels: for k in kernels:
k.generate(args.path + "/src/mesa_pd/") k.generate(args.path + "/src/mesa_pd/")
......
# -*- coding: utf-8 -*-
import numpy as np
from ..Container import Container
from ..utility import generateFile
class ContactStorage(Container):
def __init__(self):
super().__init__()
self.addProperty("uid", "walberla::id_t", defValue = "walberla::id_t(-1)", syncMode="NEVER")
def generate(self, path):
self.unrollDimension()
print("="*90)
print("Creating ContactStorage Datastructure:")
print("")
print("{0: <20}{1: <30}{2: <20}{3: <10}".format("Type", "Name", "Def. Value", "SyncMode"))
print("="*90)
for prop in self.properties:
print("{0: <20.19}{1: <30.29}{2: <20.19}{3: <10.9}".format(prop.type, prop.name, prop.defValue, prop.syncMode))
print("="*90)
context = dict()
context["includes"] = self.includes
context["properties"] = self.properties
generateFile(path, 'data/ContactStorage.templ.h', context, filename='data/ContactStorage.h')
generateFile(path, 'data/ContactAccessor.templ.h', context, filename='data/ContactAccessor.h')
...@@ -10,12 +10,12 @@ class ParticleStorage(Container): ...@@ -10,12 +10,12 @@ class ParticleStorage(Container):
self.addInclude("mesa_pd/data/Flags.h") self.addInclude("mesa_pd/data/Flags.h")
self.addProperty("uid", "walberla::id_t", defValue = "UniqueID<data::Particle>::invalidID()", syncMode="ALWAYS") self.addProperty("uid", "walberla::id_t", defValue = "UniqueID<data::Particle>::invalidID()", syncMode="ALWAYS")
self.addProperty("position", "walberla::mesa_pd::Vec3", defValue = "real_t(0)", syncMode="ALWAYS") self.addProperty("position", "walberla::mesa_pd::Vec3", defValue = "real_t(0)", syncMode="ALWAYS")
self.addProperty("interactionRadius", "walberla::real_t", defValue = "real_t(0)", syncMode="COPY") self.addProperty("interactionRadius", "walberla::real_t", defValue = "real_t(0)", syncMode="COPY")
self.addProperty("flags", "walberla::mesa_pd::data::particle_flags::FlagT", defValue = "", syncMode="COPY") self.addProperty("flags", "walberla::mesa_pd::data::particle_flags::FlagT", defValue = "", syncMode="COPY")
self.addProperty("owner", "int", defValue = "-1", syncMode="COPY") self.addProperty("owner", "int", defValue = "-1", syncMode="COPY")
self.addProperty("ghostOwners", "std::vector<int>", defValue = "", syncMode="MIGRATION") self.addProperty("ghostOwners", "std::unordered_set<walberla::mpi::MPIRank>", defValue = "", syncMode="MIGRATION")
def generate(self, path): def generate(self, path):
self.unrollDimension() self.unrollDimension()
...@@ -40,7 +40,9 @@ class ParticleStorage(Container): ...@@ -40,7 +40,9 @@ class ParticleStorage(Container):
generateFile(path, 'mpi/notifications/HeatFluxNotification.templ.h', context) generateFile(path, 'mpi/notifications/HeatFluxNotification.templ.h', context)
generateFile(path, 'mpi/notifications/ParseMessage.templ.h', context) generateFile(path, 'mpi/notifications/ParseMessage.templ.h', context)
generateFile(path, 'mpi/notifications/ParticleCopyNotification.templ.h', context) generateFile(path, 'mpi/notifications/ParticleCopyNotification.templ.h', context)
generateFile(path, 'mpi/notifications/NewGhostParticleNotification.templ.h', context)
generateFile(path, 'mpi/notifications/ParticleMigrationNotification.templ.h', context) generateFile(path, 'mpi/notifications/ParticleMigrationNotification.templ.h', context)
generateFile(path, 'mpi/notifications/ParticleRemoteMigrationNotification.templ.h', context) generateFile(path, 'mpi/notifications/ParticleRemoteMigrationNotification.templ.h', context)
generateFile(path, 'mpi/notifications/ParticleRemovalInformationNotification.templ.h', context)
generateFile(path, 'mpi/notifications/ParticleRemovalNotification.templ.h', context) generateFile(path, 'mpi/notifications/ParticleRemovalNotification.templ.h', context)
generateFile(path, 'mpi/notifications/ParticleUpdateNotification.templ.h', context) generateFile(path, 'mpi/notifications/ParticleUpdateNotification.templ.h', context)
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from .ContactHistory import ContactHistory from .ContactHistory import ContactHistory
from .ContactStorage import ContactStorage
from .LinkedCells import LinkedCells from .LinkedCells import LinkedCells
from .ParticleStorage import ParticleStorage from .ParticleStorage import ParticleStorage
from .ShapeStorage import ShapeStorage from .ShapeStorage import ShapeStorage
__all__ = ['ContactHistory', __all__ = ['ContactHistory',
'ContactStorage',
'GeometryStorage', 'GeometryStorage',
'LinkedCells', 'LinkedCells',
'ParticleStorage'] 'ParticleStorage']
# -*- coding: utf-8 -*-
from mesa_pd.accessor import Accessor
from mesa_pd.utility import generateFile
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)
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from .DetectAndStoreContacts import DetectAndStoreContacts
from .DoubleCast import DoubleCast from .DoubleCast import DoubleCast
from .ExplicitEuler import ExplicitEuler from .ExplicitEuler import ExplicitEuler
from .ExplicitEulerWithShape import ExplicitEulerWithShape from .ExplicitEulerWithShape import ExplicitEulerWithShape
...@@ -15,6 +15,7 @@ from .VelocityVerlet import VelocityVerlet ...@@ -15,6 +15,7 @@ from .VelocityVerlet import VelocityVerlet
from .VelocityVerletWithShape import VelocityVerletWithShape from .VelocityVerletWithShape import VelocityVerletWithShape
__all__ = ['DoubleCast', __all__ = ['DoubleCast',
'DetectAndStoreContacts',
'ExplicitEuler', 'ExplicitEuler',
'ExplicitEulerWithShape', 'ExplicitEulerWithShape',
'ForceLJ', 'ForceLJ',
......
# -*- coding: utf-8 -*-
from ..utility import generateFile
class SyncGhostOwners:
def __init__(self, p):
p.addProperty("position", "walberla::mesa_pd::Vec3", defValue="real_t(0)", syncMode="ALWAYS")
p.addProperty("interactionRadius", "walberla::real_t", defValue="real_t(0)", syncMode="ONCE")
p.addProperty("flags", "walberla::mesa_pd::data::particle_flags::FlagT", defValue="", syncMode="ONCE")