Code indexing in gitaly is broken and leads to code not being visible to the user. We work on the issue with highest priority.

Skip to content
Snippets Groups Projects
Commit d2edc375 authored by mayani_s's avatar mayani_s
Browse files

Merge branch '84-set_meshspacing-add-back-to-uniformcartesian' into 'master'

Resolve "set_meshSpacing add back to UniformCartesian"

Closes #84

See merge request !84
parents 78e3f80d f55905ef
No related branches found
No related tags found
1 merge request!84Resolve "set_meshSpacing add back to UniformCartesian"
......@@ -43,7 +43,9 @@ public:
void initialize(const NDIndex<Dim>& ndi,
const vector_type& hx,
const vector_type& origin);
// Set the spacings of mesh vertex positions (recompute Dvc, cell volume):
void setMeshSpacing(const vector_type& meshSpacing);
// Get the spacings of mesh vertex positions along specified direction
T getMeshSpacing(unsigned dim) const;
......@@ -51,7 +53,8 @@ public:
const vector_type& getMeshSpacing() const;
T getCellVolume() const;
void updateCellVolume_m();
// (x,y,z) coordinates of indexed vertex:
vector_type getVertexPosition(const NDIndex<Dim>& ndi) const {
......
......@@ -53,6 +53,12 @@ namespace ippl {
this->setOrigin(origin);
}
template<typename T, unsigned Dim>
void UniformCartesian<T, Dim>::setMeshSpacing(const vector_type& meshSpacing) {
meshSpacing_m = meshSpacing;
this->updateCellVolume_m();
}
template<typename T, unsigned Dim>
......@@ -74,4 +80,14 @@ namespace ippl {
T UniformCartesian<T, Dim>::getCellVolume() const {
return volume_m;
}
template<typename T, unsigned Dim>
void UniformCartesian<T, Dim>::updateCellVolume_m() {
// update cell volume
volume_m = 1.0;
for (unsigned i = 0; i < Dim; ++i) {
volume_m *= meshSpacing_m[i];
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment