Re: [deal.II] FullMatrix to SparseMatrix

2020-10-18 Thread Wolfgang Bangerth
On 10/17/20 2:12 PM, Nikki Holtzer wrote: Yes it appears to be the system_matrix_inverse because I can print out the residual and it is indeed not empty. There is little any of can help you with without having access to the actual code. The usual way to approach this now is to make the

Re: [deal.II] FullMatrix to SparseMatrix

2020-10-17 Thread Nikki Holtzer
Yes it appears to be the system_matrix_inverse because I can print out the residual and it is indeed not empty. On Saturday, October 17, 2020 at 2:32:02 PM UTC-4 Wolfgang Bangerth wrote: > On 10/16/20 10:35 AM, Nikki Holtzer wrote: > > > > The error I'm receiving is: > > > > An error

Re: [deal.II] FullMatrix to SparseMatrix

2020-10-17 Thread Wolfgang Bangerth
On 10/16/20 10:35 AM, Nikki Holtzer wrote: The error I'm receiving is: An error occurred in line <179> of file in function  void dealii::FullMatrix::vmult(dealii::Vector&, const dealii::Vector&, bool) const [with number2 = double; number = double] The violated condition was:    

Re: [deal.II] FullMatrix to SparseMatrix

2020-10-16 Thread Nikki Holtzer
I was able to diagnose and fix the problem. Thank you. I still have one remaining error since changing all my matrices to FullMatrix. I have diagnosed that the issue is the very last line of code below, when attempting to update my system. I have printed the line in red. for (unsigned int m =

Re: [deal.II] FullMatrix to SparseMatrix

2020-10-16 Thread Wolfgang Bangerth
Nikki, I can't tell from these pieces of code what dimension is wrong. But you will find it very useful to run your program in a debugger so that you can see which matrix access it is that triggers the error, and why. There are a number of video lectures about running a program in a

Re: [deal.II] FullMatrix to SparseMatrix

2020-10-14 Thread Nikki Holtzer
The first error seems to be occurring at: affine_constraints.distribute_local_to_global(cell_nodal_mass_matrix, local_dof_indices, nodal_mass_matrix); I have verified that cell_nodal_mass_matrix is indeed the same size as nodal_mass_matrix. cell_nodal_mass_matrix is initialized as:

Re: [deal.II] FullMatrix to SparseMatrix

2020-10-14 Thread Wolfgang Bangerth
On 10/14/20 8:14 AM, Nikki Holtzer wrote:     void dealii::FullMatrix< >::add(dealii::FullMatrix< >::size_type, dealii::FullMatrix< >::size_type, const index_type*, const number2*, bool, bool) [with number2 = double; index_type = unsigned int; number = double; dealii::FullMatrix<

Re: [deal.II] FullMatrix to SparseMatrix

2020-10-14 Thread Nikki Holtzer
Ok thank you that has resolved most of the adding issue. I am still receiving the following error. It reads to me that there's still an error on the 'FullMatrix::add()' function. I have verified that they are all gone however. What else should I be looking for? An error occurred in line

Re: [deal.II] FullMatrix to SparseMatrix

2020-10-13 Thread Wolfgang Bangerth
On 10/13/20 10:28 AM, Nikki Holtzer wrote: The issue that I have when  all matrices are FullMatrix matrices is I can't seem to get the .add function to result in anything other than error. If I keep ONLY both nonlinear_part and linear_part as FullMatrix I receive: error: no matching function

Re: [deal.II] FullMatrix to SparseMatrix

2020-10-13 Thread Nikki Holtzer
The issue that I have when all matrices are FullMatrix matrices is I can't seem to get the .add function to result in anything other than error. If I keep ONLY both nonlinear_part and linear_part as FullMatrix I receive: error: no matching function for call to

Re: [deal.II] FullMatrix to SparseMatrix

2020-10-12 Thread Wolfgang Bangerth
On 10/11/20 6:09 PM, Nikki Holtzer wrote: I was hoping to take the outer product which is formed in a FullMatrix, called Kronecker_matrix below, multiply it by a coefficient, and add a matrix to it called nonlinear_part_full. This entire operation I have tried to put into a Sparse matrix,

Re: [deal.II] FullMatrix to SparseMatrix

2020-10-11 Thread Nikki Holtzer
I have copied some code below. I was hoping to take the outer product which is formed in a FullMatrix, called Kronecker_matrix below, multiply it by a coefficient, and add a matrix to it called nonlinear_part_full. This entire operation I have tried to put into a Sparse matrix, called

Re: [deal.II] FullMatrix to SparseMatrix

2020-10-11 Thread Wolfgang Bangerth
Nikki, we can continue to speculate, but your description of what is happening is not specific enough to really know. You'll have to show us the code you use to be sure. I don't understand the connection between the code you show and the outer product. The outer product is a dense matrix,

Re: [deal.II] FullMatrix to SparseMatrix

2020-10-10 Thread Nikki Holtzer
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,

Re: [deal.II] FullMatrix to SparseMatrix

2020-10-08 Thread Wolfgang Bangerth
On 10/8/20 7:16 AM, Nikki Holtzer wrote: error: no match for ‘operator+’ (operand types are ‘const dealii::SparseMatrix’ and ‘dealii::SparseMatrix’) SparseMatrix has no operator+, so this will not work. error: no matching function for call to ‘dealii::SparseMatrix::add(double,

Re: [deal.II] FullMatrix to SparseMatrix

2020-10-08 Thread Nikki Holtzer
Hello everyone, I was just curious if anyone had any suggestions for the above 'const' qualifier problem I have stated above? Thanks! Nikki On Thursday, October 8, 2020 at 9:16:24 AM UTC-4 Nikki Holtzer wrote: > When I do the above, with the modifications you have provided, I still > obtain

Re: [deal.II] FullMatrix to SparseMatrix

2020-10-08 Thread Nikki Holtzer
When I do the above, with the modifications you have provided, I still obtain the following: error: no match for ‘operator+’ (operand types are ‘const dealii::SparseMatrix’ and ‘dealii::SparseMatrix’) or error: no matching function for call to ‘dealii::SparseMatrix::add(double,

Re: [deal.II] FullMatrix to SparseMatrix

2020-10-07 Thread Wolfgang Bangerth
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 in function     dealii::SparseMatrix& dealii::SparseMatrix::operator=(double) [with number = double] The violated condition was:     cols != nullptr

[deal.II] FullMatrix to SparseMatrix

2020-10-07 Thread Nikki Holtzer
Hello everyone, I am trying to recast a current FullMatrix as a SparseMatrix in order to add this matrix to another SparseMatrix. I have tried something like this: SparseMatrix Mat_Sparse; Mat_Sparse.copy_from(Mat_Full); Mat_Sparse_2.add(1.,Mat_Sparse); When doing so I receive the