Skip to content
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 up linear solver #951

Merged
merged 18 commits into from
Jan 15, 2016
Merged

Move up linear solver #951

merged 18 commits into from
Jan 15, 2016

Conversation

endJunction
Copy link
Member

This is one step (of many following) to separate process specific functionality (like for the GroundwaterFlowProcess) from common parts of all monolithic processes. This is required for introduction of non-linear solver loop which will control the linear solver solve calls.

In this PR there is no functionality change nor their is any (but unavoidable) generalization, for example to handle multiple DOF per node. It's just moving some of the GroundwaterFlowProcess variables up into the Process class. Following the variables there are some functions.

Major changes in functions are:

  • Process::solve() is split into two parts: GroundwaterFlowProcess::assemble() followed common linear solver solve call.
  • Process::initialize() is split into two parts: Common process initialization and specific GroundwaterFlowProcess::init() part.

There is one thing I like to point out: because the GroundwaterFlow class is derived from a template Process this pointer is used to access Process's protected variables; I'll reduce their numbers in following PRs when more interfaces will be introduced.

Update: I'v just seen that diff for the review look like a mess, so maybe commit-wise review is easier...

@endJunction endJunction added this to the TES Process milestone Jan 12, 2016
@@ -84,7 +84,7 @@ ProjectData::~ProjectData()
{
delete _geoObjects;

for(ProcessLib::Process* p : _processes)
for(ProcessLib::Process<GlobalSetupType>* p : _processes)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now it might be good to have a typedef for it. here also auto would suffice, but typedef would also work below.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't get it; to be discussed.

@chleh
Copy link
Collaborator

chleh commented Jan 14, 2016

General note: I just noticed that there is a problem with commit-by-commit code review:
https://help.github.com/articles/why-are-my-commits-in-the-wrong-order/

@chleh
Copy link
Collaborator

chleh commented Jan 14, 2016

Good work so far. I've had quite some comments, but none of them addresses a fundamental issue.
So I think, there is no need to make changes to this PR (except for the computeSparsityPattern() issue), but it would be nice if you could make a TODO list which will either be worked off in a separate PR or at the end, after the whole refactoring has been completed.
In summary: Answer computeSparsityPattern(), make TODO list, then 👍

@chleh
Copy link
Collaborator

chleh commented Jan 14, 2016

Maybe for such a big change it would be good, the next time, to initially add some todo-comments (what will be added, moved, removed) to the source code. This way people not directly involved might more easily get an idea of where the changes head to.

std::unique_ptr<BaseLib::ConfigTree> _linear_solver_options;
std::unique_ptr<typename GlobalSetup::LinearSolver> _linear_solver;

std::unique_ptr<typename GlobalSetup::MatrixType> _A;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also need a possibility that _A, _x, _rhs could be shared by other processes.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this is not implemented yet, the current changes don't prohibit it. We shall see how it is possible when there are multiple weakly coupled processes, which shall not happen before March or so.

@wenqing
Copy link
Member

wenqing commented Jan 14, 2016

@endJunction 👍 This is the right way.

@endJunction
Copy link
Member Author

Addressed all open questions so far.
Updated todo list https://github.com/ufz/ogs/issues/949

Do not merge yet. I'll squash the 'md' (= merge down) commits to the origins before it goes to master. This way you can easier verify the changes.

}

bool solve(const double /*delta_t*/) override
bool assemble(const double /*delta_t*/) override
{
DBUG("Solve GroundwaterFlowProcess.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mismatch of the name of the method (assemble) and debug output (Solve ...) . ✅

@endJunction
Copy link
Member Author

@TomFischer if OK, I'll rebase and merge it.

@TomFischer
Copy link
Member

It is ok. Is there any label we could set for the case that the review is finished and the author of the PR can/shall merge down changes? Maybe this is in general a good approach?!

endJunction added a commit that referenced this pull request Jan 15, 2016
Move up common process variables/functions.
@endJunction endJunction merged commit 99bc7a4 into ufz:master Jan 15, 2016
@endJunction endJunction deleted the MoveUpLinearSolver branch January 15, 2016 13:58
@chleh chleh mentioned this pull request Jan 15, 2016
@ogsbot
Copy link
Member

ogsbot commented Jun 19, 2020

OpenGeoSys development has been moved to GitLab.

See this pull request on GitLab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants