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

simplifying the code in the other source files under the refinement folder #1665

Merged
merged 1 commit into from
May 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion source/mesh_refinement/artificial_viscosity.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ namespace aspect
ArtificialViscosity<dim>::execute(Vector<float> &indicators) const
{
indicators = 0;
Vector<float> this_indicator(indicators.size());
if (temperature_scaling_factor > 0.0)
{
this->get_artificial_viscosity(indicators);
Expand All @@ -38,7 +39,7 @@ namespace aspect

for (unsigned int c=0; c<this->n_compositional_fields(); ++c)
{
Vector<float> this_indicator (indicators.size());
this_indicator = 0;
this->get_artificial_viscosity_composition(this_indicator, c);

// compute indicators += c*this_indicator:
Expand Down
12 changes: 5 additions & 7 deletions source/mesh_refinement/composition.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,12 @@ namespace aspect
ExcMessage ("This refinement criterion can not be used when no "
"compositional fields are active!"));
indicators = 0;
Vector<float> this_indicator (indicators.size());
QGauss<dim-1> quadrature (this->introspection().polynomial_degree.compositional_fields+1);

for (unsigned int c=0; c<this->n_compositional_fields(); ++c)
{
Vector<float> this_indicator (indicators.size());

QGauss<dim-1> quadrature (this->get_fe().base_element(this->introspection().base_elements.compositional_fields).degree+1);

this_indicator = 0;
KellyErrorEstimator<dim>::estimate (this->get_mapping(),
this->get_dof_handler(),
quadrature,
Expand All @@ -53,9 +52,8 @@ namespace aspect
0,
0,
this->get_triangulation().locally_owned_subdomain());
for (unsigned int i=0; i<indicators.size(); ++i)
this_indicator[i] *= composition_scaling_factors[c];
indicators += this_indicator;
// compute indicators += c*this_indicator:
indicators.add(composition_scaling_factors[c], this_indicator);
}
}

Expand Down
2 changes: 1 addition & 1 deletion source/mesh_refinement/temperature.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace aspect
{
indicators = 0;

QGauss<dim-1> quadrature (this->get_fe().base_element(this->introspection().base_elements.temperature).degree+1);
QGauss<dim-1> quadrature (this->introspection().polynomial_degree.temperature+1);

KellyErrorEstimator<dim>::estimate (this->get_mapping(),
this->get_dof_handler(),
Expand Down