19 static const unsigned int EMPTY = ~0;
55 const double** entry,
const unsigned int** colIndex )
const
57 return m_.
getRow( meshIndex, entry, colIndex );
72 const unsigned int *colIndex;
74 unsigned int n =
m_.
getRow( row, &entry, &colIndex );
76 vector< unsigned int > ret;
77 ret.insert( ret.end(), colIndex, colIndex + n );
88 const unsigned int *colIndex;
90 unsigned int n =
m_.
getRow( row, &entry, &colIndex );
93 ret.insert( ret.end(), entry, entry + n );
99 const vector< double >& entry,
100 const vector< unsigned int >& colIndex
122 const ChemCompt* other,
const vector< VoxelJunction >& vj )
125 map< unsigned int, unsigned int > meshMap;
126 map< unsigned int, unsigned int >::iterator mmi;
129 vector< unsigned int > meshBackMap;
133 unsigned int oldSize =
m_.
nRows();
134 unsigned int newSize = oldSize;
137 vector< vector< VoxelJunction > > vvj( coreSize );
139 for ( vector< VoxelJunction >::const_iterator
140 i = vj.begin(); i != vj.end(); ++i ) {
141 mmi = meshMap.find( i->second );
142 if ( mmi == meshMap.end() ) {
143 assert( i->first < coreSize );
144 meshBackMap.push_back( i->second );
145 meshMap[i->second] = newSize++;
146 vvj[i->first].push_back( *i );
149 vector< vector< VoxelJunction > > vvjCol( newSize );
153 for (
unsigned int i = 0; i < newSize; ++i ) {
154 vector< VoxelJunction > temp;
157 const unsigned int* colIndex;
158 unsigned int num = oldM.
getRow( i, &entry, &colIndex );
160 for (
unsigned int j = 0; j < num; ++j ) {
161 temp[j].first = colIndex[j];
162 temp[j].diffScale = entry[j];
165 if ( i < coreSize ) {
166 for ( vector< VoxelJunction >::const_iterator
167 j = vvj[i].begin(); j != vvj[i].end(); ++j )
169 unsigned int row = j->first;
171 unsigned int col = meshMap[j->second];
172 assert( col >= oldSize );
175 vvjCol[col].push_back(
179 if ( i >= oldSize ) {
180 for ( vector< VoxelJunction >::const_iterator
181 j = vvjCol[i].begin(); j != vvjCol[i].end(); ++j )
183 temp.push_back( *j );
187 sort( temp.begin(), temp.end() );
188 vector< double > e( temp.size() );
189 vector< unsigned int > c( temp.size() );
190 for (
unsigned int j = 0; j < temp.size(); ++j ) {
191 e[j] = temp[j].diffScale;
192 c[j] = temp[j].first;
198 for ( vector< unsigned int>::const_iterator
199 i = meshBackMap.begin(); i != meshBackMap.end(); ++i ) {
unsigned int getStencilRow(unsigned int meshIndex, const double **entry, const unsigned int **colIndex) const
void innerResetStencil()
virtual func implemented here.
vector< unsigned int > getNeighbors(unsigned int fid) const
Looks up stencil to return vector of indices of coupled voxels.
SparseMatrix< double > m_
Handles stencil for core + abutting voxels.
vector< double > extendedMeshEntryVolume_
unsigned int getRow(unsigned int row, const T **entry, const unsigned int **colIndex) const
void addRow(unsigned int index, const vector< double > &entry, const vector< unsigned int > &colIndex)
double extendedMeshEntryVolume(unsigned int fid) const
Virtual function to return volume of mesh Entry, including.
unsigned int nRows() const
vector< double > innerGetStencilRate(unsigned int row) const
void clearExtendedMeshEntryVolume()
Inherited virtual function to clear the vector of MeshEntryVolume.
void addRow(unsigned int rowNum, const vector< T > &row)
void setSize(unsigned int nrows, unsigned int ncolumns)
static const unsigned int EMPTY
void extendStencil(const ChemCompt *other, const vector< VoxelJunction > &vj)
Add boundary voxels to stencil for cross-solver junctions.
void setStencilSize(unsigned int numRows, unsigned int numCols)
virtual double getMeshEntryVolume(unsigned int fid) const =0
Virtual function to return volume of mesh Entry.
const SparseMatrix< double > & getStencil() const
Returns entire sparse matrix of mesh. Used by diffusion solver.
SparseMatrix< double > coreStencil_
Handles the core stencil for own vol.