Dear all,
I am fairly new to deal.ii and have a question concerning the
MappingQ-class of deal.ii
Why do I have to initialize the private mapping member of type
MappingQ<dim> to get a compilable code? To illustrated what I mean, I did
thin out the step-11 tutorial in the following way:
#include <deal.II/grid/tria.h>
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/dofs/dof_tools.h>
#include <deal.II/fe/fe_q.h>
#include <deal.II/fe/mapping_q.h>
#include <deal.II/numerics/vector_tools.h>
using namespace dealii;
template <int dim>
class LaplaceProblem{
public:
LaplaceProblem(const unsigned int mapping_degree,
const unsigned int fe_degree=1);
void run();
private:
Triangulation<dim> triangulation;
const unsigned int fe_degree;
FE_Q<dim> fe;
DoFHandler<dim> dof_handler;
MappingQ<dim> mapping;
unsigned int test;
};
template <int dim>
LaplaceProblem<dim>::LaplaceProblem(const unsigned int mapping_degree,
const unsigned int fe_degree)
: fe_degree(fe_degree)
, fe(fe_degree)
, dof_handler(triangulation)
// , mapping(mapping_degree)
{
}
template <int dim>
void LaplaceProblem<dim>::run(){
}
int main(){
const unsigned int mapping_degree=2;
LaplaceProblem<2>(mapping_degree).run();
}
Only if I uncomment line 30 of my code (// , mapping(mapping_degree)) the
program compiles. Why is that? In my understanding, the program should
compile just fine without the initialization of the mapping member variable
since there is no requirement of initializing member variables upon
constructing an object, is would be the case for my member variable unsigned
int test .
I would be grateful for any explanation.
Many thanks in advance.
--
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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/dealii/92911e1a-8ca1-425f-a859-9b5a6e877b4dn%40googlegroups.com.