On Tue, Jun 7, 2016 at 6:19 PM, Jayaraman, Vegnesh <vjayr...@illinois.edu> wrote:
> Hi > > Can the matrix->zero_rows() function not be used during assembly? I get an > "Object Not Initialized " error during runtime if I use the above function > in assembly. > zero_rows() can't be called interspersed with the MatSetValues(..., ADD_VALUES) calls which are done during assembly. You have to do it at the end of assembly, after the matrix has been closed(). > > Also, I am not changing the sparsity pattern of the matrix. Because, I get > the dof_indices of a particular element. > You are doing something which creates new nonzeros, otherwise you wouldn't have gotten the error you got... > The above piece of code comes in the assembly functions and I have just > rewritten it in the main function for a single element. > This could be a bug if it happens before the matrix is properly initialized... we'd need to see your code to know for sure the cause of the bug. > I have another question. I tried implementing the solution 2 using the > following code: > > PetscMatrix<Number> m(system.matrix).mat() ; > MatSetOption(m.mat(),MAT_NEW_NONZERO_ALLOCATION_ERR,PETSC_FALSE); > You need to get the SparseMatrix from the System and cast it to a PetscMatrix before calling mat() on it: PetscMatrix<Number>* petsc_matrix = dynamic_cast<PetscMatrix<Number>* > (system.matrix); MatSetOption(petsc_matrix.mat(),MAT_NEW_NONZERO_ALLOCATION_ERR,PETSC_FALSE); -- John ------------------------------------------------------------------------------ What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e _______________________________________________ Libmesh-users mailing list Libmesh-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libmesh-users