49 file.open(path.c_str(), std::ios::in | std::ios::binary);
50 checkFileStatus(path);
55 file.open(path.c_str(), std::ios::in );
56 checkFileStatus(path);
63 if (
isBinary) file.open(path.c_str(), std::ios::in | std::ios::binary);
64 else file.open(path.c_str(), std::ios::in);
67 para->setObj(
str,
false);
70 para->setObj(
str,
true);
85void BoundaryQs::checkFileStatus(std::string path)
89 std::cerr <<
"can not open q-file: " << path << std::endl;
99void BoundaryQs::init()
107 for (
unsigned int level = 0; level <= maxLevel; level++)
109 file >> levelSizes[level];
111 if (levelSizes[level] == 0)
114 for (
unsigned int elem = 0;
elem < levelSizes[level];
elem++)
117 file >> indices[level][
elem];
133void BoundaryQs::init_Binary()
145 for (
unsigned int level = 0; level <= maxLevel; level++)
147 file >> levelSizes[level];
149 if (levelSizes[level] == 0)
152 for (
unsigned int elem = 0;
elem < levelSizes[level];
elem++)
155 file.read((
char*)&
bufferInt,
sizeof(
int));
176void BoundaryQs::resizeVectors()
178 levelSizes.resize(maxLevel + 1);
179 values.resize(maxLevel + 1);
180 indices.resize(maxLevel + 1);
183void BoundaryQs::resizeVectorsPerLevel(
unsigned int level, std::vector<uint32_t> &
vec1D_code)
187 values[level][
i].resize(levelSizes[level], -1);
188 indices[level].resize(levelSizes[level]);
194 return this->levelSizes[level];
206 for (std::size_t index = 0; index < values[level][
column].size(); index++)
213 for (std::size_t index = 0; index < values[level][
column].size(); index++)
219 for (std::size_t index = 0; index < indices[level].size(); index++)
220 data[level].
push_back(indices[level][index]);
225 for (std::size_t index = 0; index < indices[level].size(); index++)
226 data[index] = indices[level][index];
233 for (std::vector<std::vector<std::vector<real> > >::iterator
it = values.begin();
it != values.end();
it++) {
235 for (std::vector<std::vector<real> >::iterator
it2 =
it->begin();
it2 !=
it->end();
it2++) {
237 for (std::vector<real>::iterator
it3 =
it2->begin();
it3 !=
it2->end();
it3++) {
238 qs[
j][
i].push_back(*
it3);
247 for (std::size_t level = 0; level < this->indices.size(); level++)
248 for (std::size_t index = 0; index < this->indices[level].size(); index++)
249 indices[level].
push_back(this->indices[level][index]);
void setValuesInVector(std::vector< std::vector< std::vector< real > > > &q27, unsigned int level) const
unsigned int getSize(unsigned int level)
void getQs(std::vector< std::vector< std::vector< real > > > &qs)
void getIndices(std::vector< std::vector< uint > > &indices)
void setValues(real **q27, unsigned int level) const
void setIndex(int *indices, unsigned int level) const
void setIndexInVector(std::vector< std::vector< int > > &data, unsigned int level) const
std::shared_ptr< T > SPtr