## Re: [Libmesh-users] a simple question

 Re: [Libmesh-users] a simple question From: Roy Stogner - 2006-02-22 16:46:47 ```On Wed, 22 Feb 2006, li pan wrote: > I realized all the example which include an assemble() > function are written for square or hex. Has anyone got > a example for tetrahedron? It's not clear for me how > to do volume integration and surface integration in > the case of tetrahedron. It's exactly the same as area integration and edge integration for the 2D cases. I've got an altered 2D+3D example 15 that I could send you if you want (or I could finally get around to cleaning it up and committing it to CVS...), but it's not going to tell you much - the assemble function is exactly the same no matter whether the mesh is Clough-Tocher triangles, Hermite rectangles, or Hermite cubes. --- Roy ```

 [Libmesh-users] a simple question From: li pan - 2006-02-22 16:23:05 ```dear all, I realized all the example which include an assemble() function are written for square or hex. Has anyone got a example for tetrahedron? It's not clear for me how to do volume integration and surface integration in the case of tetrahedron. best pan __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ```
 [Libmesh-users] a simple question From: li pan - 2006-03-27 14:26:18 ```Deal all, I met a strang problem. Maybe you can also try it. Just write a simple code of building a mesh and defining an equation_system, adding some variables and so on. int main (int argc, char** argv) { // Initialize Petsc, like in example 2. libMesh::init (argc, argv); const unsigned int dim = 3; // Create a dim-dimensional mesh. Mesh mesh (dim); std::cout<("non_linear"); system.add_variable("u",FIRST); system.add_variable("v",FIRST); system.add_variable("w",FIRST); system.attach_assemble_function(assemble_nonlinear ); equation_systems.init(); equation_systems.parameters.set("linear solver maximum iterations")=1000; equation_systems.parameters.set("linear solver tolerance")=1.e-10; } That's it. Compile and run the program. You'll get error report: [0]PETSC ERROR: MatSeqAIJSetPreallocation_SeqAIJ() line 2631 in src/mat/impls/aij/seq/aij.c [0]PETSC ERROR: Argument out of range! [0]PETSC ERROR: nnz cannot be greater than row length: local row 6 value 69 rowlength 54! [0]PETSC ERROR: MatCreateSeqAIJ() line 2544 in src/mat/impls/aij/seq/aij.c [0]PETSC ERROR: User provided function() line 138 in unknowndirectory/src/numerics/petsc_matrix.C [unset]: aborting job: application called MPI_Abort(comm=0x84000000, 63) - process 0 But if I use MeshTools::Generation::build_cube(mesh, 1,2,1, 0.,1., 0.,1., 0.,1., HEX8); or some other grid dimensions, the problem disappear. Do you know why? I configured my petsc with --download-f-blas-lapack=1 --download-mpich=1 --with-shared=1 pan __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ```
 Re: [Libmesh-users] a simple question From: Wout Ruijter - 2006-03-27 16:57:43 ```Hello Li, can't reproduce the error here on an ubuntu system with petsc 2.3.0: --with-shared --with-fortran=3D0 and libmesh from CVS: export METHOD=3Dopt --enable-ifem=3Dno --enable-petsc --enable-perflog \ =09--enable-second --enable-amr --enable-tetgen Cheers W On 3/27/06, li pan wrote: > Deal all, > I met a strang problem. Maybe you can also try it. > Just write a simple code of building a mesh and > defining an equation_system, adding some variables and > so on. > int main (int argc, char** argv) > { > // Initialize Petsc, like in example 2. > libMesh::init (argc, argv); > > const unsigned int dim =3D 3; > > // Create a dim-dimensional mesh. > Mesh mesh (dim); > std::cout< MeshTools::Generation::build_cube(mesh, > 1,2,2, > 0.,1., > 0.,1., > 0.,1., > HEX8); > mesh.print_info(); > > EquationSystems equation_systems (mesh); > > TransientLinearImplicitSystem & system =3D > equation_systems.add_system("non_linear"); > > system.add_variable("u",FIRST); > system.add_variable("v",FIRST); > system.add_variable("w",FIRST); > > > system.attach_assemble_function(assemble_nonlinear > ); > equation_systems.init(); > equation_systems.parameters.set int>("linear solver maximum iterations")=3D1000; > equation_systems.parameters.set("linear > solver tolerance")=3D1.e-10; > } > That's it. Compile and run the program. You'll get > error report: > [0]PETSC ERROR: MatSeqAIJSetPreallocation_SeqAIJ() > line 2631 in src/mat/impls/aij/seq/aij.c > [0]PETSC ERROR: Argument out of range! > [0]PETSC ERROR: nnz cannot be greater than row length: > local row 6 value 69 rowlength 54! > [0]PETSC ERROR: MatCreateSeqAIJ() line 2544 in > src/mat/impls/aij/seq/aij.c > [0]PETSC ERROR: User provided function() line 138 in > unknowndirectory/src/numerics/petsc_matrix.C > [unset]: aborting job: > application called MPI_Abort(comm=3D0x84000000, 63) - > process 0 > But if I use > MeshTools::Generation::build_cube(mesh, > 1,2,1, > 0.,1., > 0.,1., > 0.,1., > HEX8); > or some other grid dimensions, the problem disappear. > Do you know why? I configured my petsc with > --download-f-blas-lapack=3D1 --download-mpich=3D1 > --with-shared=3D1 > > > > pan > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting langua= ge > that extends applications into web and mobile media. Attend the live webc= ast > and join the prime developer group breaking into this new coding territor= y! > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D110944&bid=3D241720&dat= =3D121642 > _______________________________________________ > Libmesh-users mailing list > Libmesh-users@... > https://lists.sourceforge.net/lists/listinfo/libmesh-users > ```
 Re: [Libmesh-users] a simple question From: Roy Stogner - 2006-02-22 16:46:47 ```On Wed, 22 Feb 2006, li pan wrote: > I realized all the example which include an assemble() > function are written for square or hex. Has anyone got > a example for tetrahedron? It's not clear for me how > to do volume integration and surface integration in > the case of tetrahedron. It's exactly the same as area integration and edge integration for the 2D cases. I've got an altered 2D+3D example 15 that I could send you if you want (or I could finally get around to cleaning it up and committing it to CVS...), but it's not going to tell you much - the assemble function is exactly the same no matter whether the mesh is Clough-Tocher triangles, Hermite rectangles, or Hermite cubes. --- Roy ```
 [Libmesh-users] a simple question From: John Peterson - 2006-02-22 16:49:30 ```li pan writes: > dear all, > I realized all the example which include an assemble() > function are written for square or hex. Has anyone got > a example for tetrahedron? It's not clear for me how > to do volume integration and surface integration in > the case of tetrahedron. It doesn't make any difference. The code is the same for hexes or tets. See example 4 if you want to see a 3D example. -J ```