-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Draft] Transport and Covariance Matrices #714
base: development
Are you sure you want to change the base?
[Draft] Transport and Covariance Matrices #714
Conversation
General structure. Co-authored-by: Chad Mitchell <[email protected]>
Update initialization of LinearMap element.
for more information, see https://pre-commit.ci
Finish implementation of LinearMap element push.
for more information, see https://pre-commit.ci
Initialize covariance matrix from distribution parameters.
// zero out the 6x6 matrix | ||
CovarianceMatrix cv; | ||
for (int i=1; i<=6; ++i) { | ||
for (int j = 1; j <= 6; ++j) { | ||
cv(i, j) = 0.0; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Memo to Axel: default is F-order of amrex::Array2D
. Double check loop indices are effective.
for (int i=1; i<=6; ++i) { | ||
for (int j=1; j<=6; ++j) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Memo to Axel: default is F-order of amrex::Array2D
. Double check loop indices are effective.
Add amrex::SmallMatrix class with compile time size. Useful for, e.g.: - ECP-WarpX/impactx#714 - ECP-WarpX/impactx#702
transport_map(i, j) = R_ij; | ||
} | ||
} | ||
std::cout << "Caution: A user-provided linear map is used. Transport may not be symplectic." << "\n"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is a good location for the warning manager, using a low
severity warning
for (int i=1; i<=6; ++i) { | ||
for (int j = 1; j <= 6; ++j) { | ||
m_transport_map(i, j) = R(i, j); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for (int i=1; i<=6; ++i) { | |
for (int j = 1; j <= 6; ++j) { | |
m_transport_map(i, j) = R(i, j); | |
} | |
} | |
m_transport_map = R; |
amrex::Array1D<amrex::ParticleReal,1,6> vectorin; | ||
amrex::Array1D<amrex::ParticleReal,1,6> vectorout; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can use amrex::SmallVector
for (int i=1; i<=6; ++i) { | ||
|
||
vectorout(i) = 0.0; | ||
for (int j = 1; j <= 6; ++j) { | ||
vectorout(i) += m_transport_map(i, j) * vectorin(j); | ||
} | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for (int i=1; i<=6; ++i) { | |
vectorout(i) = 0.0; | |
for (int j = 1; j <= 6; ++j) { | |
vectorout(i) += m_transport_map(i, j) * vectorin(j); | |
} | |
} | |
vectorout = m_transport_map * vectorin; |
amrex::SmallMatrix
ImpactX::evolve
->ImpactX::track_particles
Introducesim.track_particles()
#741ImpactX::track_envelope