Hello,
I am trying to write a code to calculate buoyancy force which is the
product of temperature and gravity. In my case temperature is available.
TrilinosWrappers::MPI::Vector temperature ;//given
const dealii::Point<dim> gravity = -( (dim == 2) ? (dealii::Point<dim> (0,
1)) :
(dealii::Point<dim> (0,0,1)) );
TrilinosWrappers::MPI::Vector& Buoyancy_force = constant * temperature *
gravity ; //This is what i want to do
//below is the idea that i am not sure of
typename DoFHandler<dim>::active_cell_iterator
cell = fe_velocity_space.dh_begin_active(),
endc = fe_velocity_space.dh_end(),
cell_t = fe_temp_space.dh_begin_active();
for (; cell != endc; ++cell, ++cell_t) {
if (cell->is_locally_owned() == false)
continue;
b = 0;
fe_velocity_values.reinit(cell);
fe_temp_values.reinit(cell_t);
const FEValuesViews::Vector<dim>& fe_vector_values =
fe_velocity_values[FEValuesExtractors::Vector(0)];
fe_temp_values.get_function_values(temperature, temp_cell);
double Beta = 0.04;
for (unsigned int q=0; q<nqcell; ++q){
const double& temp_q = temp_cell[q];
const Tensor<1, dim> force = - Beta *(temp_q)*fe_values.JxW(
q)*gravity ;
//Need help here
cell->get_dof_indices(dof_indices);
fe_velocity_space.get_constraints().distribute_local_to_global(b
, dof_indices, buoyancy_force);
}
Thank you
Pankaj
--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see
https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.