-
Notifications
You must be signed in to change notification settings - Fork 238
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
implement WENO limiter for DG method #5929
base: main
Are you sure you want to change the base?
Changes from 1 commit
ce09083
b6aaaca
68e633c
4bfb4a8
13ed3c4
95edb8a
b0c4e8f
a53c298
9d46a62
06e7cb8
36ff891
0a25a71
7103a42
59f361b
d6a1a0e
92b5d90
e305776
f5cbc1c
4667dbc
aea41a4
fa78f1e
3c8173e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/* | ||
Copyright (C) 2011 - 2022 by the authors of the ASPECT code. | ||
|
||
This file is part of ASPECT. | ||
|
||
ASPECT is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation; either version 2, or (at your option) | ||
any later version. | ||
|
||
ASPECT is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
|
||
You should have received a copy of the GNU General Public License | ||
along with ASPECT; see the file LICENSE. If not see | ||
<http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
|
||
#ifndef _aspect_postprocess_visualization_kxrcf_indicator_h | ||
#define _aspect_postprocess_visualization_kxrcf_indicator_h | ||
|
||
#include <aspect/postprocess/visualization.h> | ||
#include <aspect/simulator_access.h> | ||
|
||
|
||
namespace aspect | ||
{ | ||
namespace Postprocess | ||
{ | ||
namespace VisualizationPostprocessors | ||
{ | ||
/** | ||
* A class derived that implements a function that provides the | ||
* KXRCF indicator for a given advection field on each cell for | ||
* graphical output. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add an explanation what the KXRCF indicator is. What does it stand for and what does it mean to have a high KXRCF in a cell? |
||
*/ | ||
template <int dim> | ||
class KXRCFIndicator : public CellDataVectorCreator<dim>, | ||
public SimulatorAccess<dim> | ||
{ | ||
public: | ||
/** | ||
* Constructor. | ||
*/ | ||
KXRCFIndicator(); | ||
|
||
/** | ||
* @copydoc CellDataVectorCreator<dim>::execute() | ||
*/ | ||
std::pair<std::string, std::unique_ptr<Vector<float>>> | ||
execute () const override; | ||
|
||
/** | ||
* Declare the parameters this class takes through input files. | ||
*/ | ||
static | ||
void | ||
declare_parameters (ParameterHandler &prm); | ||
|
||
/** | ||
* Read the parameters this class declares from the parameter file. | ||
*/ | ||
void | ||
parse_parameters (ParameterHandler &prm) override; | ||
|
||
private: | ||
/** | ||
* A parameter that tells us for which advection field the | ||
* KXRCF indicator should be visualized. | ||
*/ | ||
unsigned int field_index; | ||
}; | ||
} | ||
} | ||
} | ||
|
||
#endif |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
/* | ||
Copyright (C) 2011 - 2022 by the authors of the ASPECT code. | ||
|
||
This file is part of ASPECT. | ||
|
||
ASPECT is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation; either version 2, or (at your option) | ||
any later version. | ||
|
||
ASPECT is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
|
||
You should have received a copy of the GNU General Public License | ||
along with ASPECT; see the file LICENSE. If not see | ||
<http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
|
||
#include <aspect/postprocess/visualization/kxrcf_indicator.h> | ||
|
||
namespace aspect | ||
{ | ||
namespace Postprocess | ||
{ | ||
namespace VisualizationPostprocessors | ||
{ | ||
template <int dim> | ||
KXRCFIndicator<dim>::KXRCFIndicator() | ||
: | ||
CellDataVectorCreator<dim>("") | ||
{} | ||
|
||
|
||
template <int dim> | ||
std::pair<std::string, std::unique_ptr<Vector<float>>> | ||
KXRCFIndicator<dim>::execute() const | ||
{ | ||
std::pair<std::string, std::unique_ptr<Vector<float>>> | ||
return_value ("KXRCF_indicator", | ||
std::make_unique<Vector<float>>(this->get_triangulation().n_active_cells())); | ||
this->compute_KXRCF_indicators(*return_value.second, field_index); | ||
return return_value; | ||
} | ||
|
||
|
||
template <int dim> | ||
void | ||
KXRCFIndicator<dim>::declare_parameters(ParameterHandler &prm) | ||
{ | ||
prm.enter_subsection("Postprocess"); | ||
{ | ||
prm.enter_subsection("Visualization"); | ||
{ | ||
prm.enter_subsection("KXRCF indicator"); | ||
{ | ||
prm.declare_entry ("Name of advection field", "", | ||
Patterns::Anything(), | ||
"The name of the advection field whose output " | ||
"should be visualized. "); | ||
} | ||
prm.leave_subsection(); | ||
} | ||
prm.leave_subsection(); | ||
} | ||
prm.leave_subsection(); | ||
} | ||
|
||
|
||
template <int dim> | ||
void | ||
KXRCFIndicator<dim>::parse_parameters(ParameterHandler &prm) | ||
{ | ||
prm.enter_subsection("Postprocess"); | ||
{ | ||
prm.enter_subsection("Visualization"); | ||
{ | ||
prm.enter_subsection("KXRCF indicator"); | ||
{ | ||
const std::string field_name = prm.get("Name of advection field"); | ||
|
||
if (field_name == "temperature") | ||
field_index = 0; | ||
else | ||
{ | ||
AssertThrow(this->introspection().compositional_name_exists(field_name), | ||
ExcMessage("No compositional field with name <" + | ||
field_name + | ||
"> exists for which you want to visualize the KXRCF indicator.")); | ||
|
||
field_index = this->introspection().compositional_index_for_name(field_name) + 1; | ||
} | ||
} | ||
prm.leave_subsection(); | ||
} | ||
prm.leave_subsection(); | ||
} | ||
prm.leave_subsection(); | ||
} | ||
} | ||
} | ||
} | ||
|
||
|
||
// explicit instantiations | ||
namespace aspect | ||
{ | ||
namespace Postprocess | ||
{ | ||
namespace VisualizationPostprocessors | ||
{ | ||
ASPECT_REGISTER_VISUALIZATION_POSTPROCESSOR(KXRCFIndicator, | ||
"kxrcf indicator", | ||
"A visualization output object that generates output " | ||
"showing the value of the KXRCF indicator on each " | ||
"cell." | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As above, please extend this documentation by what the KXRCF indicator means and under what circumstances it makes sense to look at it. |
||
"\n\n" | ||
"Physical units: none.") | ||
} | ||
} | ||
} |
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 think it would need to be
bound preserving
.boundary preserving
refers to a geometrical boundary whilebound preserving
mean preserving the upper and lower bounds (values) of a solution.