Commit 5f74edf6 authored by Berenger Bramas's avatar Berenger Bramas

Add extract for the M2L implicit mpi (not tested)

parent 125343e0
......@@ -401,6 +401,86 @@ public:
));
}
}
/** Extract for implicit MPI */
size_t extractGetSizeSymbUp(const std::vector<int>& cellsToExtract) const {
return cellsToExtract.size() * sizeof(SymboleCellClass) * sizeof(PoleCellClass);
}
void extractDataUp(const std::vector<int>& cellsToExtract,
unsigned char* outputBuffer, const size_t outputBufferSize) const {
size_t idxValue = 0;
for(size_t idxEx = 0 ; idxEx < cellsToExtract.size() ; ++idxEx){
const int idCell = cellsToExtract[idxEx];
memcpy(&outputBuffer[idxValue],
&blockCells[idCell],
sizeof(SymboleCellClass));
idxValue += sizeof(SymboleCellClass);
memcpy(&outputBuffer[idxValue],
&cellMultipoles[idCell],
sizeof(PoleCellClass));
idxValue += sizeof(PoleCellClass);
}
FAssertLF(idxValue == outputBufferSize);
}
void restoreDataUp(const std::vector<int>& cellsToExtract,
const unsigned char* intputBuffer, const size_t inputBufferSize){
size_t idxValue = 0;
for(size_t idxEx = 0 ; idxEx < cellsToExtract.size() ; ++idxEx){
const int idCell = cellsToExtract[idxEx];
memcpy(&blockCells[idCell],
&intputBuffer[idxValue],
sizeof(SymboleCellClass));
idxValue += sizeof(SymboleCellClass);
memcpy(&cellMultipoles[idCell],
&intputBuffer[idxValue],
sizeof(PoleCellClass));
idxValue += sizeof(PoleCellClass);
}
FAssertLF(idxValue == inputBufferSize);
}
size_t extractGetSizeSymbDown(const std::vector<int>& cellsToExtract) const {
return cellsToExtract.size() * sizeof(SymboleCellClass) * sizeof(LocalCellClass);
}
void extractDataDown(const std::vector<int>& cellsToExtract,
unsigned char* outputBuffer, const size_t outputBufferSize) const {
size_t idxValue = 0;
for(size_t idxEx = 0 ; idxEx < cellsToExtract.size() ; ++idxEx){
const int idCell = cellsToExtract[idxEx];
memcpy(&outputBuffer[idxValue],
&blockCells[idCell],
sizeof(SymboleCellClass));
idxValue += sizeof(SymboleCellClass);
memcpy(&outputBuffer[idxValue],
&cellLocals[idCell],
sizeof(PoleCellClass));
idxValue += sizeof(PoleCellClass);
}
FAssertLF(idxValue == outputBufferSize);
}
void restoreDataDown(const std::vector<int>& cellsToExtract,
const unsigned char* intputBuffer, const size_t inputBufferSize){
size_t idxValue = 0;
for(size_t idxEx = 0 ; idxEx < cellsToExtract.size() ; ++idxEx){
const int idCell = cellsToExtract[idxEx];
memcpy(&blockCells[idCell],
&intputBuffer[idxValue],
sizeof(SymboleCellClass));
idxValue += sizeof(SymboleCellClass);
memcpy(&cellLocals[idCell],
&intputBuffer[idxValue],
sizeof(PoleCellClass));
idxValue += sizeof(PoleCellClass);
}
FAssertLF(idxValue == inputBufferSize);
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment