My sparsity pattern was created in the following way:

DynamicSparsityPattern c_sparsity(dof_handler.n_dofs(), 
dof_handler.n_dofs());

  DoFTools::make_sparsity_pattern(dof_handler, c_sparsity, 
affine_constraints, true);


which I have used throughout my code with no problems. 


The FullMatrix, Mat1, that I form comes from the outer product of vec1 and 
vec2 both of size dof_handler.n_dofs. 

I create a Sparse Matrix, Mat2 that i initialize with the sparsity pattern 
written above. I am not seeing why Mat1 of size dof_handler.n_dofs X 
dof_handler.n_dofs does not fit into a sparsity pattern that's defined as 
DynamicSparsityPattern c_sparsity(dof_handler.n_dofs(), 
dof_handler.n_dofs());

I am indeed getting an error that there are not enough entries in the 
SparseMatrix, Mat2.

Thank you!

On Wednesday, October 7, 2020 at 4:58:45 PM UTC-4 Wolfgang Bangerth wrote:

> On 10/7/20 2:51 PM, Nikki Holtzer wrote:
> > 
> > When doing so I receive the following error:
> > 
> > 
> > An error occurred in line <195> of file 
> > <dealii-9.1.1/include/deal.II/lac/sparse_matrix.templates.h> in function
> > 
> >     dealii::SparseMatrix<Number>& 
> > dealii::SparseMatrix<number>::operator=(double) [with number = double]
> > 
> > The violated condition was:
> > 
> >     cols != nullptr
> > 
> > Additional information:
> > 
> >     (none)
>
> You haven't associated a sparsity pattern with the sparse matrix yet. 
> You'll 
> have to set that first, and you need to make sure that it has an entry for 
> each nonzero in the full matrix you are hoping to copy over!
>
> Best
> W.
>
>
> -- 
> ------------------------------------------------------------------------
> Wolfgang Bangerth email: bang...@colostate.edu
> www: http://www.math.colostate.edu/~bangerth/
>
>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/56cca082-6ae2-4b51-af0d-85ed95661ac4n%40googlegroups.com.

Reply via email to