Chaste
Commit::1fd4e48e3990e67db148bc1bc4cf6991a0049d0c
CellRemovalLocationsWriter.cpp
1
/*
2
3
Copyright (c) 2005-2024, University of Oxford.
4
All rights reserved.
5
6
University of Oxford means the Chancellor, Masters and Scholars of the
7
University of Oxford, having an administrative office at Wellington
8
Square, Oxford OX1 2JD, UK.
9
10
This file is part of Chaste.
11
12
Redistribution and use in source and binary forms, with or without
13
modification, are permitted provided that the following conditions are met:
14
* Redistributions of source code must retain the above copyright notice,
15
this list of conditions and the following disclaimer.
16
* Redistributions in binary form must reproduce the above copyright notice,
17
this list of conditions and the following disclaimer in the documentation
18
and/or other materials provided with the distribution.
19
* Neither the name of the University of Oxford nor the names of its
20
contributors may be used to endorse or promote products derived from this
21
software without specific prior written permission.
22
23
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
27
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
29
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
32
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
34
*/
35
36
#include "CellRemovalLocationsWriter.hpp"
37
#include "AbstractCellPopulation.hpp"
38
#include "CaBasedCellPopulation.hpp"
39
#include "MeshBasedCellPopulation.hpp"
40
#include "NodeBasedCellPopulation.hpp"
41
#include "PottsBasedCellPopulation.hpp"
42
#include "VertexBasedCellPopulation.hpp"
43
#include "ImmersedBoundaryCellPopulation.hpp"
44
45
template
<
unsigned
ELEMENT_DIM,
unsigned
SPACE_DIM>
46
CellRemovalLocationsWriter<ELEMENT_DIM, SPACE_DIM>::CellRemovalLocationsWriter
()
47
:
AbstractCellPopulationEventWriter
<ELEMENT_DIM, SPACE_DIM>(
"removals.dat"
)
48
{
49
}
50
51
template
<
unsigned
ELEMENT_DIM,
unsigned
SPACE_DIM>
52
void
CellRemovalLocationsWriter<ELEMENT_DIM, SPACE_DIM>::VisitAnyPopulation
(
AbstractCellPopulation<SPACE_DIM, SPACE_DIM>
* pCellPopulation)
53
{
54
std::vector<std::string> removals_information = pCellPopulation->
GetRemovalsInformation
();
55
56
for
(
unsigned
index = 0; index < removals_information.size(); index++)
57
{
58
*this->mpOutStream << removals_information[index] <<
"\n"
;
59
}
60
61
pCellPopulation->
ClearRemovalsInformation
();
62
}
63
64
template
<
unsigned
ELEMENT_DIM,
unsigned
SPACE_DIM>
65
void
CellRemovalLocationsWriter<ELEMENT_DIM, SPACE_DIM>::Visit
(
MeshBasedCellPopulation<ELEMENT_DIM, SPACE_DIM>
* pCellPopulation)
66
{
67
std::vector<std::string> removals_information = pCellPopulation->
GetRemovalsInformation
();
68
69
for
(
unsigned
index = 0; index < removals_information.size(); index++)
70
{
71
*this->mpOutStream << removals_information[index] <<
"\n"
;
72
}
73
74
pCellPopulation->
ClearRemovalsInformation
();
75
76
//VisitAnyPopulation(pCellPopulation);
77
}
78
79
template
<
unsigned
ELEMENT_DIM,
unsigned
SPACE_DIM>
80
void
CellRemovalLocationsWriter<ELEMENT_DIM, SPACE_DIM>::Visit
(
CaBasedCellPopulation<SPACE_DIM>
* pCellPopulation)
81
{
82
VisitAnyPopulation(pCellPopulation);
83
}
84
85
template
<
unsigned
ELEMENT_DIM,
unsigned
SPACE_DIM>
86
void
CellRemovalLocationsWriter<ELEMENT_DIM, SPACE_DIM>::Visit
(
NodeBasedCellPopulation<SPACE_DIM>
* pCellPopulation)
87
{
88
VisitAnyPopulation(pCellPopulation);
89
}
90
91
template
<
unsigned
ELEMENT_DIM,
unsigned
SPACE_DIM>
92
void
CellRemovalLocationsWriter<ELEMENT_DIM, SPACE_DIM>::Visit
(
PottsBasedCellPopulation<SPACE_DIM>
* pCellPopulation)
93
{
94
VisitAnyPopulation(pCellPopulation);
95
}
96
97
template
<
unsigned
ELEMENT_DIM,
unsigned
SPACE_DIM>
98
void
CellRemovalLocationsWriter<ELEMENT_DIM, SPACE_DIM>::Visit
(
VertexBasedCellPopulation<SPACE_DIM>
* pCellPopulation)
99
{
100
VisitAnyPopulation(pCellPopulation);
101
}
102
103
template
<
unsigned
ELEMENT_DIM,
unsigned
SPACE_DIM>
104
void
CellRemovalLocationsWriter<ELEMENT_DIM, SPACE_DIM>::Visit
(
ImmersedBoundaryCellPopulation<SPACE_DIM>
* pCellPopulation)
105
{
106
VisitAnyPopulation(pCellPopulation);
107
}
108
109
// Explicit instantiation
110
template
class
CellRemovalLocationsWriter<1, 1>
;
111
template
class
CellRemovalLocationsWriter<1, 2>
;
112
template
class
CellRemovalLocationsWriter<2, 2>
;
113
template
class
CellRemovalLocationsWriter<1, 3>
;
114
template
class
CellRemovalLocationsWriter<2, 3>
;
115
template
class
CellRemovalLocationsWriter<3, 3>
;
116
117
#include "
SerializationExportWrapperForCpp.hpp
"
118
// Declare identifier for the serializer
119
EXPORT_TEMPLATE_CLASS_ALL_DIMS
(
CellRemovalLocationsWriter
)
SerializationExportWrapperForCpp.hpp
EXPORT_TEMPLATE_CLASS_ALL_DIMS
#define EXPORT_TEMPLATE_CLASS_ALL_DIMS(CLASS)
Definition
SerializationExportWrapper.hpp:358
AbstractCellPopulationEventWriter
Definition
AbstractCellPopulationEventWriter.hpp:65
AbstractCellPopulation
Definition
AbstractCellPopulation.hpp:83
AbstractCellPopulation::GetRemovalsInformation
std::vector< std::string > GetRemovalsInformation()
Definition
AbstractCellPopulation.cpp:843
AbstractCellPopulation::ClearRemovalsInformation
void ClearRemovalsInformation()
Definition
AbstractCellPopulation.cpp:855
CaBasedCellPopulation
Definition
CaBasedCellPopulation.hpp:65
CellRemovalLocationsWriter
Definition
CellRemovalLocationsWriter.hpp:50
CellRemovalLocationsWriter::CellRemovalLocationsWriter
CellRemovalLocationsWriter()
Definition
CellRemovalLocationsWriter.cpp:46
CellRemovalLocationsWriter::VisitAnyPopulation
void VisitAnyPopulation(AbstractCellPopulation< SPACE_DIM, SPACE_DIM > *pCellPopulation)
Definition
CellRemovalLocationsWriter.cpp:52
CellRemovalLocationsWriter::Visit
virtual void Visit(MeshBasedCellPopulation< ELEMENT_DIM, SPACE_DIM > *pCellPopulation)
Definition
CellRemovalLocationsWriter.cpp:65
ImmersedBoundaryCellPopulation
Definition
ImmersedBoundaryCellPopulation.hpp:58
MeshBasedCellPopulation
Definition
MeshBasedCellPopulation.hpp:65
NodeBasedCellPopulation
Definition
NodeBasedCellPopulation.hpp:53
PottsBasedCellPopulation
Definition
PottsBasedCellPopulation.hpp:61
VertexBasedCellPopulation
Definition
VertexBasedCellPopulation.hpp:63
cell_based
src
writers
population_event_writers
CellRemovalLocationsWriter.cpp
Generated by
1.9.8