Skip to content

Commit f8ac5fd

Browse files
committed
Be consistent with centre/center
1 parent 36cb9e2 commit f8ac5fd

29 files changed

+148
-148
lines changed

Code/redblood/CellArmy.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ namespace hemelb
220220
{
221221
throw Exception() << "Process " << fieldData.GetDomain().GetCommunicator().Rank()
222222
<< " cannot determine the owner of cell " << cell->GetTag()
223-
<< " with barycenter " << cell->GetBarycenter();
223+
<< " with barycentre " << cell->GetBarycentre();
224224
}
225225
return owner;
226226
};
@@ -308,10 +308,10 @@ namespace hemelb
308308
auto const i_end = cells.cend();
309309
while (i_first != i_end)
310310
{
311-
auto const barycenter = (*i_first)->GetBarycenter();
312-
auto checkCell = [&barycenter](FlowExtension const &flow)
311+
auto const barycentre = (*i_first)->GetBarycentre();
312+
auto checkCell = [&barycentre](FlowExtension const &flow)
313313
{
314-
return contains(flow, barycenter);
314+
return contains(flow, barycentre);
315315
};
316316
// save current iterator and increment before potential removal.
317317
// removing the cell from the set should invalidate only the relevant iterator.
@@ -320,7 +320,7 @@ namespace hemelb
320320
if (std::find_if(outlets.begin(), outlets.end(), checkCell) != outlets.end())
321321
{
322322
std::stringstream message;
323-
message << "Removing cell "<< (*i_current)->GetTag() << " at " << barycenter;
323+
message << "Removing cell "<< (*i_current)->GetTag() << " at " << barycentre;
324324
log::Logger::Log<log::Info, log::OnePerCore>(message.str());
325325

326326
cellDnC.remove(*i_current);
@@ -335,18 +335,18 @@ namespace hemelb
335335
template<class TRAITS>
336336
void CellArmy<TRAITS>::AddCell(CellContainer::value_type cell)
337337
{
338-
auto const barycenter = cell->GetBarycenter();
338+
auto const barycentre = cell->GetBarycentre();
339339

340340
//! @todo: #623 AddCell should only be called if the subdomain contains the relevant RBC inlet
341-
// TODO: #759 truncation of barycenter
342-
auto const iter = globalCoordsToProcMap.find(Vec16{barycenter});
341+
// TODO: #759 truncation of barycentre
342+
auto const iter = globalCoordsToProcMap.find(Vec16{barycentre});
343343
bool insertAtThisRank = (iter != globalCoordsToProcMap.end()) && (iter->second == neighbourDependenciesGraph.Rank());
344344
if (insertAtThisRank)
345345
{
346346
log::Logger::Log<log::Info, log::OnePerCore>("Adding cell at (%f, %f, %f)",
347-
barycenter.x(),
348-
barycenter.y(),
349-
barycenter.z());
347+
barycentre.x(),
348+
barycentre.y(),
349+
barycentre.z());
350350
cellDnC.insert(cell);
351351
cells.insert(cell);
352352

@@ -365,9 +365,9 @@ namespace hemelb
365365
if (numCellsAdded != 1)
366366
{
367367
log::Logger::Log<log::Info, log::OnePerCore>("Failed to add cell at (%f, %f, %f). It was added %d times.",
368-
barycenter.x(),
369-
barycenter.y(),
370-
barycenter.z(),
368+
barycentre.x(),
369+
barycentre.y(),
370+
barycentre.z(),
371371
numCellsAdded);
372372

373373
hemelb::net::MpiEnvironment::Abort(-1);

Code/redblood/CellBase.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ namespace hemelb
8282
{
8383
return static_cast<site_t>(data->vertices.size());
8484
}
85-
MeshData::Vertices::value_type CellBase::GetBarycenter() const
85+
MeshData::Vertices::value_type CellBase::GetBarycentre() const
8686
{
87-
return barycenter(data->vertices);
87+
return barycentre(data->vertices);
8888
}
8989

9090
//! Scale to apply to the template mesh
@@ -101,21 +101,21 @@ namespace hemelb
101101

102102
void CellBase::operator*=(Dimensionless const &scaleIn)
103103
{
104-
auto const barycenter = GetBarycenter();
104+
auto const barycentre = GetBarycentre();
105105

106106
for (auto &vertex : data->vertices)
107107
{
108-
vertex = (vertex - barycenter) * scaleIn + barycenter;
108+
vertex = (vertex - barycentre) * scaleIn + barycentre;
109109
}
110110
}
111111
void CellBase::operator*=(util::Matrix3D const &rotation)
112112
{
113-
auto const barycenter = GetBarycenter();
113+
auto const barycentre = GetBarycentre();
114114

115115
for (auto &vertex : data->vertices)
116116
{
117-
rotation.timesVector(vertex - barycenter, vertex);
118-
vertex += barycenter;
117+
rotation.timesVector(vertex - barycentre, vertex);
118+
vertex += barycentre;
119119
}
120120
}
121121
void CellBase::operator+=(LatticePosition const &offset)

Code/redblood/CellBase.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ namespace hemelb
124124
return operator()(in);
125125
}
126126

127-
//! Scale mesh around barycenter
127+
//! Scale mesh around barycentre
128128
void operator*=(Dimensionless const &);
129-
//! Linear transform of each vertex, centered around barycenter
129+
//! Linear transform of each vertex, centered around barycentre
130130
void operator*=(util::Matrix3D const &);
131131
//! Translate mesh
132132
void operator+=(LatticePosition const &offset);
@@ -138,7 +138,7 @@ namespace hemelb
138138
//! Transform mesh
139139
void operator+=(std::vector<LatticePosition> const &displacements);
140140

141-
MeshData::Vertices::value_type GetBarycenter() const;
141+
MeshData::Vertices::value_type GetBarycentre() const;
142142
LatticeVolume GetVolume() const
143143
{
144144
return volume(GetVertices(), GetTemplateMesh().GetFacets());

Code/redblood/CellControllerBuilder.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ namespace hemelb::redblood {
5555
cell *= rotation;
5656

5757
// Figure out size of cell alongst cylinder axis
58-
auto const barycenter = cell.GetBarycenter();
59-
auto maxExtent = [barycenter, &flowExtension](LatticePosition const pos)
58+
auto const barycentre = cell.GetBarycentre();
59+
auto maxExtent = [barycentre, &flowExtension](LatticePosition const pos)
6060
{
61-
return std::max(Dot(pos - barycenter, flowExtension.normal), 0e0);
61+
return std::max(Dot(pos - barycentre, flowExtension.normal), 0e0);
6262
};
6363
auto const maxZ =
6464
*std::max_element(cell.GetVertices().begin(),
@@ -69,7 +69,7 @@ namespace hemelb::redblood {
6969
});
7070
// Place cell as close as possible to 0 of fade length
7171
cell += flowExtension.origin
72-
+ flowExtension.normal * (flowExtension.fadeLength - maxExtent(maxZ)) - barycenter
72+
+ flowExtension.normal * (flowExtension.fadeLength - maxExtent(maxZ)) - barycentre
7373
+ rotateToFlow * translation;
7474

7575
// fail if any node outside flow extension

Code/redblood/CellIO.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ namespace hemelb::redblood {
104104
for (auto [i, cell]: util::enumerate(cells)) {
105105
std::byte tag[UUID_STRING_LEN];
106106
boost::uuids::to_chars(cell->GetTag(), reinterpret_cast<char*>(tag));
107-
xdrWriter << std::span<std::byte>(tag, UUID_STRING_LEN) << cell->GetBarycenter();
107+
xdrWriter << std::span<std::byte>(tag, UUID_STRING_LEN) << cell->GetBarycentre();
108108
}
109109

110110
auto bary_filename = rbcOutputDir / "barycentres.rbc";

Code/redblood/FaderCell.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ namespace hemelb
1212
{
1313
LatticeEnergy FaderCell::operator()() const
1414
{
15-
auto const barycenter = wrappee->GetBarycenter();
15+
auto const barycentre = wrappee->GetBarycentre();
1616
auto const energy = wrappee->Energy();
1717
for (auto const& extension : *iolets)
1818
{
19-
auto const weight = linearWeight(extension, barycenter);
19+
auto const weight = linearWeight(extension, barycentre);
2020
if (weight > 1e-12)
2121
{
2222
return energy * weight;
@@ -27,11 +27,11 @@ namespace hemelb
2727

2828
LatticeEnergy FaderCell::operator()(std::vector<LatticeForceVector> &forces) const
2929
{
30-
auto const barycenter = wrappee->GetBarycenter();
30+
auto const barycentre = wrappee->GetBarycentre();
3131
auto const energy = wrappee->Energy(forces);
3232
for (auto const& extension : *iolets)
3333
{
34-
auto const weight = linearWeight(extension, barycenter);
34+
auto const weight = linearWeight(extension, barycentre);
3535
if (weight > 1e-12)
3636
{
3737
for (auto& force : forces)

Code/redblood/Mesh.cc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ namespace hemelb::redblood
2525
static_assert(std::is_same<IdType, vtkIdType>::value,
2626
"hemelb::redblood::IdType must be the same as vtkIdType");
2727

28-
LatticePosition barycenter(MeshData::Vertices const &vertices)
28+
LatticePosition barycentre(MeshData::Vertices const &vertices)
2929
{
3030
typedef MeshData::Vertices::value_type Vertex;
3131
return std::accumulate(vertices.begin(), vertices.end(), Vertex(0, 0, 0))
3232
/ Vertex::value_type(vertices.size());
3333
}
34-
LatticePosition barycenter(MeshData const &mesh)
34+
LatticePosition barycentre(MeshData const &mesh)
3535
{
36-
return barycenter(mesh.vertices);
36+
return barycentre(mesh.vertices);
3737
}
3838
LatticeVolume volume(MeshData::Vertices const &vertices, MeshData::Facets const &facets)
3939
{
@@ -160,22 +160,22 @@ namespace hemelb::redblood
160160

161161
void Mesh::operator*=(Dimensionless const &scale)
162162
{
163-
auto const barycenter = GetBarycenter();
163+
auto const barycentre = GetBarycentre();
164164

165165
for (auto &vertex : mesh->vertices)
166166
{
167-
vertex = (vertex - barycenter) * scale + barycenter;
167+
vertex = (vertex - barycentre) * scale + barycentre;
168168
}
169169
}
170170

171171
void Mesh::operator*=(util::Matrix3D const &rotation)
172172
{
173-
auto const barycenter = GetBarycenter();
173+
auto const barycentre = GetBarycentre();
174174

175175
for (auto &vertex : mesh->vertices)
176176
{
177-
rotation.timesVector(vertex - barycenter, vertex);
178-
vertex += barycenter;
177+
rotation.timesVector(vertex - barycentre, vertex);
178+
vertex += barycentre;
179179
}
180180
}
181181

Code/redblood/Mesh.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ namespace hemelb::redblood
4646
"Explicit type characteristics"
4747
);
4848

49-
LatticePosition barycenter(MeshData const &mesh);
50-
LatticePosition barycenter(MeshData::Vertices const &vertices);
49+
LatticePosition barycentre(MeshData const &mesh);
50+
LatticePosition barycentre(MeshData::Vertices const &vertices);
5151
LatticeVolume volume(MeshData const &mesh);
5252
LatticeVolume volume(MeshData::Vertices const &vertices, MeshData::Facets const &facets);
5353
LatticeArea area(MeshData const &mesh);
5454
LatticeArea area(MeshData::Vertices const &vertices, MeshData::Facets const &facets);
55-
//! DEPRECATED. Orients facets outward, or inward. Algorithm cannot handle case of facet being coplanar with mesh barycenter.
55+
//! DEPRECATED. Orients facets outward, or inward. Algorithm cannot handle case of facet being coplanar with mesh barycentre.
5656
unsigned orientFacets(MeshData &mesh, bool outward = true);
5757
//! Orients facets inwards/outwards using VTK algorithm to determining outward facing direction. MeshData object should have been constructed from vtkPolyData object. See readMeshDataFromVTKPolyData.
5858
unsigned orientFacets(MeshData &mesh, vtkPolyData &polydata, bool outward = true);
@@ -126,10 +126,10 @@ namespace hemelb::redblood
126126
{
127127
}
128128

129-
//! Determines barycenter of mesh
130-
LatticePosition GetBarycenter() const
129+
//! Determines barycentre of mesh
130+
LatticePosition GetBarycentre() const
131131
{
132-
return barycenter(*mesh);
132+
return barycentre(*mesh);
133133
}
134134
//! Computes volume of the mesh
135135
LatticeVolume GetVolume() const
@@ -168,9 +168,9 @@ namespace hemelb::redblood
168168
return Mesh(*this, deepcopy_tag());
169169
}
170170

171-
//! Scale mesh around barycenter
171+
//! Scale mesh around barycentre
172172
void operator*=(Dimensionless const &scale);
173-
//! Scale by matrix around barycenter
173+
//! Scale by matrix around barycentre
174174
void operator*=(util::Matrix3D const &rotation);
175175
//! Translate mesh
176176
void operator+=(LatticePosition const &offset);

Code/redblood/RBCInserter.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,16 @@ namespace hemelb::redblood
4242
* @param scale the scale of the cell to insert
4343
*/
4444
RBCInserter(std::function<bool()> condition, std::unique_ptr<CellBase const> cell) :
45-
condition(std::move(condition)), cell(std::move(cell)), barycenter(this->cell->GetBarycenter())
45+
condition(std::move(condition)), cell(std::move(cell)), barycentre(this->cell->GetBarycentre())
4646
{
4747
}
4848
RBCInserter(RBCInserter &&c) :
4949
condition(std::move(c.condition)), cell(std::move(c.cell)),
50-
barycenter(c.barycenter)
50+
barycentre(c.barycentre)
5151
{
5252
}
5353
RBCInserter(RBCInserter const&c) :
54-
condition(c.condition), cell(c.cell->clone()), barycenter(c.barycenter)
54+
condition(c.condition), cell(c.cell->clone()), barycentre(c.barycentre)
5555
{
5656
}
5757
virtual ~RBCInserter() = default;
@@ -82,9 +82,9 @@ namespace hemelb::redblood
8282
if (condition())
8383
{
8484
log::Logger::Log<log::Debug, log::OnePerCore>("Dropping one cell at (%f, %f, %f)",
85-
barycenter.x(),
86-
barycenter.y(),
87-
barycenter.z());
85+
barycentre.x(),
86+
barycentre.y(),
87+
barycentre.z());
8888
insertFn(drop());
8989
}
9090
}
@@ -99,8 +99,8 @@ namespace hemelb::redblood
9999
std::function<bool()> condition;
100100
//! The shape of the cells to insert
101101
std::unique_ptr<CellBase const> cell;
102-
//! barycenter -- for logging
103-
LatticePosition barycenter;
102+
//! barycentre -- for logging
103+
LatticePosition barycentre;
104104
};
105105

106106
//! Red blood cell inserter that adds random rotation and translation to each cell

Code/redblood/buffer/Buffer.cc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ namespace hemelb::redblood::buffer
1414
{
1515
LatticeDistance maxCellRadius(CellBase const& cell)
1616
{
17-
auto const barycenter = cell.GetBarycenter();
17+
auto const barycentre = cell.GetBarycentre();
1818
auto const &vertices = cell.GetVertices();
1919
auto const first = vertices.begin();
20-
auto dist = [&barycenter](LatticePosition const &a, LatticePosition const &b)
20+
auto dist = [&barycentre](LatticePosition const &a, LatticePosition const &b)
2121
{
22-
return (a-barycenter).GetMagnitudeSquared() < (b-barycenter).GetMagnitudeSquared();
22+
return (a-barycentre).GetMagnitudeSquared() < (b-barycentre).GetMagnitudeSquared();
2323
};
2424
LatticePosition const &max = *std::max_element(first, vertices.end(), dist);
25-
return 4e0 * (max - barycenter).GetMagnitudeSquared();
25+
return 4e0 * (max - barycentre).GetMagnitudeSquared();
2626
}
2727

2828
template<class T_FUNC>
@@ -49,7 +49,7 @@ namespace hemelb::redblood::buffer
4949
auto const &normal = geometry->normal;
5050
auto getdist = [&normal](CellContainer::value_type const& c)
5151
{
52-
return Dot(c->GetBarycenter(), normal);
52+
return Dot(c->GetBarycentre(), normal);
5353
};
5454
return orderedCell(getdist, virtuals);
5555
}
@@ -59,7 +59,7 @@ namespace hemelb::redblood::buffer
5959
auto const &normal = geometry->normal;
6060
auto getdist = [&normal](const CellContainer::value_type& c)
6161
{
62-
return -Dot(c->GetBarycenter(), normal);
62+
return -Dot(c->GetBarycentre(), normal);
6363
};
6464
return orderedCell(getdist, virtuals);
6565
}
@@ -69,7 +69,7 @@ namespace hemelb::redblood::buffer
6969
justDropped = nearestCell();
7070
virtuals.erase(justDropped);
7171

72-
lastZ = Dot(justDropped->GetBarycenter(), geometry->normal);
72+
lastZ = Dot(justDropped->GetBarycentre(), geometry->normal);
7373
*justDropped += geometry->origin + geometry->normal * offset;
7474
return justDropped;
7575
}
@@ -110,7 +110,7 @@ namespace hemelb::redblood::buffer
110110
lastCell = furthestCell();
111111
}
112112
// add cell until outside geometry, including interaction radius buffer.
113-
while (isDroppablePosition(lastCell->GetBarycenter() - geometry->normal * interactionRadius))
113+
while (isDroppablePosition(lastCell->GetBarycentre() - geometry->normal * interactionRadius))
114114
{
115115
lastCell = insertCell();
116116
}
@@ -157,13 +157,13 @@ namespace hemelb::redblood::buffer
157157
}
158158

159159
auto const normal = geometry->normal;
160-
auto const zCell = Dot(normal, nearestCell()->GetBarycenter());
160+
auto const zCell = Dot(normal, nearestCell()->GetBarycentre());
161161
if (not justDropped)
162162
{
163163
offset = -zCell;
164164
return;
165165
}
166-
auto const zDropped = Dot(normal, justDropped->GetBarycenter() - geometry->origin) - offset;
166+
auto const zDropped = Dot(normal, justDropped->GetBarycentre() - geometry->origin) - offset;
167167
// dropped cell moved forward but distance with next cell is small
168168
// Then movement must the smallest of:
169169
// - distance moved by dropped cell over last LB iteration

0 commit comments

Comments
 (0)