Skip to content

247 resolvent analysis - #271

Draft
msilvestrec03 wants to merge 26 commits into
developfrom
247-resolvent-analysis
Draft

msilvestrec03 wants to merge 26 commits into
developfrom
247-resolvent-analysis

Conversation

@msilvestrec03

Copy link
Copy Markdown
Collaborator

Resolvent analysis for pyLOM

  • Uncompiled version: commented lines could be removed after the revision
  • Compiled version: many functions have been added to pyLOM's compiled version
  • Utils: Save POD has been reestructured. Not really clean function has been created, maybe can be improved

@msilvestrec03
msilvestrec03 requested a review from ArnauMiro May 29, 2026 13:22
@msilvestrec03

Copy link
Copy Markdown
Collaborator Author

Examples are missing (to be done)

@msilvestrec03

Copy link
Copy Markdown
Collaborator Author

Examples are missing (to be done)

Example of the jet uploaded

@msilvestrec03

Copy link
Copy Markdown
Collaborator Author

Possible error related to the cholesky factorization. Do not merge

@ArnauMiro ArnauMiro left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also think some testsuite runs to test the RES module.

Comment thread pyLOM/vmmath/src/vector_matrix.c Outdated
AC_MAT(B,m,ii,ii) = A[ii];
}
else{
AC_MAT(B,m,ii,jj) = 0;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Preallocate B to zeros with memset or similar and then just loop the diagonal.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment thread pyLOM/vmmath/src/vector_matrix.c Outdated
AC_MAT(B,m,ii,ii) = A[ii];
}
else{
AC_MAT(B,m,ii,jj) = 0;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Preallocate B to zeros with memset or similar and then just loop the diagonal.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment thread pyLOM/vmmath/src/vector_matrix.c Outdated
AC_MAT(B,m,ii,ii) = A[ii];
}
else{
AC_MAT(B,m,ii,jj) = 0;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Preallocate B to zeros with memset or similar and then just loop the diagonal.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment thread pyLOM/vmmath/src/vector_matrix.c Outdated
AC_MAT(B,m,ii,ii) = A[ii];
}
else{
AC_MAT(B,m,ii,jj) = 0;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Preallocate B to zeros with memset or similar and then just loop the diagonal.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment thread pyLOM/__init__.py Outdated

# Import Low Order Models
from . import POD, PCA, DMD, SPOD, MANIFOLD, GPOD, LAMINE
from . import POD, PCA, DMD, SPOD, MANIFOLD, GPOD, RES

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also include LAMINE

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment thread pyLOM/RES/plots.py
from ..utils import gpu_to_cpu


def plotEnergy(S,fig=None,ax=None):

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this the same as in POD?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is the same. I think that the function is also useful here. Should I change anything?

Comment thread pyLOM/RES/wrapper.py Outdated
'''
p = cp if type(Phi) is cp.ndarray else np

# Normalization of modes (?)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean code

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment thread pyLOM/RES/wrapper.py Outdated
# for ii in range(len(Matrix[0,:])):
# Matrix[:,ii] = Matrix[:,ii] / vector_norm(Phi[:,ii])

Omega = delta + 1j * freq

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment operations please

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done (enough?)

Comment thread pyLOM/RES/wrapper.py Outdated
U_res = matmul(Phi, matmul(Fhat_inv, U))
V_res = matmul(Phi, matmul(Fhat_inv, V))

# # U, S, VT = svd(diag(H))

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean code

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment thread pyLOM/RES/wrapper.pyx Outdated
from libc.string cimport memcpy, memset
from libc.math cimport sqrt, log, atan2
from ..vmmath.cfuncs cimport real, real_complex
# from ..vmmath.cfuncs cimport

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@msilvestrec03 msilvestrec03 reopened this Aug 19, 2026
@msilvestrec03

Copy link
Copy Markdown
Collaborator Author

I don't know why is this failing to build intel

@ArnauMiro

Copy link
Copy Markdown
Owner

@msilvestrec03 it's a timeout on the Intel APT repo. Possibly rerun the action after a while will fix it.

@msilvestrec03

Copy link
Copy Markdown
Collaborator Author

@msilvestrec03 it's a timeout on the Intel APT repo. Possibly rerun the action after a while will fix it.

Okay thanks. I will

@msilvestrec03

Copy link
Copy Markdown
Collaborator Author

Don't merge yet. Wait a meeting with Rafel, as the algorithm could be improved.
Let the merge in stand by

@ArnauMiro

Copy link
Copy Markdown
Owner

@msilvestrec03 @RafelPerello set the merge to draft if you're not ready please

@msilvestrec03
msilvestrec03 marked this pull request as draft August 25, 2026 08:50

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants