[cig-commits] [commit] master: Some more conversions of explicit base element numbers. (caccf3e)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Mon May 12 05:15:08 PDT 2014
Repository : https://github.com/geodynamics/aspect
On branch : master
Link : https://github.com/geodynamics/aspect/compare/555391b308f972e57b2488cb024ed6bda549ebf0...485a82a477d4e359644ce65c4155a55cdde612d7
>---------------------------------------------------------------
commit caccf3e035db3d3c831aca6addca076ae6d8e4bc
Author: Wolfgang Bangerth <bangerth at math.tamu.edu>
Date: Sun May 11 21:15:29 2014 -0500
Some more conversions of explicit base element numbers.
>---------------------------------------------------------------
caccf3e035db3d3c831aca6addca076ae6d8e4bc
source/postprocess/composition_statistics.cc | 10 +++++-----
source/postprocess/heat_flux_statistics.cc | 4 ----
source/postprocess/table_heat_flux_statistics.cc | 4 ----
source/postprocess/temperature_statistics.cc | 4 ----
source/simulator/assembly.cc | 10 ++++++----
5 files changed, 11 insertions(+), 21 deletions(-)
diff --git a/source/postprocess/composition_statistics.cc b/source/postprocess/composition_statistics.cc
index 69216c8..16cd980 100644
--- a/source/postprocess/composition_statistics.cc
+++ b/source/postprocess/composition_statistics.cc
@@ -42,11 +42,11 @@ namespace aspect
return std::pair<std::string,std::string>();
// create a quadrature formula based on the compositional element alone.
- // be defensive about determining that what we think is the temperature
- // element is it in fact
- Assert (this->get_fe().n_base_elements() == 4,
- ExcNotImplemented());
- const QGauss<dim> quadrature_formula (this->get_fe().base_element(3).degree+1);
+ // be defensive about determining that a compositional field actually exists
+ AssertThrow (this->introspection().base_elements.compositional_fields
+ != numbers::invalid_unsigned_int,
+ ExcMessage("This postprocessor cannot be used without compositional fields."));
+ const QGauss<dim> quadrature_formula (this->get_fe().base_element(this->introspection().base_elements.compositional_fields).degree+1);
const unsigned int n_q_points = quadrature_formula.size();
FEValues<dim> fe_values (this->get_mapping(),
diff --git a/source/postprocess/heat_flux_statistics.cc b/source/postprocess/heat_flux_statistics.cc
index 21fe1a0..d159af1 100644
--- a/source/postprocess/heat_flux_statistics.cc
+++ b/source/postprocess/heat_flux_statistics.cc
@@ -36,10 +36,6 @@ namespace aspect
HeatFluxStatistics<dim>::execute (TableHandler &statistics)
{
// create a quadrature formula based on the temperature element alone.
- // be defensive about determining that what we think is the temperature
- // element, is it in fact
- Assert (this->get_fe().n_base_elements() == 3+(this->n_compositional_fields()>0 ? 1 : 0),
- ExcNotImplemented());
const QGauss<dim-1> quadrature_formula (this->get_fe().base_element(this->introspection().base_elements.temperature).degree+1);
FEFaceValues<dim> fe_face_values (this->get_mapping(),
diff --git a/source/postprocess/table_heat_flux_statistics.cc b/source/postprocess/table_heat_flux_statistics.cc
index dd75a5a..b77bcf7 100644
--- a/source/postprocess/table_heat_flux_statistics.cc
+++ b/source/postprocess/table_heat_flux_statistics.cc
@@ -45,10 +45,6 @@ namespace aspect
"material model interface."));
// create a quadrature formula based on the temperature element alone.
- // be defensive about determining that what we think is the temperature
- // element is it in fact
- Assert (this->get_fe().n_base_elements() == 3,
- ExcNotImplemented());
const QGauss<dim-1> quadrature (this->get_fe().base_element(this->introspection().base_elements.temperature).degree+1);
FEFaceValues<dim> fe_face_values (this->get_mapping(),
diff --git a/source/postprocess/temperature_statistics.cc b/source/postprocess/temperature_statistics.cc
index 91fa322..bd91404 100644
--- a/source/postprocess/temperature_statistics.cc
+++ b/source/postprocess/temperature_statistics.cc
@@ -39,10 +39,6 @@ namespace aspect
TemperatureStatistics<dim>::execute (TableHandler &statistics)
{
// create a quadrature formula based on the temperature element alone.
- // be defensive about determining that what we think is the temperature
- // element is it in fact
- Assert (this->get_fe().n_base_elements() == 3+(this->n_compositional_fields()>0 ? 1 : 0),
- ExcNotImplemented());
const QGauss<dim> quadrature_formula (this->get_fe().base_element(this->introspection().base_elements.temperature).degree+1);
const unsigned int n_q_points = quadrature_formula.size();
diff --git a/source/simulator/assembly.cc b/source/simulator/assembly.cc
index 0558f17..b551ebd 100644
--- a/source/simulator/assembly.cc
+++ b/source/simulator/assembly.cc
@@ -1689,11 +1689,12 @@ namespace aspect
// field index.)
internal::Assembly::Scratch::
AdvectionSystem<dim> (finite_element,
+//TODO: Give TemperatureOrComposition a way to return the base element index
finite_element.base_element(temperature_or_composition.is_temperature()
?
- introspection.block_indices.temperature
+ introspection.base_elements.temperature
:
- introspection.block_indices.compositional_fields[0]),
+ introspection.base_elements.compositional_fields),
mapping,
QGauss<dim>((temperature_or_composition.is_temperature()
?
@@ -1704,11 +1705,12 @@ namespace aspect
(parameters.stokes_velocity_degree+1)/2),
parameters.n_compositional_fields),
internal::Assembly::CopyData::
+//TODO: Give TemperatureOrComposition a way to return the base element index
AdvectionSystem<dim> (finite_element.base_element(temperature_or_composition.is_temperature()
?
- introspection.block_indices.temperature
+ introspection.base_elements.temperature
:
- introspection.block_indices.compositional_fields[0])));
+ introspection.base_elements.compositional_fields)));
system_matrix.compress(VectorOperation::add);
system_rhs.compress(VectorOperation::add);
More information about the CIG-COMMITS
mailing list