MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
lptcollisiondata.h
Go to the documentation of this file.
1// Copyright (C) 2024 The m-AIA AUTHORS
2//
3// This file is part of m-AIA (https://git.rwth-aachen.de/aia/m-AIA/m-AIA)
4//
5// SPDX-License-Identifier: LGPL-3.0-only
6
7#ifndef MAIA_PARTICLECOLLDATA_H
8#define MAIA_PARTICLECOLLDATA_H
9
10#include "globals.h"
11
12template <MInt nDim>
13class LPTSpherical;
14
15template <MInt nDim>
17 public:
19 typename std::vector<LPTSpherical<nDim>>::iterator particle0;
20 typename std::vector<LPTSpherical<nDim>>::iterator particle1;
22
24
25 // constructor for new collision event
26 collStruct(const collStruct& copy) {
27 collTime = copy.collTime;
28 particle0 = copy.particle0;
29 particle1 = copy.particle1;
30 bndryId = copy.bndryId;
31 }
32
33 // destructor
34 ~collStruct() = default;
35
36 // assigns value to existing collision event, required by sort
37
39 this->collTime = rhs.collTime;
40 this->particle0 = rhs.particle0;
41 this->particle1 = rhs.particle1;
42 this->bndryId = rhs.bndryId;
43 return *this;
44 }
45
46 // compares collision times of two collision events, required by sort
47
48 MInt operator==(const collStruct& rhs) const {
49 if(!approx(this->collTime, rhs.collTime, MFloatEps)) {
50 return 0;
51 }
52 return 1;
53 }
54
55 // finds the smaller of two collision times, required by sort
56
57 MInt operator<(const collStruct& rhs) const {
58 if(this->collTime < rhs.collTime) {
59 return 1;
60 }
61 return 0;
62 }
63
64 typename std::vector<LPTSpherical<nDim>>::iterator returnParticle0() const { return particle0; }
65
66 typename std::vector<LPTSpherical<nDim>>::iterator returnParticle1() const { return particle1; }
67};
68
69#endif // MAIA_PARTICLECOLLDATA_H
std::vector< LPTSpherical< nDim > >::iterator particle1
collStruct & operator=(const collStruct &rhs)
std::vector< LPTSpherical< nDim > >::iterator particle0
std::vector< LPTSpherical< nDim > >::iterator returnParticle1() const
MInt operator==(const collStruct &rhs) const
collStruct(const collStruct &copy)
std::vector< LPTSpherical< nDim > >::iterator returnParticle0() const
~collStruct()=default
MInt operator<(const collStruct &rhs) const
MBool approx(const T &, const U &, const T)
Definition: functions.h:272
int32_t MInt
Definition: maiatypes.h:62
double MFloat
Definition: maiatypes.h:52