Hi Jordi,

Well, Brandon actually provided you with the key phrase that I was hinting 
towards. This element of the code looks in order for linear basis functions. 
However, it looks to me like there's actually a set of comments in your code 
that suggests/indicates that you’ve not completed something that is relevant 
when using higher order basis functions. It is presumably this that renders 
your system matrix non-invertible when using quadratic or cubic basis 
functions, which is what UMFPack is complaining about when this message (which 
I presume is the one that you see) is emitted

$ make run
Scanning dependencies of target main1
[ 33%] Building CXX object CMakeFiles/main1.dir/main1.cc.o
[ 66%] Linking CXX executable main1
[ 66%] Built target main1
[100%] Run main1 with Debug configuration
   Number of active elems:       2
   Number of degrees of freedom: 5


----------------------------------------------------
Exception on processing:

--------------------------------------------------------
An error occurred in line <291> of file 
<path/dealii/source/lac/sparse_direct.cc> in function
    void dealii::SparseDirectUMFPACK::factorize(const Matrix &) [Matrix = 
dealii::SparseMatrix<double>]
The violated condition was:
    status == UMFPACK_OK
Additional information:
    UMFPACK routine umfpack_dl_numeric returned error status 1.

A complete list of error codes can be found in the file 
<bundled/umfpack/UMFPACK/Include/umfpack.h>.

That said, the two most common errors that can happen are that your matrix 
cannot be factorized because it is rank deficient, and that UMFPACK runs out of 
memory because your problem is too large.

The first of these cases most often happens if you forget terms in your 
bilinear form necessary to ensure that the matrix has full rank, or if your 
equation has a spatially variable coefficient (or nonlinearity) that is 
supposed to be strictly positive but, for whatever reasons, is negative or 
zero. In either case, you probably want to check your assembly procedure. 
Similarly, a matrix can be rank deficient if you forgot to apply the 
appropriate boundary conditions. For example, the Laplace equation without 
boundary conditions has a single zero eigenvalue and its rank is therefore 
deficient by one.

The other common situation is that you run out of memory. On a typical laptop 
or desktop, it should easily be possible to solve problems with 100,000 
unknowns in 2d. If you are solving problems with many more unknowns than that, 
in particular if you are in 3d, then you may be running out of memory and you 
will need to consider iterative solvers instead of the direct solver employed 
by UMFPACK.

You can also take a look at the first 8-10 paragraphs of this section of a 
tutorial
https://dealii.org/current/doxygen/deal.II/step_3.html#Step3assemble_system 
<https://dealii.org/current/doxygen/deal.II/step_3.html#Step3assemble_system>
which may also give you some further insights into where (I think) you’re going 
wrong. 

Good luck!
Jean-Paul

> On 03 Jan 2020, at 19:28, Jordi Parra Porcar <[email protected]> 
> wrote:
> 
> Hello Jean-Paul,
> 
> Thanks in advance for your time answering my question, unfortunately I have 
> been unable to understand what do you mean in your somewhat criptic 
> explanation :(. I was thinking about something wrong with the implication of 
> the Jacobian in the basis gradients but, for 1d and 2d this has not to be 
> affecting due to the same spacing between nodes. Can you somehow "decript" 
> your answer a little bit, I am really struggling with this assignment XD
> 
> Kind regards and thanks again!
> 
> On Sunday, 29 December 2019 16:29:11 UTC-5, Jean-Paul Pelteret wrote:
> Dear Jordi,
> 
> Firstly, welcome to the forum. Well, as this is a course assignment I think 
> that its fair to assume that some course mentor should be available to guide 
> you toward the solution to the problem. You say that you’ve had no luck on 
> the course site forum — that’s a bit poor. Anyway, I wouldn’t want to give 
> away the answer, but after skimming through your code and seeing your comment 
> that 
> 
>> I checked my basis functions and its gradients and seem to be correct
> 
> I would say that you’re looking in the right sorts of places for the problem. 
> Remember that in the finite element method we use basis functions to 
> approximate the solution, and these need to evaluated in certain places where 
> we form approximations for certain calculations. You’ve seem to have the 
> “evaluated” part sorted, but what about the other part? What might need to 
> change when you move from linear to higher order shape functions in order to 
> ensure that those approximate calculations are performed accurately?
> 
> I hope that my somewhat cryptic response will give you a nudge in the right 
> direction. Oh, and I also hope that you take a look at our tutorial programs 
> sometime to see how we typically code up FEM problems. It’s good to get a 
> hand on the basics, but you might be pleased to know that the deal.II library 
> does most of this for you in a clean and easy to understand manner.
> 
> Best,
> Jean-Paul
> 
>> On 28 Dec 2019, at 02:01, Jordi Parra Porcar <[email protected] 
>> <javascript:>> wrote:
>> 
>> Dear all,
>> 
>> I am new to this group. I wanted to ask for some help as I am unable to find 
>> the solution to a problem.
>> I am following a course in Coursera called "The Finite Element Method for 
>> problems in physics". The course first assignment it is about coding with 
>> dealii.
>> I have posted in the Coursera forum but got no answer so, I am trying by 
>> here just to see if I am lucky and someone give me a hand.
>> The issue that I have is that I can only solve the problem with 1st order 
>> basis functions as with quadratic and cubic basis functions it gives me an 
>> error related with the K global matrix.
>> I have been going around discussions but still unable to find where is the 
>> problem. I checked my basis functions and its gradients and seem to be 
>> correct.
>> I uploaded all the files related to the problem. Now the ./main executes the 
>> problem=1 with order=1, that is the linear basis function.
>> 
>> Thank you all in advance and happy ending of the year!
>> 
>> Jordi,
>> 
>> -- 
>> The deal.II project is located at http://www.dealii.org/ 
>> <http://www.dealii.org/>
>> For mailing list/forum options, see 
>> https://groups.google.com/d/forum/dealii?hl=en 
>> <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 [email protected] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/dealii/5a12993f-9687-4b5a-9ad5-e4711e49f6a4%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/dealii/5a12993f-9687-4b5a-9ad5-e4711e49f6a4%40googlegroups.com?utm_medium=email&utm_source=footer>.
>> <CMakeCache.txt><CMakeLists.txt><FEM1.h><Makefile><cmake_install.cmake><main1><main1.cc
>>  
>> <http://main1.cc/>><writeSolutions.h><_b66323d90964cccb91c92f77bcb02ab0_codingAssign1.pdf>
> 
> 
> -- 
> The deal.II project is located at http://www.dealii.org/ 
> <http://www.dealii.org/>
> For mailing list/forum options, see 
> https://groups.google.com/d/forum/dealii?hl=en 
> <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 [email protected] 
> <mailto:[email protected]>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/dealii/f7bfa8a0-6c68-4e91-bc48-7170f37f5934%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/dealii/f7bfa8a0-6c68-4e91-bc48-7170f37f5934%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/797CA112-82A3-4773-BFC4-18115F4B5A7C%40gmail.com.

Reply via email to