[cig-commits] commit 1930 by buerg to /var/svn/dealii/aspect
dealii.demon at gmail.com
dealii.demon at gmail.com
Tue Oct 1 10:21:06 PDT 2013
Revision 1930
Merge temperature and composition DoFHandlers.
U trunk/aspire/include/aspect/introspection.h
U trunk/aspire/include/aspect/simulator.h
U trunk/aspire/include/aspect/simulator_access.h
U trunk/aspire/source/mesh_refinement/composition.cc
U trunk/aspire/source/mesh_refinement/density.cc
U trunk/aspire/source/mesh_refinement/temperature.cc
U trunk/aspire/source/mesh_refinement/thermal_energy_density.cc
U trunk/aspire/source/postprocess/composition_statistics.cc
U trunk/aspire/source/postprocess/heat_flux_statistics.cc
U trunk/aspire/source/postprocess/temperature_statistics.cc
U trunk/aspire/source/postprocess/visualization.cc
U trunk/aspire/source/simulator/assembly.cc
U trunk/aspire/source/simulator/checkpoint_restart.cc
U trunk/aspire/source/simulator/core.cc
U trunk/aspire/source/simulator/helper_functions.cc
U trunk/aspire/source/simulator/initial_conditions.cc
U trunk/aspire/source/simulator/parameters.cc
U trunk/aspire/source/simulator/simulator_access.cc
http://www.dealii.org/websvn/revision.php?repname=Aspect+Repository&path=%2F&rev=1930&peg=1930
Diff:
Modified: trunk/aspire/include/aspect/introspection.h
===================================================================
--- trunk/aspire/include/aspect/introspection.h 2013-09-30 17:56:36 UTC (rev 1929)
+++ trunk/aspire/include/aspect/introspection.h 2013-10-01 17:20:34 UTC (rev 1930)
@@ -169,20 +169,13 @@
IndexSet velocity_relevant_set;
/**
- * An index set that indicates which (among all) temperature degrees of freedom
+ * An index set that indicates which (among all) advection degrees of freedom
* are relevant to the current processor. See the deal.II documentation
* for the definition of the term "locally relevant degrees of freedom".
*/
- IndexSet temperature_relevant_set;
+ IndexSet advection_relevant_set;
/**
- * An index set that indicates which (among all) composition degrees of freedom
- * are relevant to the current processor. See the deal.II documentation
- * for the definition of the term "locally relevant degrees of freedom".
- */
- IndexSet composition_relevant_set;
-
- /**
* A collection of index sets that for each of the vector blocks
* of this finite element represents the global indices of the
* velocity degrees of freedom owned by this processor. The n_blocks
@@ -193,22 +186,14 @@
std::vector<IndexSet> velocity_partitioning;
/**
- * An index set that represents the global indices of the temperature
+ * An index set that represents the global indices of the advection
* degrees of freedom owned by this processor. The n_blocks elements
* of this array form a mutually exclusive decomposition of the index
- * set containing all locally owned temperature degrees of freedom.
+ * set containing all locally owned advection degrees of freedom.
*/
- IndexSet temperature_partitioning;
+ IndexSet advection_partitioning;
/**
- * An index set that represents the global indices of the composition
- * degrees of freedom owned by this processor. The n_blocks elements
- * of this array form a mutually exclusive decomposition of the index
- * set containing all locally owned composition degrees of freedom.
- */
- IndexSet composition_partitioning;
-
- /**
* A collection of index sets that for each of the vector blocks
* of this finite element represents the global indices of the
* velocity degrees of freedom are relevant to this processor. The n_blocks
Modified: trunk/aspire/include/aspect/simulator.h
===================================================================
--- trunk/aspire/include/aspect/simulator.h 2013-09-30 17:56:36 UTC (rev 1929)
+++ trunk/aspire/include/aspect/simulator.h 2013-10-01 17:20:34 UTC (rev 1930)
@@ -233,8 +233,7 @@
unsigned int stokes_velocity_degree;
bool use_locally_conservative_discretization;
bool use_axisymmetric_discretization;
- unsigned int temperature_degree;
- unsigned int composition_degree;
+ unsigned int advection_degree;
/**
* @}
*/
@@ -584,7 +583,6 @@
*/
void
local_assemble_stokes_system (const SynchronousIterators<std_cxx1x::tuple<FilteredIterator<typename DoFHandler<dim>::active_cell_iterator>,
- FilteredIterator<typename DoFHandler<dim>::active_cell_iterator>,
FilteredIterator<typename DoFHandler<dim>::active_cell_iterator> > > &cell,
internal::Assembly::Scratch::StokesSystem<dim> &scratch,
internal::Assembly::CopyData::StokesSystem<dim> &data);
@@ -611,7 +609,6 @@
const double global_max_velocity,
const double global_entropy_variation,
const SynchronousIterators<std_cxx1x::tuple<FilteredIterator<typename DoFHandler<dim>::active_cell_iterator>,
- FilteredIterator<typename DoFHandler<dim>::active_cell_iterator>,
FilteredIterator<typename DoFHandler<dim>::active_cell_iterator> > > &cell,
internal::Assembly::Scratch::TemperatureSystem<dim> &scratch,
internal::Assembly::CopyData::TemperatureSystem<dim> &data);
@@ -628,7 +625,6 @@
const double global_max_velocity,
const std::vector<double> global_entropy_variations,
const SynchronousIterators<std_cxx1x::tuple<FilteredIterator<typename DoFHandler<dim>::active_cell_iterator>,
- FilteredIterator<typename DoFHandler<dim>::active_cell_iterator>,
FilteredIterator<typename DoFHandler<dim>::active_cell_iterator> > > &cell,
internal::Assembly::Scratch::CompositionSystem<dim> &scratch,
internal::Assembly::CopyData::CompositionSystem<dim> &data);
@@ -786,8 +782,7 @@
const TrilinosWrappers::MPI::Vector &input_solution_temperature,
const TrilinosWrappers::MPI::BlockVector &input_solution_composition,
const FEValues<dim,dim> &input_fe_values_velocity,
- const FEValues<dim,dim> &input_fe_values_temperature,
- const FEValues<dim,dim> &input_fe_values_composition,
+ const FEValues<dim,dim> &input_fe_values_advection,
typename MaterialModel::Interface<dim>::MaterialModelInputs &material_model_inputs) const;
/**
@@ -920,12 +915,10 @@
const MappingQ<dim> mapping;
const FESystem<dim> fe_velocity;
- const FE_Q<dim> fe_temperature;
- const FE_Q<dim> fe_composition;
+ const FE_Q<dim> fe_advection;
DoFHandler<dim> dof_handler_velocity;
- DoFHandler<dim> dof_handler_temperature;
- DoFHandler<dim> dof_handler_composition;
+ DoFHandler<dim> dof_handler_advection;
ConstraintMatrix constraints_velocity;
ConstraintMatrix constraints_temperature;
Modified: trunk/aspire/include/aspect/simulator_access.h
===================================================================
--- trunk/aspire/include/aspect/simulator_access.h 2013-09-30 17:56:36 UTC (rev 1929)
+++ trunk/aspire/include/aspect/simulator_access.h 2013-10-01 17:20:34 UTC (rev 1930)
@@ -232,19 +232,12 @@
/**
* Return a reference to the DoFHandler that is used to discretize
- * the temperature at the current time step.
+ * the advection equations at the current time step.
*/
const DoFHandler<dim> &
- get_dof_handler_temperature () const;
+ get_dof_handler_advection () const;
/**
- * Return a reference to the DoFHandler that is used to discretize
- * the composition variables at the current time step.
- */
- const DoFHandler<dim> &
- get_dof_handler_composition () const;
-
- /**
* Return a reference to the finite element that the DoFHandler that
* is used to discretize the velocity variables at the current time step
* is built on. This is the finite element for the velocity problem, i.e.,
@@ -255,19 +248,11 @@
/**
* Return a reference to the finite element that the DoFHandler that
- * is used to discretize the temperature at the current time step is built
- * on.
+ * is used to discretize the advection equations at the current time step
+ * is built on.
*/
const FiniteElement<dim> &
- get_fe_temperature () const;
-
- /**
- * Return a reference to the finite element that the DoFHandler that
- * is used to discretize the composition at the current time step is built
- * on.
- */
- const FiniteElement<dim> &
- get_fe_composition () const;
+ get_fe_advection () const;
/** @} */
Modified: trunk/aspire/source/mesh_refinement/composition.cc
===================================================================
--- trunk/aspire/source/mesh_refinement/composition.cc 2013-09-30 17:56:36 UTC (rev 1929)
+++ trunk/aspire/source/mesh_refinement/composition.cc 2013-10-01 17:20:34 UTC (rev 1930)
@@ -43,8 +43,8 @@
Vector<float> this_indicator (indicators.size());
KellyErrorEstimator<dim>::estimate (this->get_mapping (),
- this->get_dof_handler_composition (),
- QGauss<dim - 1> (this->get_fe_composition ().degree + 1),
+ this->get_dof_handler_advection (),
+ QGauss<dim - 1> (this->get_fe_advection ().degree + 1),
typename FunctionMap<dim>::type(),
this->get_solution_composition ().block (c),
this_indicator, ComponentMask (), 0, 0,
Modified: trunk/aspire/source/mesh_refinement/density.cc
===================================================================
--- trunk/aspire/source/mesh_refinement/density.cc 2013-09-30 17:56:36 UTC (rev 1929)
+++ trunk/aspire/source/mesh_refinement/density.cc 2013-10-01 17:20:34 UTC (rev 1930)
@@ -50,23 +50,19 @@
// (because quadrature points and temperature dofs are,
// by design of the quadrature formula, numbered in the
// same way)
- LinearAlgebra::Vector vec_distributed (this->introspection ().index_sets.temperature_partitioning,
+ LinearAlgebra::Vector vec_distributed (this->introspection ().index_sets.advection_partitioning,
this->get_mpi_communicator ());
- const Quadrature<dim> quadrature (this->get_fe_temperature ().get_unit_support_points ());
- std::vector<types::global_dof_index> local_dof_indices (this->get_fe_temperature ().dofs_per_cell);
+ const Quadrature<dim> quadrature (this->get_fe_advection ().get_unit_support_points ());
+ std::vector<types::global_dof_index> local_dof_indices (this->get_fe_advection ().dofs_per_cell);
FEValues<dim> fe_values_velocity (this->get_mapping (),
this->get_fe_velocity (),
quadrature,
update_values);
- FEValues<dim> fe_values_temperature (this->get_mapping (),
- this->get_fe_temperature (),
- quadrature,
- update_quadrature_points | update_values);
- FEValues<dim> fe_values_composition (this->get_mapping (),
- this->get_fe_composition (),
- quadrature,
- update_values);
+ FEValues<dim> fe_values_advection (this->get_mapping (),
+ this->get_fe_advection (),
+ quadrature,
+ update_quadrature_points | update_values);
// the values of the compositional fields are stored as blockvectors for each field
// we have to extract them in this structure
std::vector<std::vector<double> > prelim_composition_values (this->n_compositional_fields(),
@@ -79,24 +75,22 @@
typename DoFHandler<dim>::active_cell_iterator
cell_velocity = this->get_dof_handler_velocity ().begin_active (),
- cell_temperature = this->get_dof_handler_temperature ().begin_active (),
- cell_composition = this->get_dof_handler_composition ().begin_active (),
- endc = this->get_dof_handler_temperature ().end ();
- for (; cell_temperature != endc; ++cell_velocity, ++cell_temperature, ++cell_composition)
- if (cell_temperature->is_locally_owned ())
+ cell_advection = this->get_dof_handler_advection ().begin_active (),
+ endc = this->get_dof_handler_advection ().end ();
+ for (; cell_advection != endc; ++cell_velocity, ++cell_advection)
+ if (cell_advection->is_locally_owned ())
{
fe_values_velocity.reinit (cell_velocity);
fe_values_velocity[this->introspection ().extractors.pressure].get_function_values (this->get_solution_velocity (),
in.pressure);
- fe_values_temperature.reinit (cell_temperature);
- fe_values_temperature.get_function_values (this->get_solution_temperature (), in.temperature);
- fe_values_composition.reinit (cell_composition);
+ fe_values_advection.reinit (cell_advection);
+ fe_values_advection.get_function_values (this->get_solution_temperature (), in.temperature);
for (unsigned int c=0; c<this->n_compositional_fields(); ++c)
- fe_values_composition.get_function_values (this->get_solution_composition ().block (c),
- prelim_composition_values[c]);
+ fe_values_advection.get_function_values (this->get_solution_composition ().block (c),
+ prelim_composition_values[c]);
- in.position = fe_values_temperature.get_quadrature_points ();
+ in.position = fe_values_advection.get_quadrature_points ();
in.strain_rate.resize(0);// we are not reading the viscosity
for (unsigned int i=0;i<quadrature.size();++i)
{
@@ -105,12 +99,12 @@
}
this->get_material_model().evaluate(in, out);
- cell_temperature->get_dof_indices (local_dof_indices);
+ cell_advection->get_dof_indices (local_dof_indices);
// for each temperature dof, write into the output
// vector the density. note that quadrature points and
// dofs are enumerated in the same order
- for (unsigned int i = 0; i < this->get_fe_temperature ().dofs_per_cell; ++i)
+ for (unsigned int i = 0; i < this->get_fe_advection ().dofs_per_cell; ++i)
{
vec_distributed (local_dof_indices[i]) = out.densities[i];
}
@@ -118,12 +112,12 @@
// now create a vector with the requisite ghost elements
// and use it for estimating the gradients
- LinearAlgebra::Vector vec (this->introspection ().index_sets.temperature_relevant_set,
+ LinearAlgebra::Vector vec (this->introspection ().index_sets.advection_relevant_set,
this->get_mpi_communicator ());
vec = vec_distributed;
DerivativeApproximation::approximate_gradient (this->get_mapping (),
- this->get_dof_handler_temperature (),
+ this->get_dof_handler_advection (),
vec,
indicators);
@@ -136,8 +130,8 @@
const double power = 1.0 + dim/2.0;
{
typename DoFHandler<dim>::active_cell_iterator
- cell = this->get_dof_handler_temperature ().begin_active (),
- endc = this->get_dof_handler_temperature ().end ();
+ cell = this->get_dof_handler_advection ().begin_active (),
+ endc = this->get_dof_handler_advection ().end ();
unsigned int i=0;
for (; cell!=endc; ++cell, ++i)
if (cell->is_locally_owned())
Modified: trunk/aspire/source/mesh_refinement/temperature.cc
===================================================================
--- trunk/aspire/source/mesh_refinement/temperature.cc 2013-09-30 17:56:36 UTC (rev 1929)
+++ trunk/aspire/source/mesh_refinement/temperature.cc 2013-10-01 17:20:34 UTC (rev 1930)
@@ -35,8 +35,8 @@
{
indicators = 0;
- KellyErrorEstimator<dim>::estimate (this->get_dof_handler_temperature (),
- QGauss<dim - 1> (this->get_fe_temperature ().degree + 1),
+ KellyErrorEstimator<dim>::estimate (this->get_dof_handler_advection (),
+ QGauss<dim - 1> (this->get_fe_advection ().degree + 1),
typename FunctionMap<dim>::type(),
this->get_solution_temperature (),
indicators, ComponentMask (), 0, 0,
Modified: trunk/aspire/source/mesh_refinement/thermal_energy_density.cc
===================================================================
--- trunk/aspire/source/mesh_refinement/thermal_energy_density.cc 2013-09-30 17:56:36 UTC (rev 1929)
+++ trunk/aspire/source/mesh_refinement/thermal_energy_density.cc 2013-10-01 17:20:34 UTC (rev 1930)
@@ -46,23 +46,19 @@
// (because quadrature points and temperature dofs are,
// by design of the quadrature formula, numbered in the
// same way)
- LinearAlgebra::Vector vec_distributed (this->introspection ().index_sets.temperature_partitioning,
+ LinearAlgebra::Vector vec_distributed (this->introspection ().index_sets.advection_partitioning,
this->get_mpi_communicator ());
- const Quadrature<dim> quadrature (this->get_fe_temperature ().get_unit_support_points ());
- std::vector<types::global_dof_index> local_dof_indices (this->get_fe_temperature ().dofs_per_cell);
+ const Quadrature<dim> quadrature (this->get_fe_advection ().get_unit_support_points ());
+ std::vector<types::global_dof_index> local_dof_indices (this->get_fe_advection ().dofs_per_cell);
FEValues<dim> fe_values_velocity (this->get_mapping (),
this->get_fe_velocity (),
quadrature,
update_values);
- FEValues<dim> fe_values_temperature (this->get_mapping (),
- this->get_fe_temperature (),
- quadrature,
- update_quadrature_points | update_values);
- FEValues<dim> fe_values_composition (this->get_mapping (),
- this->get_fe_composition (),
- quadrature,
- update_values);
+ FEValues<dim> fe_values_advection (this->get_mapping (),
+ this->get_fe_advection (),
+ quadrature,
+ update_quadrature_points | update_values);
std::vector<double> pressure_values(quadrature.size());
std::vector<double> temperature_values(quadrature.size());
@@ -78,25 +74,23 @@
typename DoFHandler<dim>::active_cell_iterator
cell_velocity = this->get_dof_handler_velocity ().begin_active (),
- cell_temperature = this->get_dof_handler_temperature ().begin_active (),
- cell_composition = this->get_dof_handler_composition ().begin_active (),
- endc = this->get_dof_handler_temperature ().end ();
- for (; cell_temperature != endc; ++cell_velocity, ++cell_temperature, ++cell_composition)
- if (cell_temperature->is_locally_owned ())
+ cell_advection = this->get_dof_handler_advection ().begin_active (),
+ endc = this->get_dof_handler_advection ().end ();
+ for (; cell_advection != endc; ++cell_velocity, ++cell_advection)
+ if (cell_advection->is_locally_owned ())
{
fe_values_velocity.reinit (cell_velocity);
fe_values_velocity[this->introspection().extractors.pressure].get_function_values (this->get_solution_velocity (),
pressure_values);
- fe_values_temperature.reinit (cell_temperature);
- fe_values_temperature.get_function_values (this->get_solution_temperature (), temperature_values);
- fe_values_composition.reinit (cell_composition);
+ fe_values_advection.reinit (cell_advection);
+ fe_values_advection.get_function_values (this->get_solution_temperature (), temperature_values);
for (unsigned int c=0; c<this->n_compositional_fields(); ++c)
- fe_values_composition.get_function_values (this->get_solution_composition ().block (c),
- prelim_composition_values[c]);
+ fe_values_advection.get_function_values (this->get_solution_composition ().block (c),
+ prelim_composition_values[c]);
- cell_temperature->get_dof_indices (local_dof_indices);
- in.position = fe_values_temperature.get_quadrature_points ();
+ cell_advection->get_dof_indices (local_dof_indices);
+ in.position = fe_values_advection.get_quadrature_points ();
in.strain_rate.resize(0);// we are not reading the viscosity
for (unsigned int i=0;i<quadrature.size();++i)
{
@@ -110,19 +104,19 @@
// for each temperature dof, write into the output
// vector the density. note that quadrature points and
// dofs are enumerated in the same order
- for (unsigned int i = 0; i < this->get_fe_temperature ().dofs_per_cell; ++i)
+ for (unsigned int i = 0; i < this->get_fe_advection ().dofs_per_cell; ++i)
vec_distributed (local_dof_indices[i])
= out.densities[i] * temperature_values[i] * out.specific_heat[i];
}
// now create a vector with the requisite ghost elements
// and use it for estimating the gradients
- LinearAlgebra::Vector vec (this->introspection ().index_sets.temperature_relevant_set,
+ LinearAlgebra::Vector vec (this->introspection ().index_sets.advection_relevant_set,
this->get_mpi_communicator ());
vec = vec_distributed;
DerivativeApproximation::approximate_gradient (this->get_mapping (),
- this->get_dof_handler_temperature (),
+ this->get_dof_handler_advection (),
vec, indicators);
// Scale gradient in each cell with the correct power of h. Otherwise,
@@ -134,8 +128,8 @@
const double power = 1.5;
{
typename DoFHandler<dim>::active_cell_iterator
- cell = this->get_dof_handler_temperature ().begin_active (),
- endc = this->get_dof_handler_temperature ().end ();
+ cell = this->get_dof_handler_advection ().begin_active (),
+ endc = this->get_dof_handler_advection ().end ();
unsigned int i=0;
for (; cell!=endc; ++cell, ++i)
if (cell->is_locally_owned())
Modified: trunk/aspire/source/postprocess/composition_statistics.cc
===================================================================
--- trunk/aspire/source/postprocess/composition_statistics.cc 2013-09-30 17:56:36 UTC (rev 1929)
+++ trunk/aspire/source/postprocess/composition_statistics.cc 2013-10-01 17:20:34 UTC (rev 1930)
@@ -44,11 +44,11 @@
// 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
- const QGauss<dim> quadrature_formula (this->get_fe_composition ().degree + 1);
+ const QGauss<dim> quadrature_formula (this->get_fe_advection ().degree + 1);
const unsigned int n_q_points = quadrature_formula.size();
FEValues<dim> fe_values (this->get_mapping (),
- this->get_fe_composition (),
+ this->get_fe_advection (),
quadrature_formula,
update_values |
update_quadrature_points |
@@ -57,8 +57,8 @@
std::vector<double> compositional_values(n_q_points);
typename DoFHandler<dim>::active_cell_iterator
- cell = this->get_dof_handler_composition ().begin_active (),
- endc = this->get_dof_handler_composition ().end ();
+ cell = this->get_dof_handler_advection ().begin_active (),
+ endc = this->get_dof_handler_advection ().end ();
std::vector<double> local_compositional_integrals (this->n_compositional_fields());
Modified: trunk/aspire/source/postprocess/heat_flux_statistics.cc
===================================================================
--- trunk/aspire/source/postprocess/heat_flux_statistics.cc 2013-09-30 17:56:36 UTC (rev 1929)
+++ trunk/aspire/source/postprocess/heat_flux_statistics.cc 2013-10-01 17:20:34 UTC (rev 1930)
@@ -39,20 +39,17 @@
// 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
- const QGauss<dim-1> quadrature_formula (this->get_fe_temperature ().degree + 1);
+ const QGauss<dim-1> quadrature_formula (this->get_fe_advection ().degree + 1);
FEFaceValues<dim> fe_face_values_velocity (this->get_mapping (),
this->get_fe_velocity (),
quadrature_formula, update_values);
- FEFaceValues<dim> fe_face_values_temperature (this->get_mapping (),
- this->get_fe_temperature (),
- quadrature_formula,
- update_gradients | update_values |
- update_normal_vectors |
- update_q_points | update_JxW_values);
- FEFaceValues<dim> fe_face_values_composition (this->get_mapping (),
- this->get_fe_composition (),
- quadrature_formula, update_values);
+ FEFaceValues<dim> fe_face_values_advection (this->get_mapping (),
+ this->get_fe_advection (),
+ quadrature_formula,
+ update_gradients | update_values |
+ update_normal_vectors |
+ update_q_points | update_JxW_values);
std::vector<Tensor<1,dim> > temperature_gradients (quadrature_formula.size());
std::vector<std::vector<double> > composition_values (this->n_compositional_fields(),std::vector<double> (quadrature_formula.size()));
@@ -61,13 +58,12 @@
typename DoFHandler<dim>::active_cell_iterator
cell_velocity = this->get_dof_handler_velocity ().begin_active (),
- cell_temperature = this->get_dof_handler_temperature ().begin_active (),
- cell_composition = this->get_dof_handler_composition ().begin_active (),
- endc = this->get_dof_handler_temperature ().end ();
+ cell_advection = this->get_dof_handler_advection ().begin_active (),
+ endc = this->get_dof_handler_advection ().end ();
- typename MaterialModel::Interface<dim>::MaterialModelInputs in (fe_face_values_temperature.n_quadrature_points,
+ typename MaterialModel::Interface<dim>::MaterialModelInputs in (fe_face_values_advection.n_quadrature_points,
this->n_compositional_fields ());
- typename MaterialModel::Interface<dim>::MaterialModelOutputs out (fe_face_values_temperature.n_quadrature_points,
+ typename MaterialModel::Interface<dim>::MaterialModelOutputs out (fe_face_values_advection.n_quadrature_points,
this->n_compositional_fields ());
// for every surface face on which it makes sense to compute a
@@ -79,25 +75,24 @@
// the normal vector points *into* the core, i.e. we compute the flux
// *out* of the mantle, not into it. we fix this when we add the local
// contribution to the global flux
- for (; cell_temperature != endc; ++cell_velocity, ++cell_temperature, ++cell_composition)
- if (cell_temperature->is_locally_owned ())
+ for (; cell_advection != endc; ++cell_velocity, ++cell_advection)
+ if (cell_advection->is_locally_owned ())
for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
- if (cell_temperature->at_boundary (f))
+ if (cell_advection->at_boundary (f))
{
- fe_face_values_temperature.reinit (cell_temperature, f);
- fe_face_values_temperature.get_function_gradients (this->get_solution_temperature (), temperature_gradients);
- fe_face_values_temperature.get_function_values (this->get_solution_temperature (), in.temperature);
+ fe_face_values_advection.reinit (cell_advection, f);
+ fe_face_values_advection.get_function_gradients (this->get_solution_temperature (), temperature_gradients);
+ fe_face_values_advection.get_function_values (this->get_solution_temperature (), in.temperature);
fe_face_values_velocity.reinit (cell_velocity, f);
fe_face_values_velocity[this->introspection ().extractors.pressure].get_function_values (this->get_solution_velocity (),
in.pressure);
- fe_face_values_composition.reinit (cell_composition, f);
for (unsigned int c=0; c<this->n_compositional_fields(); ++c)
- fe_face_values_composition.get_function_values (this->get_solution_composition ().block (c), composition_values[c]);
+ fe_face_values_advection.get_function_values (this->get_solution_composition ().block (c), composition_values[c]);
- in.position = fe_face_values_temperature.get_quadrature_points ();
+ in.position = fe_face_values_advection.get_quadrature_points ();
in.strain_rate.resize(0);// we are not reading the viscosity
- for (unsigned int i = 0; i < fe_face_values_composition.n_quadrature_points; ++i)
+ for (unsigned int i = 0; i < fe_face_values_advection.n_quadrature_points; ++i)
{
for (unsigned int c=0; c<this->n_compositional_fields(); ++c)
in.composition[i][c] = composition_values[c][i];
@@ -107,17 +102,17 @@
double local_normal_flux = 0;
- for (unsigned int q = 0; q < fe_face_values_temperature.n_quadrature_points; ++q)
+ for (unsigned int q = 0; q < fe_face_values_advection.n_quadrature_points; ++q)
{
const double thermal_conductivity
= out.thermal_conductivities[q];
local_normal_flux += -thermal_conductivity
- * (temperature_gradients[q] * fe_face_values_temperature.normal_vector (q))
- * fe_face_values_temperature.JxW (q);
+ * (temperature_gradients[q] * fe_face_values_advection.normal_vector (q))
+ * fe_face_values_advection.JxW (q);
}
- local_boundary_fluxes[cell_temperature->face (f)->boundary_indicator ()]
+ local_boundary_fluxes[cell_advection->face (f)->boundary_indicator ()]
+= local_normal_flux;
}
Modified: trunk/aspire/source/postprocess/temperature_statistics.cc
===================================================================
--- trunk/aspire/source/postprocess/temperature_statistics.cc 2013-09-30 17:56:36 UTC (rev 1929)
+++ trunk/aspire/source/postprocess/temperature_statistics.cc 2013-10-01 17:20:34 UTC (rev 1930)
@@ -41,11 +41,11 @@
// 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
- const QGauss<dim> quadrature_formula (this->get_fe_temperature ().degree + 1);
+ const QGauss<dim> quadrature_formula (this->get_fe_advection ().degree + 1);
const unsigned int n_q_points = quadrature_formula.size();
FEValues<dim> fe_values (this->get_mapping (),
- this->get_fe_temperature (),
+ this->get_fe_advection (),
quadrature_formula,
update_values |
update_quadrature_points |
@@ -54,8 +54,8 @@
std::vector<double> temperature_values(n_q_points);
typename DoFHandler<dim>::active_cell_iterator
- cell = this->get_dof_handler_temperature ().begin_active (),
- endc = this->get_dof_handler_temperature ().end ();
+ cell = this->get_dof_handler_advection ().begin_active (),
+ endc = this->get_dof_handler_advection ().end ();
double local_temperature_integral = 0;
Modified: trunk/aspire/source/postprocess/visualization.cc
===================================================================
--- trunk/aspire/source/postprocess/visualization.cc 2013-09-30 17:56:36 UTC (rev 1929)
+++ trunk/aspire/source/postprocess/visualization.cc 2013-10-01 17:20:34 UTC (rev 1930)
@@ -120,8 +120,7 @@
// create joint DoFHandler
FESystem<dim> fe_system (this->get_fe_velocity (), 1,
- this->get_fe_temperature (), 1,
- this->get_fe_composition (), this->n_compositional_fields ());
+ this->get_fe_advection (), 1 + this->n_compositional_fields ());
DoFHandler<dim> dof_handler (this->get_triangulation ());
dof_handler.distribute_dofs (fe_system);
@@ -147,20 +146,17 @@
std::vector<types::global_dof_index> cell_dof_indices (fe_system.dofs_per_cell);
std::vector<types::global_dof_index> cell_velocity_dof_indices (fe_system.base_element (0).dofs_per_cell);
- std::vector<types::global_dof_index> cell_temperature_dof_indices (fe_system.base_element (1).dofs_per_cell);
- std::vector<types::global_dof_index> cell_composition_dof_indices (fe_system.base_element (2).dofs_per_cell);
+ std::vector<types::global_dof_index> cell_advection_dof_indices (fe_system.base_element (1).dofs_per_cell);
typename DoFHandler<dim>::active_cell_iterator cell = dof_handler.begin_active ();
typename DoFHandler<dim>::active_cell_iterator cell_velocity = this->get_dof_handler_velocity ().begin_active ();
- typename DoFHandler<dim>::active_cell_iterator cell_temperature = this->get_dof_handler_temperature ().begin_active ();
- typename DoFHandler<dim>::active_cell_iterator cell_composition = this->get_dof_handler_composition ().begin_active ();
+ typename DoFHandler<dim>::active_cell_iterator cell_advection = this->get_dof_handler_advection ().begin_active ();
- for (; cell != dof_handler.end (); ++cell, ++cell_velocity, ++cell_temperature, ++cell_composition)
+ for (; cell != dof_handler.end (); ++cell, ++cell_velocity, ++cell_advection)
if (cell->is_locally_owned ())
{
cell->get_dof_indices (cell_dof_indices);
cell_velocity->get_dof_indices (cell_velocity_dof_indices);
- cell_temperature->get_dof_indices (cell_temperature_dof_indices);
- cell_composition->get_dof_indices (cell_composition_dof_indices);
+ cell_advection->get_dof_indices (cell_advection_dof_indices);
for (unsigned int i = 0; i < fe_system.dofs_per_cell; ++i)
{
@@ -177,14 +173,14 @@
case 1:
{
- solution (cell_dof_indices[i]) = solution_temperature (cell_temperature_dof_indices[system_to_base_index.second]);
+ solution (cell_dof_indices[i]) = solution_temperature (cell_advection_dof_indices[system_to_base_index.second]);
break;
}
case 2:
{
solution (cell_dof_indices[i])
- = solution_composition.block (system_to_base_index.first.second) (cell_composition_dof_indices[system_to_base_index.second]);
+ = solution_composition.block (system_to_base_index.first.second - 1) (cell_advection_dof_indices[system_to_base_index.second]);
break;
}
}
Modified: trunk/aspire/source/simulator/assembly.cc
===================================================================
--- trunk/aspire/source/simulator/assembly.cc 2013-09-30 17:56:36 UTC (rev 1929)
+++ trunk/aspire/source/simulator/assembly.cc 2013-10-01 17:20:34 UTC (rev 1930)
@@ -47,20 +47,17 @@
struct StokesSystem
{
StokesSystem (const FiniteElement<dim> &fe_velocity,
- const FiniteElement<dim> &fe_temperature,
- const FiniteElement<dim> &fe_composition,
+ const FiniteElement<dim> &fe_advection,
const Mapping<dim> &mapping,
const Quadrature<dim> &quadrature,
const UpdateFlags update_flags_velocity,
- const UpdateFlags update_flags_temperature,
- const UpdateFlags update_flags_composition,
+ const UpdateFlags update_flags_advection,
const unsigned int n_compositional_fields);
StokesSystem (const StokesSystem<dim> &data);
FEValues<dim> fe_values_velocity;
- FEValues<dim> fe_values_temperature;
- FEValues<dim> fe_values_composition;
+ FEValues<dim> fe_values_advection;
std::vector<double> phi_p;
std::vector<Tensor<1,dim> > phi_u;
@@ -84,21 +81,17 @@
template <int dim>
StokesSystem<dim>::
StokesSystem (const FiniteElement<dim> &fe_velocity,
- const FiniteElement<dim> &fe_temperature,
- const FiniteElement<dim> &fe_composition,
+ const FiniteElement<dim> &fe_advection,
const Mapping<dim> &mapping,
const Quadrature<dim> &quadrature,
const UpdateFlags update_flags_velocity,
- const UpdateFlags update_flags_temperature,
- const UpdateFlags update_flags_composition,
+ const UpdateFlags update_flags_advection,
const unsigned int n_compositional_fields)
:
fe_values_velocity (mapping, fe_velocity, quadrature,
update_flags_velocity),
- fe_values_temperature (mapping, fe_temperature, quadrature,
- update_flags_temperature),
- fe_values_composition (mapping, fe_composition, quadrature,
- update_flags_composition),
+ fe_values_advection (mapping, fe_advection, quadrature,
+ update_flags_advection),
phi_p (fe_velocity.dofs_per_cell),
phi_u (fe_velocity.dofs_per_cell),
symmetric_grads_phi_u (fe_velocity.dofs_per_cell),
@@ -127,14 +120,10 @@
scratch.fe_values_velocity.get_fe (),
scratch.fe_values_velocity.get_quadrature (),
scratch.fe_values_velocity.get_update_flags ()),
- fe_values_temperature (scratch.fe_values_temperature.get_mapping (),
- scratch.fe_values_temperature.get_fe (),
- scratch.fe_values_temperature.get_quadrature (),
- scratch.fe_values_temperature.get_update_flags ()),
- fe_values_composition (scratch.fe_values_composition.get_mapping (),
- scratch.fe_values_composition.get_fe (),
- scratch.fe_values_composition.get_quadrature (),
- scratch.fe_values_composition.get_update_flags ()),
+ fe_values_advection (scratch.fe_values_advection.get_mapping (),
+ scratch.fe_values_advection.get_fe (),
+ scratch.fe_values_advection.get_quadrature (),
+ scratch.fe_values_advection.get_update_flags ()),
phi_p (scratch.phi_p),
phi_u (scratch.phi_u),
symmetric_grads_phi_u (scratch.symmetric_grads_phi_u),
@@ -155,16 +144,14 @@
struct TemperatureSystem
{
TemperatureSystem (const FiniteElement<dim> &fe_velocity,
- const FiniteElement<dim> &fe_temperature,
- const FiniteElement<dim> &fe_composition,
+ const FiniteElement<dim> &fe_advection,
const Mapping<dim> &mapping,
const Quadrature<dim> &quadrature,
const unsigned int n_compositional_fields);
TemperatureSystem (const TemperatureSystem &data);
FEValues<dim> fe_values_velocity;
- FEValues<dim> fe_values_temperature;
- FEValues<dim> fe_values_composition;
+ FEValues<dim> fe_values_advection;
std::vector<double> phi_field;
std::vector<Tensor<1,dim> > grad_phi_field;
@@ -187,16 +174,14 @@
struct CompositionSystem
{
CompositionSystem (const FiniteElement<dim> &fe_velocity,
- const FiniteElement<dim> &fe_temperature,
- const FiniteElement<dim> &fe_composition,
+ const FiniteElement<dim> &fe_advection,
const Mapping<dim> &mapping,
const Quadrature<dim> &quadrature,
const unsigned int n_compositional_fields);
CompositionSystem (const CompositionSystem &data);
FEValues<dim> fe_values_velocity;
- FEValues<dim> fe_values_temperature;
- FEValues<dim> fe_values_composition;
+ FEValues<dim> fe_values_advection;
std::vector<double> phi_field;
std::vector<Tensor<1,dim> > grad_phi_field;
@@ -218,8 +203,7 @@
template <int dim>
TemperatureSystem<dim>::
TemperatureSystem (const FiniteElement<dim> &fe_velocity,
- const FiniteElement<dim> &fe_temperature,
- const FiniteElement<dim> &fe_composition,
+ const FiniteElement<dim> &fe_advection,
const Mapping<dim> &mapping,
const Quadrature<dim> &quadrature,
const unsigned int n_compositional_fields)
@@ -228,16 +212,13 @@
fe_velocity, quadrature,
update_values | update_gradients |
update_quadrature_points),
- fe_values_temperature (mapping,
- fe_temperature, quadrature,
- update_gradients | update_JxW_values |
- update_quadrature_points | update_values),
- fe_values_composition (mapping,
- fe_composition, quadrature,
- update_values),
+ fe_values_advection (mapping,
+ fe_advection, quadrature,
+ update_gradients | update_JxW_values |
+ update_quadrature_points | update_values),
- phi_field (fe_temperature.dofs_per_cell),
- grad_phi_field (fe_temperature.dofs_per_cell),
+ phi_field (fe_advection.dofs_per_cell),
+ grad_phi_field (fe_advection.dofs_per_cell),
old_temperature_values (quadrature.size()),
old_old_temperature_values(quadrature.size()),
current_temperature_values(quadrature.size()),
@@ -253,8 +234,7 @@
template <int dim>
CompositionSystem<dim>::
CompositionSystem (const FiniteElement<dim> &fe_velocity,
- const FiniteElement<dim> &fe_temperature,
- const FiniteElement<dim> &fe_composition,
+ const FiniteElement<dim> &fe_advection,
const Mapping<dim> &mapping,
const Quadrature<dim> &quadrature,
const unsigned int n_compositional_fields)
@@ -263,16 +243,13 @@
fe_velocity, quadrature,
update_values | update_gradients |
update_quadrature_points),
- fe_values_temperature (mapping,
- fe_temperature, quadrature,
- update_values),
- fe_values_composition (mapping,
- fe_composition, quadrature,
- update_gradients | update_JxW_values |
- update_quadrature_points | update_values),
+ fe_values_advection (mapping,
+ fe_advection, quadrature,
+ update_gradients | update_JxW_values |
+ update_quadrature_points | update_values),
- phi_field (fe_composition.dofs_per_cell),
- grad_phi_field (fe_composition.dofs_per_cell),
+ phi_field (fe_advection.dofs_per_cell),
+ grad_phi_field (fe_advection.dofs_per_cell),
old_composition_values (n_compositional_fields, std::vector<double> (quadrature.size ())),
old_old_composition_values(quadrature.size ()),
current_velocity_values(quadrature.size()),
@@ -294,14 +271,10 @@
scratch.fe_values_velocity.get_fe(),
scratch.fe_values_velocity.get_quadrature(),
scratch.fe_values_velocity.get_update_flags()),
- fe_values_temperature (scratch.fe_values_temperature.get_mapping(),
- scratch.fe_values_temperature.get_fe(),
- scratch.fe_values_temperature.get_quadrature(),
- scratch.fe_values_temperature.get_update_flags()),
- fe_values_composition (scratch.fe_values_composition.get_mapping(),
- scratch.fe_values_composition.get_fe(),
- scratch.fe_values_composition.get_quadrature(),
- scratch.fe_values_composition.get_update_flags()),
+ fe_values_advection (scratch.fe_values_advection.get_mapping(),
+ scratch.fe_values_advection.get_fe(),
+ scratch.fe_values_advection.get_quadrature(),
+ scratch.fe_values_advection.get_update_flags()),
phi_field (scratch.phi_field),
grad_phi_field (scratch.grad_phi_field),
@@ -324,14 +297,10 @@
scratch.fe_values_velocity.get_fe(),
scratch.fe_values_velocity.get_quadrature(),
scratch.fe_values_velocity.get_update_flags()),
- fe_values_temperature (scratch.fe_values_temperature.get_mapping(),
- scratch.fe_values_temperature.get_fe(),
- scratch.fe_values_temperature.get_quadrature(),
- scratch.fe_values_temperature.get_update_flags()),
- fe_values_composition (scratch.fe_values_composition.get_mapping(),
- scratch.fe_values_composition.get_fe(),
- scratch.fe_values_composition.get_quadrature(),
- scratch.fe_values_composition.get_update_flags()),
+ fe_values_advection (scratch.fe_values_advection.get_mapping(),
+ scratch.fe_values_advection.get_fe(),
+ scratch.fe_values_advection.get_quadrature(),
+ scratch.fe_values_advection.get_update_flags()),
phi_field (scratch.phi_field),
grad_phi_field (scratch.grad_phi_field),
@@ -531,9 +500,9 @@
// record maximal entropy on Gauss quadrature
// points
- const QGauss<dim> quadrature_formula (parameters.temperature_degree+1);
+ const QGauss<dim> quadrature_formula (parameters.advection_degree + 1);
const unsigned int n_q_points = quadrature_formula.size();
- FEValues<dim> fe_values (fe_temperature, quadrature_formula,
+ FEValues<dim> fe_values (fe_advection, quadrature_formula,
update_values | update_JxW_values);
std::vector<double> old_field_values(n_q_points);
std::vector<double> old_old_field_values(n_q_points);
@@ -548,8 +517,8 @@
// integral over the entropy as well as the area and the
// maximal and minimal entropy
typename DoFHandler<dim>::active_cell_iterator
- cell = dof_handler_temperature.begin_active(),
- endc = dof_handler_temperature.end();
+ cell = dof_handler_advection.begin_active (),
+ endc = dof_handler_advection.end ();
for (; cell!=endc; ++cell)
if (cell->is_locally_owned())
{
@@ -610,10 +579,10 @@
// record maximal entropy on Gauss quadrature
// points
- const QGauss<dim> quadrature_formula (parameters.temperature_degree+1);
+ const QGauss<dim> quadrature_formula (parameters.advection_degree + 1);
const unsigned int n_q_points = quadrature_formula.size();
- FEValues<dim> fe_values (fe_composition, quadrature_formula,
+ FEValues<dim> fe_values (fe_advection, quadrature_formula,
update_values | update_JxW_values);
std::vector<double> old_field_values(n_q_points);
std::vector<double> old_old_field_values(n_q_points);
@@ -628,8 +597,8 @@
// integral over the entropy as well as the area and the
// maximal and minimal entropy
typename DoFHandler<dim>::active_cell_iterator
- cell = dof_handler_composition.begin_active(),
- endc = dof_handler_composition.end();
+ cell = dof_handler_advection.begin_active (),
+ endc = dof_handler_advection.end ();
for (; cell!=endc; ++cell)
if (cell->is_locally_owned())
{
@@ -682,15 +651,14 @@
const TrilinosWrappers::MPI::Vector &input_solution_temperature,
const TrilinosWrappers::MPI::BlockVector &input_solution_composition,
const FEValues<dim> &input_fe_values_velocity,
- const FEValues<dim> &input_fe_values_temperature,
- const FEValues<dim> &input_fe_values_composition,
+ const FEValues<dim> &input_fe_values_advection,
typename MaterialModel::Interface<dim>::MaterialModelInputs &material_model_inputs) const
{
const unsigned int n_q_points = material_model_inputs.temperature.size ();
for (unsigned int q=0; q<n_q_points; ++q)
material_model_inputs.position[q] = input_fe_values_velocity.quadrature_point(q);
- input_fe_values_temperature.get_function_values (input_solution_temperature, material_model_inputs.temperature);
+ input_fe_values_advection.get_function_values (input_solution_temperature, material_model_inputs.temperature);
input_fe_values_velocity[introspection.extractors.pressure].get_function_values (input_solution_velocity,
material_model_inputs.pressure);
input_fe_values_velocity[introspection.extractors.velocities].get_function_symmetric_gradients (input_solution_velocity,
@@ -702,8 +670,8 @@
std::vector<double> (n_q_points));
for (unsigned int c=0; c<parameters.n_compositional_fields; ++c)
- input_fe_values_composition.get_function_values(input_solution_composition.block (c),
- composition_values[c]);
+ input_fe_values_advection.get_function_values(input_solution_composition.block (c),
+ composition_values[c]);
// then we copy these values to exchange the inner and outer vector, because for the material
// model we need a vector with values of all the compositional fields for every quadrature point
@@ -767,7 +735,6 @@
void
Simulator<dim>::
local_assemble_stokes_system (const SynchronousIterators<std_cxx1x::tuple<FilteredIterator<typename DoFHandler<dim>::active_cell_iterator>,
- FilteredIterator<typename DoFHandler<dim>::active_cell_iterator>,
FilteredIterator<typename DoFHandler<dim>::active_cell_iterator> > > &cell,
internal::Assembly::Scratch::StokesSystem<dim> &scratch,
internal::Assembly::CopyData::StokesSystem<dim> &data)
@@ -776,8 +743,7 @@
const unsigned int n_q_points = scratch.fe_values_velocity.n_quadrature_points;
scratch.fe_values_velocity.reinit (std_cxx1x::get<0> (cell.iterators));
- scratch.fe_values_temperature.reinit (std_cxx1x::get<1> (cell.iterators));
- scratch.fe_values_composition.reinit (std_cxx1x::get<2> (cell.iterators));
+ scratch.fe_values_advection.reinit (std_cxx1x::get<1> (cell.iterators));
data.local_matrix = 0;
data.local_rhs = 0;
@@ -791,8 +757,7 @@
current_linearization_point_temperature,
current_linearization_point_composition,
scratch.fe_values_velocity,
- scratch.fe_values_temperature,
- scratch.fe_values_composition,
+ scratch.fe_values_advection,
scratch.material_model_inputs);
material_model->evaluate(scratch.material_model_inputs,scratch.material_model_outputs);
@@ -805,17 +770,17 @@
scratch.velocity_values);
scratch.fe_values_velocity[introspection.extractors.velocities].get_function_values (old_solution_velocity,
scratch.old_velocity_values);
- scratch.fe_values_temperature.get_function_gradients (current_linearization_point_temperature,
- scratch.temperature_gradients);
- scratch.fe_values_temperature.get_function_values (current_linearization_point_temperature,
- scratch.temperature_values);
+ scratch.fe_values_advection.get_function_gradients (current_linearization_point_temperature,
+ scratch.temperature_gradients);
+ scratch.fe_values_advection.get_function_values (current_linearization_point_temperature,
+ scratch.temperature_values);
for (unsigned int n = 0; n < parameters.n_compositional_fields; ++n)
{
- scratch.fe_values_composition.get_function_gradients (current_linearization_point_composition.block (n),
- scratch.composition_gradients[n]);
- scratch.fe_values_composition.get_function_values (current_linearization_point_composition.block (n),
- scratch.composition_values[n]);
+ scratch.fe_values_advection.get_function_gradients (current_linearization_point_composition.block (n),
+ scratch.composition_gradients[n]);
+ scratch.fe_values_advection.get_function_values (current_linearization_point_composition.block (n),
+ scratch.composition_values[n]);
}
for (unsigned int q=0; q<n_q_points; ++q)
@@ -914,27 +879,20 @@
FilteredIterator<typename DoFHandler<dim>::active_cell_iterator>
cell_filter_velocity_begin (IteratorFilters::LocallyOwnedCell (), dof_handler_velocity.begin_active ());
FilteredIterator<typename DoFHandler<dim>::active_cell_iterator>
- cell_filter_temperature_begin (IteratorFilters::LocallyOwnedCell (), dof_handler_temperature.begin_active ());
- FilteredIterator<typename DoFHandler<dim>::active_cell_iterator>
- cell_filter_composition_begin (IteratorFilters::LocallyOwnedCell (), dof_handler_composition.begin_active ());
+ cell_filter_advection_begin (IteratorFilters::LocallyOwnedCell (), dof_handler_advection.begin_active ());
typedef std_cxx1x::tuple<FilteredIterator<typename DoFHandler<dim>::active_cell_iterator>,
- FilteredIterator<typename DoFHandler<dim>::active_cell_iterator>,
FilteredIterator<typename DoFHandler<dim>::active_cell_iterator> >
- iterators_triple;
- SynchronousIterators<iterators_triple>
More information about the CIG-COMMITS
mailing list