-
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
Implementation of nodal source terms #1977
Conversation
03b5507
to
48c5e83
Compare
@@ -0,0 +1,4 @@ | |||
The name of the geometrical set (see \ref ogs_file_param__gml__name) in which | |||
the \ref | |||
ogs_file_param__prj__process_variables__process_variable__source_terms__ource_term_geometry |
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.
ource_term_geometry
-> source_term_geometry
I guess... ✅
MeshGeoToolsLib/CreateSearchLength.h
Outdated
@@ -20,6 +20,7 @@ | |||
|
|||
namespace MeshGeoToolsLib | |||
{ | |||
inline | |||
std::unique_ptr<MeshGeoToolsLib::SearchLength> createSearchLengthAlgorithm( | |||
BaseLib::ConfigTree const& external_config, MeshLib::Mesh const& mesh) | |||
{ |
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.
Would you move it to cpp, please. ✅
ProcessLib/SourceTerms/Tests.cmake
Outdated
@@ -0,0 +1,98 @@ | |||
AddTest( |
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'd move the Tests.cmake content to the corresponding process' Tests.cmake.... ✅
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.
You have done extensive tests, but there is no comparison, which would be nice I think.
Few documentation comments should be fixed.
|
||
#include "MeshGeoToolsLib/HeuristicSearchLength.h" | ||
#include "MeshGeoToolsLib/SearchLength.h" | ||
namespace MeshLib |
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. This is much nicer because of the removed includes and the fwd-decls.
@@ -0,0 +1,4 @@ | |||
The name of the geometrical set (see \ref ogs_file_param__gml__name) in which | |||
the \ref | |||
ogs_file_param__prj__process_variables__process_variable__source_terms__source_term_geometry |
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.
underscore missing before geometry: ...__source_term__geometry
config.checkConfigParameter("type", "Nodal"); | ||
|
||
//! \ogs_file_param{prj__process_variables__process_variable__source_terms__source_term__value} | ||
auto const nodal_value = config.getConfigParameter<double>("value"); |
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.
The <value>
tag belongs to the "Nodal" type, so the ogs_file_param
must be ..._source_term__Nodal__value
. And then you need a new folder Nodal/
in the Documentation/.../source_term/
. Compare to DirichletBC.cpp
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.
👍
d2b009f
to
2a95151
Compare
I think you didn't use 'git lfs' properly. Please enable the pre-commit hook. |
If there are no objections I'd like to rebase and merge the branch. |
⏩ if you do not wait jenkins test works |
MeshLib::Location const l{_mesh_id, MeshLib::MeshItemType::Node, _node_id}; | ||
auto const index = | ||
_dof_table.getGlobalIndex(l, _variable_id, _component_id); | ||
b.add(index, _value); |
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.
Does that mean that such source terms only work for single nodes? Is an extension to line sources/volumetric sources planned?
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 to both questions.
ids.size(), variable_id, *config.component_id); | ||
|
||
return ProcessLib::createNodalSourceTerm( | ||
config.config, dof_table, mesh.getID(), ids[0], variable_id, |
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.
IMHO it's very bad to silently drop n-1 of n sound node ids.
More complying with our current standards would be to OGS_FATAL if ids.size() > 1
. ✅
$$ | ||
G(x, y) = \frac{1}{2 \pi} \ln \sqrt{(x-\xi)^2 + (y-\eta)^2}. | ||
$$ | ||
With a nodal source term at $(0.0, 0.0)$ the analytical solution is |
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.
How strong is the source? Unity? ✅
2a95151
to
c4018dc
Compare
This avoids a linker error.
The reference files are created with the analytical solution. For the special setup with a dirac source term at position xi, eta the following analytical solution in 2 dimensions is valid: u(x,y) = ln(sqrt((x-xi)^2+(y-eta)^2))/(2 * Pi)
- Theory for analytical solution. - Comparison-images to analytical solution.
c4018dc
to
1d621ca
Compare
} | ||
|
||
void NodalSourceTerm::integrateNodalSourceTerm( | ||
const double t, |
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.
@TomFischer t
is not used. Would you please send a PR to remove this compilation warning?
OpenGeoSys development has been moved to GitLab. |
Nodal source terms are setup in the project file in the
process_variable
section.