-
Notifications
You must be signed in to change notification settings - Fork 30
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
Fix fieldversion2 #1059
base: master
Are you sure you want to change the base?
Fix fieldversion2 #1059
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -68,7 +68,9 @@ class DependencyGraph { | |||||
}; | ||||||
|
||||||
protected: | ||||||
// map of Value (i.e. normally accessID to Vertex object | ||||||
std::unordered_map<int, Vertex> vertices_; | ||||||
// adjacencyList for each vertex where the position within the vector is the vertexID | ||||||
std::vector<EdgeList> adjacencyList_; | ||||||
|
||||||
public: | ||||||
|
@@ -96,8 +98,8 @@ class DependencyGraph { | |||||
DependencyGraph() = default; | ||||||
|
||||||
/// @brief Insert a new node | ||||||
Vertex& insertNode(int ID) { | ||||||
auto [iter, inserted] = vertices_.emplace(ID, Vertex{adjacencyList_.size(), ID}); | ||||||
Vertex& insertNode(int Value) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
we Capitalize only public members of classes |
||||||
auto [iter, inserted] = vertices_.emplace(Value, Vertex{adjacencyList_.size(), Value}); | ||||||
if(inserted) | ||||||
adjacencyList_.push_back(EdgeList()); | ||||||
return iter->second; | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,11 +21,10 @@ class generate_versioned_field { | |
::dawn::edge_field_t<LibTag, ::dawn::float_type>& m_c; | ||
::dawn::edge_field_t<LibTag, ::dawn::float_type>& m_d; | ||
::dawn::edge_field_t<LibTag, ::dawn::float_type>& m_e; | ||
::dawn::edge_field_t<LibTag, ::dawn::float_type>& m_c_0; | ||
::dawn::unstructured_domain m_unstructured_domain ; | ||
public: | ||
|
||
stencil_37(::dawn::mesh_t<LibTag> const &mesh, int k_size, ::dawn::edge_field_t<LibTag, ::dawn::float_type>&a, ::dawn::edge_field_t<LibTag, ::dawn::float_type>&b, ::dawn::edge_field_t<LibTag, ::dawn::float_type>&c, ::dawn::edge_field_t<LibTag, ::dawn::float_type>&d, ::dawn::edge_field_t<LibTag, ::dawn::float_type>&e, ::dawn::edge_field_t<LibTag, ::dawn::float_type>&c_0) : m_mesh(mesh), m_k_size(k_size), m_a(a), m_b(b), m_c(c), m_d(d), m_e(e), m_c_0(c_0){} | ||
stencil_37(::dawn::mesh_t<LibTag> const &mesh, int k_size, ::dawn::edge_field_t<LibTag, ::dawn::float_type>&a, ::dawn::edge_field_t<LibTag, ::dawn::float_type>&b, ::dawn::edge_field_t<LibTag, ::dawn::float_type>&c, ::dawn::edge_field_t<LibTag, ::dawn::float_type>&d, ::dawn::edge_field_t<LibTag, ::dawn::float_type>&e) : m_mesh(mesh), m_k_size(k_size), m_a(a), m_b(b), m_c(c), m_d(d), m_e(e){} | ||
|
||
~stencil_37() { | ||
} | ||
|
@@ -37,18 +36,14 @@ class generate_versioned_field { | |
static constexpr ::dawn::driver::unstructured_extent c_extent = {false, 0,0}; | ||
static constexpr ::dawn::driver::unstructured_extent d_extent = {false, 0,0}; | ||
static constexpr ::dawn::driver::unstructured_extent e_extent = {false, 0,0}; | ||
static constexpr ::dawn::driver::unstructured_extent c_0_extent = {false, 0,0}; | ||
|
||
void run() { | ||
using ::dawn::deref; | ||
{ | ||
for(int k = 0+0; k <= ( m_k_size == 0 ? 0 : (m_k_size - 1)) + 0+0; ++k) { | ||
for(auto const& loc : getEdges(LibTag{}, m_mesh)) { | ||
m_c_0(deref(LibTag{}, loc), (k + 0)) = m_c(deref(LibTag{}, loc), (k + 0)); | ||
} }}{ | ||
for(int k = 0+0; k <= ( m_k_size == 0 ? 0 : (m_k_size - 1)) + 0+0; ++k) { | ||
for(auto const& loc : getEdges(LibTag{}, m_mesh)) { | ||
m_a(deref(LibTag{}, loc), (k + 0)) = ((m_b(deref(LibTag{}, loc), (k + 0)) / m_c_0(deref(LibTag{}, loc), (k + 0))) + (::dawn::float_type) 5); | ||
m_a(deref(LibTag{}, loc), (k + 0)) = ((m_b(deref(LibTag{}, loc), (k + 0)) / m_c(deref(LibTag{}, loc), (k + 0))) + (::dawn::float_type) 5); | ||
} for(auto const& loc : getEdges(LibTag{}, m_mesh)) { | ||
Comment on lines
43
to
+46
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test can be removed then. It was testing that a versioned field was generated, but it's not generated anymore. |
||
if(m_d(deref(LibTag{}, loc), (k + 0))) | ||
{ | ||
m_a(deref(LibTag{}, loc), (k + 0)) = m_b(deref(LibTag{}, loc), (k + 0)); | ||
|
@@ -70,13 +65,12 @@ else | |
generate_versioned_field(const generate_versioned_field&) = delete; | ||
|
||
// Members | ||
::dawn::edge_field_t<LibTag, ::dawn::float_type> m_c_0; | ||
|
||
void set_splitter_index(::dawn::LocationType loc, ::dawn::UnstructuredIterationSpace space, int offset, int index) { | ||
m_stencil_37.m_unstructured_domain.set_splitter_index({loc, space, offset}, index); | ||
} | ||
|
||
generate_versioned_field(const ::dawn::mesh_t<LibTag> &mesh, int k_size, ::dawn::edge_field_t<LibTag, ::dawn::float_type>& a, ::dawn::edge_field_t<LibTag, ::dawn::float_type>& b, ::dawn::edge_field_t<LibTag, ::dawn::float_type>& c, ::dawn::edge_field_t<LibTag, ::dawn::float_type>& d, ::dawn::edge_field_t<LibTag, ::dawn::float_type>& e) : m_stencil_37(mesh, k_size,a,b,c,d,e,m_c_0), m_c_0(allocateFieldLike(LibTag{}, c)){} | ||
generate_versioned_field(const ::dawn::mesh_t<LibTag> &mesh, int k_size, ::dawn::edge_field_t<LibTag, ::dawn::float_type>& a, ::dawn::edge_field_t<LibTag, ::dawn::float_type>& b, ::dawn::edge_field_t<LibTag, ::dawn::float_type>& c, ::dawn::edge_field_t<LibTag, ::dawn::float_type>& d, ::dawn::edge_field_t<LibTag, ::dawn::float_type>& e) : m_stencil_37(mesh, k_size,a,b,c,d,e){} | ||
|
||
void run() { | ||
m_stencil_37.run(); | ||
|
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.
Isn't this always the case?
Also the description of
Vertex::Value
below could be improved ... doesn't it always correspond to an accessID?