Hello,

I am trying to modify the entries of the system matrix in the main function.

As a first test, I did the following,

 elem = *el;
 dof_map.dof_indices(elem,dof_columns);
 system.matrix->zero_rows(dof_columns,500.234);

The above code changes the variables in system matrix.
However, if I did the following,


DenseMatrix<Number> Fe;
Fe.resize(dof_columns.size(),dof_columns.size());
system.matrix->add_matrix (Fe, dof_columns);

I get the following runtime error.


[0]PETSC ERROR: --------------------- Error Message 
------------------------------------
[0]PETSC ERROR: Argument out of range!
[0]PETSC ERROR: New nonzero at (1,9) caused a malloc!
[0]PETSC ERROR: 
------------------------------------------------------------------------
[0]PETSC ERROR: Petsc Release Version 3.3.0, Patch 5, Sat Dec  1 15:10:41 CST 
2012
[0]PETSC ERROR: See docs/changes/index.html for recent updates.
[0]PETSC ERROR: See docs/faq.html for hints about trouble shooting.
[0]PETSC ERROR: See docs/index.html for manual pages.
[0]PETSC ERROR: 
------------------------------------------------------------------------
[0]PETSC ERROR: ./example-opt on a arch-linu named thor by vegnesh Mon Jun  6 
20:48:10 2016
[0]PETSC ERROR: Libraries linked from 
/home/vegnesh/codes/petsc/3.3-p5/arch-linux2-c-opt/lib
[0]PETSC ERROR: Configure run at Mon Feb  8 21:38:17 2016
[0]PETSC ERROR: Configure options 
--with-cxx=/home/mpanesi/APPLICATIONS/openmpi/openmpi-1.6.3-gcc-4.7/bin/mpicxx 
--with-cc=/home/mpanesi/APPLICATIONS/openmpi/openmpi-1.6.3-gcc-4.7/bin/mpicc 
--with-fc=/home/mpanesi/APPLICATIONS/openmpi/openmpi-1.6.3-gcc-4.7/bin/mpif90 
--with-shared-libraries --with-debugging=0 --download-f-blas-lapack=yes 
--download-hypre=yes --with-openmp=1
[0]PETSC ERROR: 
------------------------------------------------------------------------
[0]PETSC ERROR: MatSetValues_SeqAIJ() line 346 in src/mat/impls/aij/seq/aij.c
[0]PETSC ERROR: MatSetValues() line 1025 in src/mat/interface/matrix.c
--------------------------------------------------------------------------
MPI_ABORT was invoked on rank 0 in communicator MPI_COMM_WORLD
with errorcode 1.

NOTE: invoking MPI_ABORT causes Open MPI to kill all MPI processes.
You may or may not see output from other processes, depending on
exactly when Open MPI kills them.


I wanted to know where I am going wrong. Can add_matrix function be used only 
with assembly and not in main for modifying the system matrix?
Similarly, I am unable to use the zero_rows function in the assemble function 
of the system.


Thank you for helping me out


Regards
Vegnesh



------------------------------------------------------------------------------
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

Reply via email to