BioDynaMo  v1.03.61-fe34ced0
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_
bdm::InteractionForce::Calculate
virtual Real4 Calculate(const Agent *lhs, const Agent *rhs) const
Definition: interaction_force.cc:33
bdm::InteractionForce::ComputeForceOfASphereOnASphere
Real4 ComputeForceOfASphereOnASphere(const Real3 &c1, real_t r1, const Real3 &c2, real_t r2) const
Definition: interaction_force.cc:286
bdm::InteractionForce::~InteractionForce
virtual ~InteractionForce()=default
bdm::InteractionForce::InteractionForce
InteractionForce()=default
bdm
Definition: agent.cc:39
bdm::InteractionForce
Definition: interaction_force.h:26
bdm::InteractionForce::NewCopy
virtual InteractionForce * NewCopy() const
Definition: interaction_force.h:32
bdm::real_t
double real_t
Definition: real_t.h:21
bdm::InteractionForce::ForceOnASphereFromACylinder
void ForceOnASphereFromACylinder(const Agent *sphere, const Agent *cylinder, Real3 *result) const
Definition: interaction_force.cc:203
bdm::Agent
Contains code required by all agents.
Definition: agent.h:79
bdm::InteractionForce::ForceBetweenCylinders
void ForceBetweenCylinders(const Agent *cylinder1, const Agent *cylinder2, Real4 *result) const
Definition: interaction_force.cc:213
bdm::InteractionForce::ForceBetweenSpheres
void ForceBetweenSpheres(const Agent *sphere_lhs, const Agent *sphere_rhs, Real3 *result) const
Definition: interaction_force.cc:60
math_array.h
bdm::InteractionForce::ForceOnACylinderFromASphere
void ForceOnACylinderFromASphere(const Agent *cylinder, const Agent *sphere, Real4 *result) const
Definition: interaction_force.cc:113
bdm::MathArray
Definition: math_array.h:36