getfem-users
[Top][All Lists]

## Re: Computation on regions

 From: Konstantinos Poulios Subject: Re: Computation on regions Date: Thu, 30 Jun 2022 20:02:50 +0200

Dear Eloi,

I think what you are looking for is something like this

M = gf.asm_generic(IM, 2, "Test2_u*Test_u", region, md)
M = scipy.sparse.csc_matrix((M.csc_val(),*(M.csc_ind()[::-1])))
K = scipy.sparse.csc_matrix((K.csc_val(),*(K.csc_ind()[::-1])))

BR
Kostas

On Thu, Jun 30, 2022 at 4:57 PM Eloi Martinet <eloi.martinet@univ-smb.fr> wrote:
Hello,
I'm using the python interface of GetFEM. My goal is to compute the laplace eigenvalues on a region of a spherical mesh, as follows (suppose the mesh, integration method IM and meshfem V is already declared):

# Assemble the stiffness and mass matrices
md = gf.Model("real")
Mg = gf.asm_generic(IM, 2, "Test2_u*Test_u", region, md)

# Convert to scipy sparse
K = getfem_to_scipy_sparse(Kg)
M = getfem_to_scipy_sparse(Mg)

# Compute the eigenvalues
eVal, eVec = scipy.linalg.sparse.eigsh(K, k+max_multiplicity+1, M, sigma=0, which='LM', v0=v0)

however, the size of the matrices K and M are the same as V.nbdof() whereas it should have less since the region isn't the whole mesh. Moreover, when I try to use the function "basic_dof_on_region", I get the following error :

NameError: name 'basic_dof_on_region' is not defined

I saw the things about the extension matrices but this is not clear to me how to construct it from the label of the region. So my question is what is the best way to compute eigenvalues on a region ?

Thank you for your help and have a good day.
Eloi MARTINET.