Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
3bfe804
Added Koopman experimental features to expMSSA
Jul 7, 2024
f6c5b11
Merge branch 'devel' into KoopmanHankel
Jul 29, 2024
5e31133
Comment change only
Jul 29, 2024
82615b1
Added RKHS EDMD methods [no ci]
Jul 30, 2024
caec62e
Bug fixes for KoopmanRKHS [no ci]
Aug 7, 2024
6b0caea
Merge branch 'pointMesh' into KoopmanHankel
Aug 8, 2024
b1cacf2
Some additional orbit tests
Aug 11, 2024
031b5ff
Added Kepler test to KoopmanRKHS
Aug 12, 2024
477db50
Comment and output formating changes only
Aug 20, 2024
0206d51
Fix nEV storage [no ci]
Aug 23, 2024
bdaa0ab
Update to RKHS constructor and additional stdout diagnostics [no ci]
Aug 24, 2024
a223c60
More precision in diagonstic output [no ci]
Aug 24, 2024
9e58b57
Updates; incomplete implementation [no ci]
Aug 25, 2024
2e0a44b
Implemented and compiled, but almost certainly not working. Now for …
Aug 26, 2024
f2191d1
Some additional debugging; needs more explicit checking; clearly not …
Aug 27, 2024
0b40544
More updates for Liouville RKHS [no ci]
Aug 29, 2024
645b0f1
Added Singular Liouville method to the Liouville RKHS class [no ci]
Aug 29, 2024
794792b
Add OpenMP support to RKHS loops; switch from substep number to subst…
Aug 31, 2024
f2a433a
Added OpenMP support [no ci]
Sep 3, 2024
aeef67b
Some additional diagnostic checks [no ci]
Sep 3, 2024
e6b8146
Update for VTK-9 compile [no ci]
Sep 10, 2024
56120a0
A bunch of updates for language version consistency based on a Clang …
Sep 14, 2024
947f668
Merge branch 'KoopmanRKHS' of github.com:EXP-code/EXP into KoopmanRKHS
Sep 14, 2024
9434abe
Missing cassert
Sep 19, 2024
0b04688
Use Eigen::Ref<> to pass arrays to prevent pybind11 mapping failure i…
Sep 26, 2024
d583a10
Fix norm issue discovered in C++ tests
Sep 26, 2024
0fea8e3
Fixes for H5 API
Sep 26, 2024
6dad8ce
Do not copy data if nimax or ndmax are zero
Sep 26, 2024
9c7b2f6
Merge branch 'KoopmanRKHS' of github.com:EXP-code/EXP into KoopmanRKHS
Sep 26, 2024
01ee76b
Missing cassert header
The9Cat Sep 27, 2024
2e88a47
Merge branch 'KoopmanRKHS' of github.com:EXP-code/EXP into KoopmanRKHS
The9Cat Sep 27, 2024
03cb0cf
Make the default nmax=12, rather than nmaxfid. More sane.
Sep 27, 2024
b30361d
OutVel should put its file in outdir for consistence
Sep 27, 2024
37d63be
Updates for setMatrix() method for field coefficient types which need…
Sep 28, 2024
78d8e68
Merge branch 'KoopmanRKHS' of github.com:EXP-code/EXP into KoopmanRKHS
Sep 28, 2024
876edb6
Remove Eigen::Ref from setMatrix to allow more flexibility
Sep 28, 2024
8ab5ba2
Fix typos in diagnostic errors [no ci]
Sep 28, 2024
828f583
Change to variable number of fields in SphFldStruct and CylFldStruct …
Oct 5, 2024
1212151
Change names of Eigen::Tensor wrappers for consistency
Oct 5, 2024
fa84eda
Merge branch 'KoopmanRKHS' of github.com:EXP-code/EXP into KoopmanRKHS
The9Cat Oct 10, 2024
cdd2897
Do not enable CUDA twice
The9Cat Oct 10, 2024
edfd924
Update basis normalization
Oct 27, 2024
d2a23c5
Tests for 2d basis functions
Oct 28, 2024
45c4a64
Merge branch 'main' into KoopmanRKHS
Oct 28, 2024
3443360
Norm updates
Oct 28, 2024
2752d2e
Fix clang options for Linux
Oct 28, 2024
7443379
Make the force/coefficient evaluation consistent with the 2d basis norm
Nov 2, 2024
321dcd8
Updates for standalone VTK file writing
Nov 6, 2024
2f2d012
Missing removal of 2Pi factors from PolarBasis
Nov 6, 2024
ca858f8
Added lmaxfid to coefficient info
Nov 12, 2024
203cade
Add KDtree to its own namespace and allow a NN cache for multithreade…
Nov 12, 2024
6817c59
Update to normalization scheme for 2-d bases
Nov 15, 2024
c245d79
Fix backward compatibility for old GNU and except Clang
Nov 15, 2024
6baf465
Add model tag
Nov 18, 2024
f9a0f20
Separate background from target models in PolarModel
Nov 19, 2024
cd0a276
Fixes for FlatDisk with CUDA
Nov 19, 2024
56e5ac5
Use EmpCyl2d::ModelCyl pot and dpot functions for background
Nov 19, 2024
817892c
Added CBDisk for testing; not optimized in any way and no CUDA implem…
Nov 20, 2024
3ebd453
Fix seg fault when exiting before output or container object is insta…
Nov 21, 2024
18aa52b
Zero background arrays and only fill if disk object is instantiated
Nov 21, 2024
b2a15b9
Missing flag disk tag
Nov 21, 2024
6e5dbe4
Allow 2d and 3d norm switch; only 2d currently used so this makes no …
Nov 21, 2024
fac5609
Output updates only
Nov 21, 2024
34a8dcf
Merge branch 'VTKfiles' of github.com:EXP-code/EXP into VTKfiles
Nov 21, 2024
9ec4f4a
Allow gendisk2d to create an arbitrary EmpCyl2d basis
Nov 26, 2024
5a51669
Fix scaling for CB disk
Nov 26, 2024
222f078
Clean up only
Nov 26, 2024
57d477b
Add scaling for CBDisk to pyEXP
Nov 26, 2024
6df822f
Remove the default 'diag' output suffix
Dec 8, 2024
9f13a65
Use 'find_package' to identify the git location
Dec 10, 2024
dba7ade
Merge branch 'VTKfiles' of github.com:EXP-code/EXP into VTKfiles
Dec 10, 2024
febd3b7
Added a spherical histogram1d with logarithmic scaling to pyEXP; sinc…
Dec 17, 2024
46e7b2e
Implement pseudo-forces for 'Orient' moving 'CENTER' non-inertial frames
Dec 19, 2024
c2e5b9d
Fix mistake in ExternalForce switching for CUDA in ComponentContainer
Dec 20, 2024
35551fe
Merge branch 'VTKfiles' of github.com:EXP-code/EXP into VTKfiles
Dec 20, 2024
bdacd4f
Missing files for pseudo-force computation from center time series
Dec 20, 2024
885c904
Merge branch 'VTKfiles' of github.com:EXP-code/EXP into VTKfiles
Dec 20, 2024
46a36df
Initialize Component's 'modified' value
Dec 20, 2024
d2f5f5c
Make debug value static to prevent namespace and addressing issues
Dec 20, 2024
64c87cc
Removed RKHS stuff and made a new branch for the rest
Dec 21, 2024
ffa4513
A few more AddAccExt changes
michael-petersen Dec 22, 2024
5a9e677
Added more info on 'git submodule'
Dec 22, 2024
ae2ef19
Changed 'dump' to 'dumpbasis'. Some doxygen parameter descriptions
Dec 22, 2024
1159c2c
Changed 'dump' to 'dumpbasis'
Dec 22, 2024
872edf1
One more AddAccExt change
Dec 22, 2024
1f3e51e
Restore SVD options for the Koopman member in expMSSA
Dec 22, 2024
a77784e
Implementation of the pseudo-force estimator for Orient::Axis
Dec 23, 2024
f869b07
Merge branch 'minorFixesAndUpdates' of github.com:EXP-code/EXP into m…
Dec 23, 2024
667d641
Do not apply pseudo force if EJdryrun=True, although the values will …
Dec 23, 2024
e345939
Don't call for a pseudoforce in output diagnostics if not instantiated
Dec 23, 2024
3c91cbc
Don't call for a pseudoforce in output diagnostics if not instantiated
Dec 23, 2024
2c1b3b1
Add axis to diagnostic output. PseudoAccel should add the original d…
Dec 26, 2024
dd2b6cd
Fill the state vector before approximating any values
Dec 26, 2024
11012a6
Add divide-by-zero check in quadratic regression formula
Dec 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ set(CMAKE_CXX_EXTENSIONS OFF)
# Compiler flags. Not all tested thoroughly...
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# using Clang
message(STATUS "Clang compiler version is: ${CMAKE_CXX_COMPILER_VERSION}")
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0.0)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libstdc++")
endif()
endif()
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
# using GCC
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
Expand All @@ -25,6 +31,9 @@ endif()
# Required compiler features
add_compile_options(-D_REENTRANT)

