-
Notifications
You must be signed in to change notification settings - Fork 239
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
Jacobian tester for local assemblers. #2238
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
6909056
[PL] calling not implemented method is an error now
chleh 465a680
[PL] made class final
chleh 5546b0b
[PL] Added assembler for comparing Jacobians
chleh 022aec8
[Doc] added input file docu
chleh f855e29
[doc] fixed old documentation
chleh 1de2ad7
[PL] try to work around compilation errors.
chleh 2c0652f
[PL] spelling
chleh 2b31f3e
[doc] added config example
chleh e10c550
[PL] relaxed M, K and b checks, added residual check.
chleh c4f3417
[PL] improved docu
chleh df28b1c
[PL] flush output before fatal error
chleh feb6e90
[PL] use std::ostream
chleh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
...processes/process/jacobian_assembler/CentralDifferences/c_CentralDifferences.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Assembles the Jacobian using central differences. |
5 changes: 5 additions & 0 deletions
5
...ocesses/process/jacobian_assembler/CentralDifferences/t_component_magnitudes.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Representative magnitudes for the components of the solution vector of the | ||
process being assembled. | ||
|
||
E.g., for the HT process there are two components: pressure and temperature, | ||
thus two values are expected in this case. |
5 changes: 5 additions & 0 deletions
5
.../processes/process/jacobian_assembler/CentralDifferences/t_relative_epsilons.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Specifies the magnitudes of the perturbations used to compute the numerical | ||
Jacobian. | ||
|
||
The magnitudes are specified relative to the \c component_magnitudes. | ||
The number of values given must match the one of the \c component_magnitudes. |
31 changes: 31 additions & 0 deletions
31
...prj/processes/process/jacobian_assembler/CompareJacobians/c_CompareJacobians.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
A Jacobian assembler that assembles the Jacobian in two different ways, compares | ||
the resulting local Jacobians and writes extensive logs in the form of a Python | ||
script if the provided tolerances are exceeded. | ||
|
||
Logging (and optionally program termination) is triggered only if both the | ||
absolute and the relative tolerance are exceeded. | ||
|
||
# Configuration example | ||
|
||
Code snippet: | ||
|
||
\code{xml} | ||
<OpenGeoSysProject> | ||
<processes> | ||
<process> | ||
<jacobian_assembler> | ||
<type>CompareJacobians</type> | ||
<jacobian_assembler> | ||
<type>Analytical</type> | ||
</jacobian_assembler> | ||
<reference_jacobian_assembler> | ||
<type>CentralDifferences</type> | ||
<component_magnitudes>1 1</component_magnitudes> | ||
<relative_epsilons>1e-6 1e-6</relative_epsilons> | ||
</reference_jacobian_assembler> | ||
<abs_tol>1e-18</abs_tol> | ||
<rel_tol>1e-7</rel_tol> | ||
<fail_on_error>true</fail_on_error> | ||
<log_file>/tmp/test.log</log_file> | ||
</jacobian_assembler> | ||
\endcode |
4 changes: 4 additions & 0 deletions
4
...jectFile/prj/processes/process/jacobian_assembler/CompareJacobians/t_abs_tol.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
The absolute tolerance (component-wise) for the difference between the two | ||
assembled local Jacobians. | ||
|
||
There is only one absolute tolerance value for all components of the Jacobian. |
2 changes: 2 additions & 0 deletions
2
...le/prj/processes/process/jacobian_assembler/CompareJacobians/t_fail_on_error.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Whether OGS should be aborted if both the absolute and relative tolerance are | ||
exceeded. |
2 changes: 2 additions & 0 deletions
2
...j/processes/process/jacobian_assembler/CompareJacobians/t_jacobian_assembler.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
The Jacobian assember whose assembled matrices will be used subsequently in the | ||
global equation system. |
8 changes: 8 additions & 0 deletions
8
...ectFile/prj/processes/process/jacobian_assembler/CompareJacobians/t_log_file.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
The path to the file to which details of differing Jacobians are written. | ||
|
||
Finally, the file will contain a Python script that can be used to conveniently | ||
examine the differences that occured. | ||
The given path is an absolute path or a path relative to the working directory | ||
of OGS. | ||
The log file will be overwritten, even if no differences exceeding the | ||
tolerances occur. |
2 changes: 2 additions & 0 deletions
2
...s/process/jacobian_assembler/CompareJacobians/t_reference_jacobian_assembler.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
The Jacobian assembler whose results are used only to check the assembled | ||
matrices of the other Jacobian assembler. |
4 changes: 4 additions & 0 deletions
4
...jectFile/prj/processes/process/jacobian_assembler/CompareJacobians/t_rel_tol.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
The relative tolerance (component-wise) for the difference between the two | ||
assembled local Jacobians. | ||
|
||
There is only one relative tolerance value for all components of the Jacobian. |
3 changes: 2 additions & 1 deletion
3
...on/ProjectFile/prj/processes/process/jacobian_assembler/i_jacobian_assembler.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
\ogs_missing_documentation | ||
This setting makes it easy to switch between different ways to assemble the | ||
Jacobian, e.g., analytically or numerically using finite differences. |
1 change: 0 additions & 1 deletion
1
.../ProjectFile/prj/processes/process/jacobian_assembler/t_component_magnitudes.md
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
...ion/ProjectFile/prj/processes/process/jacobian_assembler/t_relative_epsilons.md
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
Documentation/ProjectFile/prj/processes/process/jacobian_assembler/t_type.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
\ogs_missing_documentation | ||
The type of the Jacobian assembler to be used. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Please add a short why, and maybe how (if not obvious).
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.
Why ... because implementing this can be easily forgotten in derived classes. E.g., it's not implemented in the central differences assembler if I remember correctly.
How ... obviously: make it pure virtual and add the missing implementations.
Do you really want to have these comments in the code?