Hello all, I always learning a lot from you.... For my problem, I have to impose different boundary values, so for example if in step- 4, we use class derived from Function<dim> for making boundary condition.
but.. is there any way that I can bring some values from mainclass? to be more specific.... the main class of step 4 is... template <int dim> class Step4 { public: Step4 (); void run (); private: void make_grid (); void setup_system(); void assemble_system (); void solve (); void output_results () const; Triangulation<dim> <http://dealii.org/developer/doxygen/deal.II/classTriangulation.html> triangulation; FE_Q<dim> <http://dealii.org/developer/doxygen/deal.II/classFE__Q.html> fe; DoFHandler<dim> <http://dealii.org/developer/doxygen/deal.II/classDoFHandler.html> dof_handler; SparsityPattern <http://dealii.org/developer/doxygen/deal.II/classSparsityPattern.html> sparsity_pattern; SparseMatrix<double> <http://dealii.org/developer/doxygen/deal.II/classSparseMatrix.html> system_matrix; Vector<double> <http://dealii.org/developer/doxygen/deal.II/classVector.html> solution; Vector<double> <http://dealii.org/developer/doxygen/deal.II/classVector.html> system_rhs; *double u_main = 1; <- If I want to bring this value to Boundary class...* }; template <int dim> class BoundaryValues : public Function<dim> { public: BoundaryValues () : Function<dim>() {} virtual double value (const Point<dim> &p, const unsigned int component = 0) const; }; template <int dim> double BoundaryValues<dim>::value (const Point<dim> &p, const unsigned int /*component*/) const { double u = u_main; *<-obviously, this dose not **work,showing error message that use of undeclared identifier 'u_main'* return } Looking forward to your help!! Thank you Jaekwang Kim -- 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 dealii+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.