45 file.open(path.c_str(), std::ios::in);
48 std::cerr <<
"error can not open value file:" << path << std::endl;
57 std::cerr <<
"error can not open value file:" << path << std::endl;
61 file.open(path.c_str(), std::ios::in);
63 para->setObj(
str,
false);
66 para->setObj(
str,
true);
75 std::string ad = para->getPossNeighborFilesX(
sor)[neighbor];
76 file.open(ad.c_str(), std::ios::in);
79 para->setIsNeighborX(
false);
81 para->setIsNeighborX(
true);
85 else if (direction==
"Y")
87 std::string ad = para->getPossNeighborFilesY(
sor)[neighbor];
88 file.open(ad.c_str(), std::ios::in);
91 para->setIsNeighborY(
false);
93 para->setIsNeighborY(
true);
99 std::string ad = para->getPossNeighborFilesZ(
sor)[neighbor];
100 file.open(ad.c_str(), std::ios::in);
103 para->setIsNeighborZ(
false);
105 para->setIsNeighborZ(
true);
118int BoundaryValues::getNumberOfColumns()
120 if (boundaryCondition ==
"velocity")
122 if (boundaryCondition ==
"noSlip")
124 if (boundaryCondition ==
"pressure")
126 if (boundaryCondition ==
"processor")
128 if (boundaryCondition ==
"concentration")
135void BoundaryValues::init()
138 readNumberOfLevels();
144 initalVectorsWithSingleZero();
151 for (
uint level = 0; level <= maxLevel; level++)
153 readLevelSize(level);
155 if (levelSizes[level] == 0)
163 for (
uint index = 0; index < levelSizes[level]; index++)
171 file >> indices[level][index];
173 file >> values[level][
column][index];
179 indices[level].resize(levelSizes[level]);
181 values[level][
column].resize(levelSizes[level]);
184void BoundaryValues::skipLine()
190void BoundaryValues::readLevelSize(
uint level)
192 file >> levelSizes[level];
195void BoundaryValues::initalVectorsWithSingleZero()
198 values = { { {0.0} } };
201void BoundaryValues::readNumberOfLevels()
206void BoundaryValues::readBC()
208 file >> boundaryCondition;
211void BoundaryValues::resizeVectors()
213 levelSizes.resize(maxLevel + 1);
214 values.resize(maxLevel + 1);
215 indices.resize(maxLevel + 1);
220 for (
uint level = 0; level < values.size(); level++)
221 for (
uint index = 0; index < values[level].size(); index++)
222 for (
uint value = 0; value < values[level][index].size(); value++)
223 qs[level][index].
push_back(values[level][index][value]);
228 for (std::size_t index = 0; index < values[level][
column].size(); index++)
234 for (std::size_t
i = 0;
i < indices[level].size();
i++)
235 ptr[
i] = indices[level][
i];
245 return this->levelSizes[level];
250 return this->boundaryCondition;
268 for (std::size_t index = 0; index < values[level][
column].size(); index++) {
269 if (
column == 0) RhoBC[index] = values[level][
column][index];
278 for (std::size_t index = 0; index < values[level][
column].size(); index++) {
279 if (
column == 0) vx[index] = values[level][
column][index];
280 if (
column == 1) vy[index] = values[level][
column][index];
281 if (
column == 2) vz[index] = values[level][
column][index];
289 for (std::size_t index = 0; index < values[level][
column].size(); index++) {
290 if (
column == 0) RhoBC[index] = values[level][
column][index];
void setValues(real *velo, uint level, uint column) const
void setVelocityValues(real *vx, real *vy, real *vz, int level) const
void setProcNeighbor(bool pN)
void setOutflowValues(real *RhoBC, int *kN, int level) const
BoundaryValues(std::string path)
void initIndex(uint *ptr, uint level)
void setBoundarys(std::vector< std::vector< std::vector< real > > > &qs) const
std::string getBoundaryCondition()
void setPressValues(real *RhoBC, int *kN, int level) const
std::shared_ptr< T > SPtr