Skip to content

Commit

Permalink
Sync 'diskbulge' of github.com:CarrieFilion/EXP into diskbulge
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin D. Weinberg committed Dec 26, 2024
2 parents 3b84992 + 14e5da8 commit 3126261
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 3 additions & 1 deletion utils/ICs/EllipsoidForce.H
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#include <memory>
#include <vector>

#include <Eigen/Eigen>

#include <interp.H>
#include <gaussQ.H>

Expand Down Expand Up @@ -66,7 +68,7 @@ private:
vector<double> dX, table;
double rtmin, rtmax;
bool quadr, tmade, tlog;
bool nindx(vector<double>& x, vector<int>& n);
bool nindx(Eigen::Vector3d& x, Eigen::Vector3i& n);

void write_cache();
bool read_cache();
Expand Down
9 changes: 5 additions & 4 deletions utils/ICs/EllipsoidForce.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ EllipsoidForce::EllipsoidForce(double a0, double a1, double a2, double mass,

if (quadr) {

vector<double> x(3, 0);
Eigen::Vector3d x; x.setZero();
lrmin = log(rmin);
lrmax = log(rmax);
ldr = (lrmax - lrmin)/n;
Expand Down Expand Up @@ -494,7 +494,7 @@ void EllipsoidForce::MakeTable(int n1, int n2, int n3)
tmade = true;
}

bool EllipsoidForce::nindx(vector<double>& x, vector<int>& n)
bool EllipsoidForce::nindx(Eigen::Vector3d& x, Eigen::Vector3i& n)
{
for (int i=0; i<3; i++) {
if (tlog) {
Expand Down Expand Up @@ -536,13 +536,14 @@ void EllipsoidForce::TableEval(vector<double> x, vector<double>& force)

double f;
int indx;
vector<double> x1(x), a(3);
vector<int> n(3), n1(3);
Eigen::Vector3d x1, a;
Eigen::Vector3i n, n1;

//
// Put lower limit on the grid interpolation
//
for (int i=0; i<3; i++) {
x1[i] = x[i];
if (tlog)
x1[i] = max<double>(fabs(x1[i]), exp(rtmin));
else
Expand Down

0 comments on commit 3126261

Please sign in to comment.