Dear all,
I am trying to figure out which is the quickest way to try out mass
lumping in a libmesh code of mine. Here below I describe my attempt.
It's a nonlinear reaction-diffusion system in one space dimension, so I
thought that as a first attempt I would change the quadrature rule to
trapezoidal. I made the following change to my code:
template <class P>
class Populations : public FEMSystem
{...}
template<class P>
void Populations<P>::init_context(DiffContext & context)
{
FEMContext &c = libmesh_cast_ref<FEMContext&>(context);
//request all data needed to build the linear system
//start NEW code
const unsigned int dim = c.dim;
FEType fetype=c.element_fe_var[p1_var]->get_fe_type();
AutoPtr<QBase> qtrap(QBase::build(QTRAP,dim,FIRST));
c.element_fe_var[p1_var]->attach_quadrature_rule(qtrap.get());
//end NEW code
c.element_fe_var[p1_var]->get_JxW();
c.element_fe_var[p1_var]->get_phi();
c.element_fe_var[p1_var]->get_dphi();
... and so on...
}
The code compiles, but crashes on execution:
matteo@montebianco:~/ufficio/Ricerca/popolazioni$ ./planctonstd-opt
Running ./planctonstd-opt
Refined initial mesh 8 times
Side Boundary conditions:
-------------------------
(ID, number of sides)
(0, 1)
(1, 1)
hmax is 0.00390625
hmed is 0.00390625
hmin is 0.00390625
Homogeneous coexistence equilibrium is (5.47143, 10.1429, 5.29082)
eq_sys initialized
time_solver initialized
set options of diff_solver
EquationSystems
n_systems()=1
System #0, "Plancton"
Type "Implicit"
Variables="p1" "p2" "p3"
Finite Element Types="LAGRANGE" "LAGRANGE" "LAGRANGE"
Approximation Orders="FIRST" "FIRST" "FIRST"
n_dofs()=771
n_local_dofs()=771
n_constrained_dofs()=0
n_vectors()=2
DofMap Sparsity
Average On-Processor Bandwidth <= 8.97665
Average Off-Processor Bandwidth <= 0
Maximum On-Processor Bandwidth <= 9
Maximum Off-Processor Bandwidth <= 0
DofMap Constraints
Number of DoF Constraints = 0
*** Warning, This code is untested, experimental, or likely to see
future API changes:
/home/matteo/libmesh-0.7.2/libmesh/include/mesh/vtk_io.h, line 153,
compiled Jun 5 2013 at 10:39:51 ***
######## Solving time step 0, time= 0
[0]PETSC ERROR:
------------------------------------------------------------------------
[0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation,
probably memory access out of range
[0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger
[0]PETSC ERROR: or see
http://www.mcs.anl.gov/petsc/petsc-as/documentation/troubleshooting.html#Signal[0]PETSC
ERROR: or try http://valgrind.org on GNU/linux and Apple Mac OS X to
find memory corruption errors
[0]PETSC ERROR: configure using --with-debugging=yes, recompile, link,
and run
[0]PETSC ERROR: to get more information on the crash.
[0]PETSC ERROR: --------------------- Error Message
------------------------------------
[0]PETSC ERROR: Signal received!
[0]PETSC ERROR:
------------------------------------------------------------------------
[0]PETSC ERROR: Petsc Release Version 3.1.0, Patch 3, Fri Jun 4
15:34:52 CDT 2010
[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: ./planctonstd-opt on a linux-gnu named montebianco by
matteo Wed Jun 5 10:40:14 2013
[0]PETSC ERROR: Libraries linked from
/build/buildd-petsc_3.1.dfsg-7-i386-WW0bXh/petsc-3.1.dfsg/linux-gnu-c-opt/lib
[0]PETSC ERROR: Configure run at Wed Aug 4 20:03:39 2010
[0]PETSC ERROR: Configure options --with-shared --with-debugging=0
--useThreads 0 --with-clanguage=C++ --with-c-support
--with-fortran-interfaces=1 --with-mpi-dir=/usr/lib/openmpi
--with-mpi-shared=1 --with-blas-lib=-lblas --with-lapack-lib=-llapack
--with-umfpack=1 --with-umfpack-include=/usr/include/suitesparse
--with-umfpack-lib="[/usr/lib/libumfpack.so,/usr/lib/libamd.so]"
--with-spooles=1 --with-spooles-include=/usr/include/spooles
--with-spooles-lib=/usr/lib/libspooles.so --with-hypre=1
--with-hypre-dir=/usr --with-scotch=1
--with-scotch-include=/usr/include/scotch
--with-scotch-lib=/usr/lib/libscotch.so --with-hdf5=1 --with-hdf5-dir=/usr
[0]PETSC ERROR:
------------------------------------------------------------------------
[0]PETSC ERROR: User provided function() line 0 in unknown directory
unknown file
--------------------------------------------------------------------------
MPI_ABORT was invoked on rank 0 in communicator MPI COMMUNICATOR 3 DUP
FROM 0
with errorcode 59.
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.
--------------------------------------------------------------------------
with backtrace
(gdb) bt
#0 0x08129372 in ?? ()
#1 0xb7bada8b in libMesh::FEMContext::elem_fe_reinit (this=0x8129ba8)
at src/systems/fem_context.C:575
#2 0xb7bb4146 in operator() (this=0xbfffec3c, range=...) at
src/systems/fem_system.C:75
#3 0xb7bba2db in
parallel_for<libMesh::StoredRange<libMesh::MeshBase::const_element_iterator,
const libMesh::Elem*>, <unnamed>::AssemblyContributions> (
range=..., body=...) at
/home/matteo/libmesh-0.7.2/libmesh/include/parallel/threads.h:278
#4 0xb7bb65f3 in libMesh::FEMSystem::assembly (this=0x81546c8,
get_residual=true, get_jacobian=true) at src/systems/fem_system.C:594
#5 0xb7b6b046 in libMesh::NewtonSolver::solve (this=0x81612f8) at
src/solvers/newton_solver.C:301
#6 0xb7b7ffb6 in libMesh::UnsteadySolver::solve (this=0x8161170) at
src/solvers/unsteady_solver.C:76
#7 0xb7b92e7d in libMesh::DifferentiableSystem::solve (this=0x81546c8)
at src/systems/diff_system.C:118
#8 0xb7bb69c7 in libMesh::FEMSystem::solve (this=0x81546c8) at
src/systems/fem_system.C:637
#9 0x0806f495 in main (argc=1, argv=0xbffff3b4) at plancton.cpp:203
All of this was compiled with libmesh 0.7.2 in debug mode. (I am also
upgrading to a newer version, but see the other mail)
Best regards,
Matteo
--
Matteo Semplice Dip. di Matematica
Phone: 011-6702831 Università degli Studi di Torino
Skype: matteosemplice Via Carlo Alberto, 10 - Torino
------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users