Dear libMesh developers and users,

I want to use matrix-free method and am looking into ShellMatrix in libMesh. To 
get started, I've looked at the ShellMatrix example in example 4 under 
Miscellaneous folder, and got several questions:

1. In the example of ShellMatrix, why building the system stiffness matrix? If 
we use ShellMatrix, is there a need to explicitly build the system stiffness 
matrix? My understanding is, the system stiffness matrix in this example is 
used to demonstrate the SumShellMatrix, is it correct?

2. If I use only TensorShellMatrix, without SumShellMatrix, I still need to 
build RHS in the assemble function and attach it to the EquationSystem, is it 
correct?

3. In order to build any user-defined mac-vec multiplication, I think we
 can create our own userShellMatrix.h and userShellMatrix.C, and define 
user-specific vector_mult(), vector_mult_add(), get_diagonal(), m() and 
n(), just as TensorShellMatrix and SumShellMatrix did. After this, we 
recompile libmesh, then we can start using userShellMatrix, and we don't
 need to worry about implementing solving the linear system using 
MatShell in PETSc since it's already coded up in libMesh solver, is it 
correct?

4. The general procedure to use ShellMatrix in my mind is the following: (take 
userShellMatrix for example)

       system.attach_assemble_function (assemble); // to build RHS
       userShellMatrix<Number> shellMatrix(...); // define mat-vec 
multiplication
       system.attach_shell_matrix(&shellMatrix);
       system.solve();
       system.detach_shell_matrix();

    Is it correct?


Regards, and thanks in advance for any answers.

Xikai Jiang
Postdoctoral Researcher
Materials Science Division, Argonne National Laboratory                         
                  
------------------------------------------------------------------------------
_______________________________________________
Libmesh-users mailing list
Libmesh-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to