38 #ifndef InterpolatedProfile_H
39 #define InterpolatedProfile_H
144 void getNodeIds(
int* nodeIds,
int& size);
156 void getCoefficients(
double* coeff,
int& size);
158 void getWeights(
int* nodeIds,
double* coeff,
int&size);
167 void interpRadius(
const int& k,
double& radius);
176 void interpDepth(
const int& k,
double& depth);
186 void interpVelocity(
const int& type,
const int& k,
double& velocity);
195 void interpGradient(
const int& type,
double& gradient);
202 bool isActiveProfile();
241 inline void InterpolatedProfile::getWeights(
int* nodeids,
double* coeff,
int& size)
244 for (
int i=0; i<(int)nodes.size(); i++)
246 nodeids[i] = nodes[i]->getNodeId();
247 coeff[i] = coefficients[i];
251 inline void InterpolatedProfile::getNodeIds(
int* nodeids,
int& size)
254 for (
int i=0; i<(int)nodes.size(); i++)
255 nodeids[i] = nodes[i]->getNodeId();
258 inline void InterpolatedProfile::getCoefficients(
double* coeff,
int& size)
261 for (
int i=0; i<(int)nodes.size(); i++)
262 coeff[i] = coefficients[i];
265 inline void InterpolatedProfile::interpRadius(
const int& k,
double& radius)
268 for (
int i=0; i<(int)nodes.size(); i++)
if (nodes[i])
269 radius += nodes[i]->getInterfaceRadius(k) * coefficients[i];
272 inline void InterpolatedProfile::interpDepth(
const int& k,
double& depth)
275 for (
int i=0; i<(int)nodes.size(); i++)
if (nodes[i])
276 depth += nodes[i]->getInterfaceDepth(k) * coefficients[i];
279 inline void InterpolatedProfile::interpVelocity(
const int& type,
const int& k,
double& velocity)
282 for (
int i=0; i<(int)nodes.size(); i++)
if (nodes[i])
283 velocity += nodes[i]->getVelocity(type,k) * coefficients[i];
286 inline void InterpolatedProfile::interpGradient(
const int& type,
double& gradient)
289 for (
int i=0; i<(int)nodes.size(); i++)
if (nodes[i])
290 gradient += nodes[i]->getMantleGradient(type) * coefficients[i];
293 inline bool InterpolatedProfile::isActiveProfile()
295 for (
int i=0; i<(int)nodes.size(); i++)
296 if (nodes[i]->getActiveNodeId() < 0)
A 2 dimensional, horizontal grid of GirdProfile objects.
Manages all information related to a single node in a Grid object.
A Profile object based on values interpolated from nearby GridProfile objects.
vector< double > coefficients
The interpolation coefficients which should be applied to this InterpolatedProfile's neighbors in ord...
static int interpolatedProfileClassCount
vector< double > & getCoefficients()
Retrieve the interpolation coefficients that define the dependency of this InterpolatedProfile on its...
vector< GridProfile * > nodes
An array of pointers to the GridProfile objects upon which this InterpolatedProfile is dependent.
InterpolatedProfile(const InterpolatedProfile &other)
Copy constructor.
static int getClassCount()
InterpolatedProfile & operator=(const InterpolatedProfile &other)
Equal operator.
virtual ~InterpolatedProfile()
Destructor.
vector< int > nodeIds
An array of pointers to the GridProfile objects upon which this InterpolatedProfile is dependent.
vector< GridProfile * > & getNodes()
Retrieve a list of pointers to the GridProfile objects upon which this InterpolatedProfile is depende...
InterpolatedProfile(Grid &grid, Location &location)
Parameterized constructor.
double getCoefficient(const int &i)
vector< int > & getNodeIds()
bool operator!=(const InterpolatedProfile &other)
Inequality operator.
int getNodeId(const int &i)
GridProfile * getNode(const int &i)
bool operator==(const InterpolatedProfile &other)
Equality operator.
InterpolatedProfile()
Default constructor.
The Location Class manages a single point in/on the Earth, which is described by the GRS80 ellipsoid.