-
Notifications
You must be signed in to change notification settings - Fork 239
Move dof table functionality #1442
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
Move dof table functionality #1442
Conversation
Please have a look at DOFTableUtil. There is already similar code. |
Thanks for the hint, I'll check this tomorrow. |
@@ -44,6 +44,42 @@ std::vector<GlobalIndexType> getIndices( | |||
return indices; | |||
} | |||
|
|||
NumLib::LocalToGlobalIndexMap::RowColumnIndices getRowColumnIndices( |
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.
It looks for me the function is similar to getIndices()
. Can't you reuse it?
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.
Indeed these functions are very similar. The important difference is that the getRowColumnIndices
does not create the result vector indices
again and again for every call of the function. Anyway, in this PR I only want to move existing code such that I can use it a second time at another place.
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.
i see. thanks for the explanation
return NumLib::LocalToGlobalIndexMap::RowColumnIndices(indices, indices); | ||
} | ||
|
||
void getVectorValues( |
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.
GlobalVector
such as EigenVector
has get(std::vector<IndexType> const& indices)
. maybe you can use it.
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.
Yes, you are right. The function get()
is already used internally in getVectorValues()
, see line 78. The function is a wrapper for the GlobalVector::get
that ensures that the vector local_x
has the appropriate size.
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.
is get()
at line 78 get(int)
or get(std::vector<int>&)
?
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.
If I am not wrong it is IDX_TYPE
which is probably int
.
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.
what I actually wanted to say is that you can write it as below. maybe you already know it and intentionally you are not using it.
local_x = x.get(r_c_indices.rows);
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.
Thanks for the hint, I did not know this. I needed only the functionality in my own balance implementation. So I moved the code to a general accessible location.
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.
looks good
@chleh Are the changes in TES okay? |
Changes in TES are OK. Code looks good. So you might merge this PR. I only want to make a short remark: |
I am unsure. Should I let |
fb8e22a
to
d9a1a36
Compare
For TES you can keep it as you have it in this PR. |
d9a1a36
to
08ad953
Compare
OpenGeoSys development has been moved to GitLab. |
As titled.