# Bake in library paths (esp. useful for HPC sites with modules)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

# Check and enforce that we are a git repository. Necessary for
# submodules to work correctly.
if(EXISTS "${PROJECT_SOURCE_DIR}/.git")
Expand Down Expand Up @@ -67,6 +76,7 @@ find_package(HDF5 COMPONENTS C CXX HL REQUIRED)
find_package(TIRPC) # Check for alternative Sun rpc support
find_package(Eigen3 REQUIRED)
find_package(PNG)
find_package(Git)

# Check for FE
include(FEENABLE)
Expand Down Expand Up @@ -183,15 +193,15 @@ add_compile_definitions(DATTRIB_CUDA=${CUDA_EXP_DATTRIB})

# Get the current working branch
execute_process(
COMMAND git rev-parse --abbrev-ref HEAD
COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE
)

# Git submodule updates
execute_process(
COMMAND git submodule update --init --recursive
COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
RESULT_VARIABLE GIT_SUBMOD_RESULT
)
Expand All @@ -204,7 +214,7 @@ endif()

# Get the latest abbreviated commit hash of the working branch
execute_process(
COMMAND git rev-parse HEAD
COMMAND ${GIT_EXECUTABLE} rev-parse HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_COMMIT
OUTPUT_STRIP_TRAILING_WHITESPACE
Expand Down
21 changes: 15 additions & 6 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
# Configuring and building EXP

We are now using git submodules to provide `yaml-cpp`, which is not
common in the HPC environments. So, from the top-level directory, do
the following:
We are now using git submodules to provide a number of packages that
are not common in the HPC environments. These include

- `HighFive`, a C++ wrapper
class to HDF5
- `yaml-cpp`, a C++ class for reading and emitting YAML code
- `pybind11` which is used for Python bindings to the C++ classes
- `rapidxml`, used to write VTK files for rendering outside of EXP
- `png++`, C++ wrappers to the png library [Note: png support is optional]

CMake will automatically download and configure these packages on the
first call. However, if you would to do this manually, from the
top-level directory, execute the following command:

```
git submodule update --init --recursive
```

This will install `yaml-cpp` in the `extern` directory. The png++ C++
wrappers to the png library are also installed in `extern`. Note: png
support is optional.
This will install the source packages in the `extern` directory.


## EXP uses CMake for building a configuration

Expand Down
30 changes: 29 additions & 1 deletion expui/BasisFactory.H
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <ParticleReader.H>
#include <OrthoFunction.H>
#include <Coefficients.H>
#include <PseudoAccel.H>
#include <YamlCheck.H>
#include <localmpi.H>
#include <exputils.H>
Expand Down Expand Up @@ -123,8 +124,22 @@ namespace BasisClasses
//! Midplane escursion parameter
double colh = 4.0;

public:
//@
//! Pseudo-acceleration db
Eigen::VectorXd t_accel;
Eigen::MatrixXd p_accel;
//@}

//! Number of center points in acceleration estimator
int Naccel = 0;

//! Get the current pseudo acceleration value
Eigen::Vector3d currentAccel(double time);

public:
//! The current pseudo acceleration
Eigen::Vector3d pseudo {0, 0, 0};

//! Constructor from YAML node
Basis(const YAML::Node& conf, const std::string& name="Basis");

Expand Down Expand Up @@ -231,6 +246,19 @@ namespace BasisClasses
//! Height above/below the plane for midplane search in disk scale
//! lengths
void setColumnHeight(double value) { colh = value; }

//@{
//! Initialize non-inertial forces
void setNonInertial(int N, Eigen::VectorXd& x, Eigen::MatrixXd& pos);
void setNonInertial(int N, const std::string& orient);
//@}

//! Set the current pseudo acceleration
void setNonInertialAccel(double time)
{
if (Naccel > 0) pseudo = currentAccel(time);
}

};

