-
Notifications
You must be signed in to change notification settings - Fork 239
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2238 from chleh/jac-test
Jacobian tester for local assemblers.
- Loading branch information
Showing
20 changed files
with
594 additions
and
7 deletions.
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.