Custom MatrixFormVol

9 views
Skip to first unread message

Tomas Svaton

unread,
Sep 13, 2013, 6:45:08 AM9/13/13
to herm...@googlegroups.com
Hi Lukas,

I am, trying to define my own weak form for the system of two PDE with two unknowns (elasticity). I have taken the ~/hermes-tutorial/A-linear/08-system as the reference files to be changed. I have just browsed the hermes tutorial and examples. Nevertheless I am not able to find how to define this system correctly. When I compile everything OK, but after the program is launched, this appears:

tomas@tomas-VirtualBox:~/projects/nl-poissons/02-ln-elast$ make
Scanning dependencies of target P02-02-ln-elast
[ 50%] Building CXX object 02-ln-elast/CMakeFiles/P02-02-ln-elast.dir/definitions.cpp.o
[100%] Building CXX object 02-ln-elast/CMakeFiles/P02-02-ln-elast.dir/main.cpp.o
Linking CXX executable P02-02-ln-elast
[100%] Built target P02-02-ln-elast
tomas@tomas-VirtualBox:~/projects/nl-poissons/02-ln-elast$ ./P02-02-ln-elast 
Reading mesh in original format.
ndof = 312
Using default WeakForm<Scalar>::clone, if you have any dynamically created data in your WeakForm constructor, you need to overload this method!
Method not overriden: MatrixForm<Scalar>::ord

Newton's iteration failed.
terminate called after throwing an instance of 'Hermes::Exceptions::NullException'
  what():  Parameter number 1 is NULL

Aborted (core dumped)
tomas@tomas-VirtualBox:~/projects/nl-poissons/02-ln-elast$ 


What does it mean? How should I change the code? Could you help me with this, please? I enclose the source code.

Thank you very much for your response.

Kind regards,
Tomas.
definitions.cpp
definitions.h
main.cpp

Lukas Korous

unread,
Sep 13, 2013, 9:06:50 AM9/13/13
to herm...@googlegroups.com
Hi Tomas,

the line about "Using default WeakForm<Scalar>::clone..." is fine,
that is just to inform you, that in your Weakform subclass - if you
have dynamically allocated data - you should override this method.

However, "Method not overriden: MatrixForm<Scalar>::ord" is an
exception, and this is something you should fix. You see, this is a
method that gets the quadrature order from your matrix form. I checked
your definitions.h file and it looks like what is in there should
work.

What version are you using? The one from launchpad?

You could try to debug your code and see what matrix form throws this
exception, and send it to me.

Or I can take a look at your code - if you send me also the mesh file
etc., but this would be no sooner than 2nd half of next week.

Best,
Lukas

2013/9/13 Tomas Svaton <tsv...@gmail.com>:
> --
> You received this message because you are subscribed to the Google Groups
> "hermes2d" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to hermes2d+u...@googlegroups.com.
> To post to this group, send email to herm...@googlegroups.com.
> Visit this group at http://groups.google.com/group/hermes2d.
> For more options, visit https://groups.google.com/groups/opt_out.



--
Lukáš Korous

Tomas Svaton

unread,
Sep 13, 2013, 6:25:33 PM9/13/13
to herm...@googlegroups.com
Hi Lukas,

Thank you very much for your help. The version I am using is the one from the github.com. Last time I compiled it was on 3rd july 2013.

I would like if you could take a look at code. Hence I enclose the mesh.txt and CMakeLists.txt, hope it is sufficient. Anyway I will try to understand where the problem actually is. I will be glad for your help also the 2nd half of next week.

Best regards,
Tomas.
CMakeLists.txt
square.mesh

Tomas Svaton

unread,
Sep 13, 2013, 7:39:48 PM9/13/13
to herm...@googlegroups.com
Hi Lukas,

Thank you very much for your help. I changed all "Func<double> *ext" and "Func<Ord> *ext" to "Func<double>* *ext" and "Func<Ord>* *ext" in definitions.h and definitions.cpp and it works well now.

Thank you once more.

Kind regards,
Tomas.

Lukas Korous

unread,
Sep 14, 2013, 11:04:40 AM9/14/13
to herm...@googlegroups.com
Hi,

perfect. What branch are you using? master or devel?

Thanks,
Lukas

2013/9/14 Tomas Svaton <tsv...@gmail.com>:

Tomas Svaton

unread,
Sep 14, 2013, 9:02:05 PM9/14/13
to herm...@googlegroups.com
Hi Lukas,

Actually, I forked the hpfem/hermes from github.com. And as you made the changes I updated like is described in the manual.

Kind regards,
Tomas.
Reply all
Reply to author
Forward
0 new messages