using BasisPtr = std::shared_ptr<Basis>;
Expand Down
96 changes: 96 additions & 0 deletions expui/BasisFactory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ namespace BasisClasses
else if ( !name.compare("flatdisk") ) {
basis = std::make_shared<FlatDisk>(conf);
}
else if ( !name.compare("CBDisk") ) {
basis = std::make_shared<CBDisk>(conf);
}
else if ( !name.compare("slabSL") ) {
basis = std::make_shared<Slab>(conf);
}
Expand Down Expand Up @@ -280,5 +283,98 @@ namespace BasisClasses
return makeFromArray(time);
}

void Basis::setNonInertial(int N, Eigen::VectorXd& t, Eigen::MatrixXd& pos)
{
Naccel = N;
t_accel = t;
p_accel = pos;
}

void Basis::setNonInertial(int N, const std::string& orient)
{
std::ifstream in(orient);

if (not in) {
throw std::runtime_error("Cannot open Orient file with centering data: " + orient);
}

const int cbufsiz = 16384;
std::unique_ptr<char[]> cbuf(new char [cbufsiz]);

// Look for data and write it while
// accumlating data for averaging
Eigen::Vector3d testread;
double time, dummy;

std::vector<double> times;
std::vector<Eigen::Vector3d> centers;

while (in) {

in.getline(cbuf.get(), cbufsiz);
if (in.rdstate() & (ios::failbit | ios::eofbit)) break;

// Skip comment lines
//
if (cbuf[0] == '#') continue;

std::istringstream line(cbuf.get());

// Read until current time is reached
line >> time; //
line >> dummy;
line >> dummy;

bool allRead = true;
for (int i=0; i<8; i++) {
if (line.eof()) allRead = false;
for (int k; k<3; k++) line >> testread(k);
}
if (allRead) {
times.push_back(time);
centers.push_back(testread);
}
}

// Repack data
Naccel = N;
t_accel.resize(times.size());
p_accel.resize(times.size(), 3);
for (int i=0; i<times.size(); i++) {
t_accel(i) = times[i];
for (int k=0; k<3; k++) p_accel(i, k) = centers[i](k);
}
}


Eigen::Vector3d Basis::currentAccel(double time)
{
Eigen::Vector3d ret;

if (time < t_accel(0) || time > t_accel(t_accel.size()-1)) {
std::cout << "ERROR: " << time << " is outside of range of the non-inertial DB"
<< std::endl;
ret.setZero();
return ret;
}
else {
int imin = 0;
int imax = std::lower_bound(t_accel.data(), t_accel.data()+t_accel.size(), time) - t_accel.data();
if (imax > Naccel) imin = imax - Naccel;

int num = imax - imin + 1;
Eigen::VectorXd t(num);
Eigen::MatrixXd p(num, 3);
for (int i=imin; i<=imax; i++) {
t(i-imin) = t_accel(i);
for (int k=0; k<3; k++) p(i-imin, k) = p_accel(i, k);
}

for (int k=0; k<3; k++)
ret(k) = 2.0*std::get<0>(QuadLS<Eigen::VectorXd>(t, p.col(k)).coefs());
}
return ret;
}

}
// END namespace BasisClasses
Loading