/// <summary> /// Backup of some operator matrix before grid-redistribution. /// </summary> /// <param name="M"> /// Matrix which should be saved. /// </param> /// <param name="Reference"> /// Unique string reference under which data can be referenced after grid-redistribution. /// </param> /// <param name="RowMapping"> /// Coordinate mapping to correlate the matrix rows with cells of the computational grid. /// </param> /// <param name="ColMapping"> /// Coordinate mapping to correlate the matrix columns with cells of the computational grid. /// </param> public void BackupMatrix(BlockMsrMatrix M, string Reference, UnsetteledCoordinateMapping RowMapping, UnsetteledCoordinateMapping ColMapping) { CheckMatrix(M, RowMapping, ColMapping, m_oldJ); int[] rowHash = GetDGBasisHash(RowMapping.BasisS); int[] colHash = GetDGBasisHash(ColMapping.BasisS); if (!m_OldBlockings.ContainsKey(rowHash)) { m_OldBlockings.Add(rowHash, CloneBlockPartitioning(M._RowPartitioning)); } if (!m_OldBlockings.ContainsKey(colHash)) { m_OldBlockings.Add(colHash, CloneBlockPartitioning(M._ColPartitioning)); } BlockMsrMatrix Msave = M.RecyclePermute(m_OldBlockings[rowHash], m_OldBlockings[colHash], new int[0, 2], new int[0, 2]); m_Matrices.Add(Reference, new Tuple <int[], int[], BlockMsrMatrix>(rowHash, colHash, Msave)); }