BioDynaMo  v1.05.159-3be850bb
interaction_force.h
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------
2 //
3 // Copyright (C) 2021 CERN & University of Surrey for the benefit of the
4 // BioDynaMo collaboration. All Rights Reserved.
5 //
6 // Licensed under the Apache License, Version 2.0 (the "License");
7 // you may not use this file except in compliance with the License.
8 //
9 // See the LICENSE file distributed with this work for details.
10 // See the NOTICE file distributed with this work for additional information
11 // regarding copyright ownership.
12 //
13 // -----------------------------------------------------------------------------
14 
15 #ifndef CORE_INTERACTION_FORCE_H_
16 #define CORE_INTERACTION_FORCE_H_
17 
18 #include <array>
19 
21 
22 namespace bdm {
23 
24 class Agent;
25 
27  public:
28  InteractionForce() = default;
29  virtual ~InteractionForce() = default;
30 
31  virtual Real4 Calculate(const Agent* lhs, const Agent* rhs) const;
32  virtual InteractionForce* NewCopy() const {
33  return new InteractionForce(*this);
34  }
35 
36  private:
37  void ForceBetweenSpheres(const Agent* sphere_lhs, const Agent* sphere_rhs,
38  Real3* result) const;
39 
40  void ForceOnACylinderFromASphere(const Agent* cylinder, const Agent* sphere,
41  Real4* result) const;
42 
43  void ForceOnASphereFromACylinder(const Agent* sphere, const Agent* cylinder,
44  Real3* result) const;
45 
46  void ForceBetweenCylinders(const Agent* cylinder1, const Agent* cylinder2,
47  Real4* result) const;
48 
50  const Real3& c2, real_t r2) const;
51 };
52 
53 } // namespace bdm
54 
55 #endif // CORE_INTERACTION_FORCE_H_
Contains code required by all agents.
Definition: agent.h:79
void ForceOnASphereFromACylinder(const Agent *sphere, const Agent *cylinder, Real3 *result) const
InteractionForce()=default
void ForceOnACylinderFromASphere(const Agent *cylinder, const Agent *sphere, Real4 *result) const
virtual InteractionForce * NewCopy() const
void ForceBetweenCylinders(const Agent *cylinder1, const Agent *cylinder2, Real4 *result) const
Real4 ComputeForceOfASphereOnASphere(const Real3 &c1, real_t r1, const Real3 &c2, real_t r2) const
virtual ~InteractionForce()=default
virtual Real4 Calculate(const Agent *lhs, const Agent *rhs) const
void ForceBetweenSpheres(const Agent *sphere_lhs, const Agent *sphere_rhs, Real3 *result) const
Definition: agent.cc:39
double real_t
Definition: real_t.h:21