Hi all,
I am interested in solving vector valued pdes on 2d surfaces embedded in 3d
space.
More specifically the vectors lie in the tangent space, such that they only
have 2 components rather than 3.
Here I have a few questions:
1. Say I want to visualize the solution, i would expect that i have to
somehow use the mapping from the reference cell to the real cell to obtain
the solution vector (that is tangent to the surface) as a <1,3> Tensor.
What is the canonical way of doing so?
Attached I have a mimimum example of how I tried to do this using the
DataOut<dim, DoFHandler<dim, spacedim> class, which fails if i set the
FESystem to have only 2 components. It fails at the call DataOut<dim,
DoFHandler<dim, spacedim>>::build_patches(mapping) with the following error:
An error occurred in line <1240> of file
</home/justin/PDE/dealii-8.5.0/source/numerics/data_out_dof_data.cc> in
function
std::vector<std::tuple<unsigned int, unsigned int,
std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >
dealii::DataOut_DoFData<DoFHandlerType, patch_dim,
patch_space_dim>::get_vector_data_ranges() const [with DoFHandlerType =
dealii::DoFHandler<2, 3>; int patch_dim = 2; int patch_space_dim = 3]
The violated condition was:
i+patch_space_dim <= (*d)->n_output_variables
Additional information:
When declaring that a number of components in a data set to be output
logically form a vector instead of simply a set of scalar fields, you need
to specify this for all relevant components. Furthermore, vectors must
always consist of exactly <dim> components. However, the vector component
at position 0 with name <test> does not satisfy these conditions.
2. Is it actually a good idea to represent a solution vector that should be
tangent to the surface with a 2-dimensional finite element or should one
rather use a 3-dim finite element and enforce the constraint that the
vector lies in the tangent plane on every element using the facilities of
the constraint matrix for every element?
I have read "Tools for the Solution of PDEs Defined on Curved Manifolds
with the deal.II Library" by Antonio DeSimone, Luca Heltai and Cataldo
Manigrasso and the step-34 tutorial but in both publications only scalar
problems are considered. It would probably also be very helpful to me if
somebody could point me towards some publication discussing a vector valued
problem on a codimension one manifold - if at all possible, I have not
found anything helpful sofar.
Thanks and regards,
Justin
--
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.
#include <deal.II/grid/tria.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/manifold_lib.h>
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/lac/vector.h>
#include <deal.II/fe/fe_q.h>
#include <deal.II/fe/fe_system.h>
#include <deal.II/fe/mapping_q.h>
#include <deal.II/numerics/data_out.h>
#include <deal.II/numerics/data_component_interpretation.h>
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
using namespace dealii;
const unsigned int spacedim=3;
const unsigned int dim=spacedim-1;
int main(){
//generate triangulation
Triangulation<dim,spacedim> triangulation;
const Point<spacedim> center (0,0,0);
const double outer_radius = 1.0;
GridGenerator::hyper_sphere (triangulation,
center, outer_radius);
const SphericalManifold<dim,spacedim> manifold_description(center);
triangulation.set_manifold (0, manifold_description);
triangulation.set_all_manifold_ids(0);
//define finite element, finite element system and mapping
const FE_Q<dim, spacedim> fe(1);
FESystem<dim, spacedim> sys(fe,dim);
MappingQ <dim, spacedim> mapping(3);
//define dofhandler
DoFHandler<dim, spacedim> dof_handler(triangulation);
dof_handler.distribute_dofs(sys);
//define test vector that should be visualized later
Vector<double> testvec(dof_handler.n_dofs());
for(int i=0; i<dof_handler.n_dofs(); i++){
testvec[i]=1;
}
std::ofstream out ("test.vtk");
DataOut<dim, DoFHandler<dim, spacedim>> dataout;
//the data that is being output is a vector with dim components in the tangent space
std::vector<std::string> names( dim, "test");
std::vector<DataComponentInterpretation::DataComponentInterpretation>
data_component_interpretation(dim, DataComponentInterpretation::component_is_part_of_vector);
dataout.attach_dof_handler(dof_handler);
dataout.add_data_vector(testvec, names, DataOut<dim, DoFHandler<dim, spacedim>>::type_dof_data,
data_component_interpretation);
//this is where the program fails - i would have expected the mapping<2,3> to make a <1,3> tensor
//from the 2 components.
dataout.build_patches(mapping, 0, DataOut<dim , DoFHandler<dim, spacedim>>::curved_inner_cells);
dataout.write_vtk(out);
return 0;}