--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
cell->set_refine_flag ();
cell->set_refine_flag (RefinementCase::cut_y);
/Users/kimjaekwang/Programs/dealii/examples/step-1/step-1.cc:79:42: error:
'RefinementCase' is not a class, namespace, or enumeration
cell->set_refine_flag (RefinementCase::cut_y);
^
/Users/kimjaekwang/Programs/dealii/include/deal.II/base/geometry_info.h:293:7: note:
'RefinementCase' declared here
class RefinementCase : public RefinementPossibilities<dim>
template <int dim>
void
StokesProblem<dim>::refine_mesh (const unsigned int refinement_cycle, double max_shear)
//AMR based on Cellwise Shear-rate
{
GridRefinement::refine_and_coarsen_fixed_number (triangulation,
cellwise_shear_rate,
0.1, 0.0); //Here I marked what cells to be refined
set_anisotropic_flags();//and I called additional function to set anisotropic direction.
SolutionTransfer<dim,BlockVector<double>> solution_transfer(dof_handler);
//Prepare Solution Transfer for Block vector solution
//This one is problematic
triangulation.prepare_coarsening_and_refinement ();
solution_transfer.prepare_for_coarsening_and_refinement(solution);
triangulation.execute_coarsening_and_refinement ();
dof_handler.distribute_dofs (fe);
DoFRenumbering::Cuthill_McKee (dof_handler);
std::vector<unsigned int> block_component (dim+1,0);
block_component[dim] = 1;
DoFRenumbering::component_wise (dof_handler, block_component);
triangulation.execute_coarsening_and_refinement ();
std::vector<types::global_dof_index> dofs_per_block (2);
DoFTools::count_dofs_per_block (dof_handler, dofs_per_block, block_component);
const unsigned int n_u = dofs_per_block[0], n_p = dofs_per_block[1];
// save new space for previous solution
previous_solution.reinit (2);
previous_solution.block(0).reinit (n_u);
previous_solution.block(1).reinit (n_p);
previous_solution.collect_sizes ();
//Transfer solution
solution_transfer.interpolate(solution, previous_solution);
}
After that, I am trying to setting one direction to be refined. cut_x, cut_y, or cut_xy
template <int dim>
void
StokesProblem<dim>::set_anisotropic_flags ()
{
typename DoFHandler<dim>::active_cell_iterator cell=dof_handler.begin_active()
,endc=dof_handler.end();
for (; cell!=endc; ++cell)
{
if (cell->refine_flag_set())
{
//For a just test case, I am trying to cut in one direction ,x y
//std::cout <<" Now just pass"<<std::endl;
Case1 // cell->set_refine_flag(RefinementCase<dim>::cut_x);
Case2 // cell->set_refine_flag(RefinementCase<dim>::cut_y);
cell->set_refine_flag(RefinementCase<dim>::cut_xy); //For this case, the cell will be just cut as isotropy refinement
}
}
}
Among three cases, the code is one working with "cell->set_refine_flag(RefinementCase<dim>::cut_xy);"
When I try to refine my cells only in x or y direction, I just receives error as follow...
cell->set_refine_flag(RefinementCase<dim>::cut_x);
cell->set_refine_flag(RefinementCase<dim>::cut_y);
especially this error has occurred when code is running the line " triangulation.prepare_coarsening_and_refinement () "... in refinement function..
Do you have any ideas what might be a possible problem ?
An error occurred in line <12146> of file </Users/kimjaekwang/dealii-8.4.1/source/grid/tria.cc> in function
void dealii::(anonymous namespace)::possibly_refine_unrefined_island(const typename Triangulation<dim, spacedim>::cell_iterator &, const bool) [dim = 2, spacedim = 2]
The violated condition was:
cell->refine_flag_set() == false
The name and call sequence of the exception was:
ExcInternalError()
Additional Information:
This exception -- which is used in many places in the library -- usually indicates that some condition which the author of the code thought must be satisfied at a certain point in an algorithm, is not fulfilled. An example would be that the first part of an algorithm sorts elements of an array in ascending order, and a second part of the algorithm later encounters an an element that is not larger than the previous one.
There is usually not very much you can do if you encounter such an exception since it indicates an error in deal.II, not in your own program. Try to come up with the smallest possible program that still demonstrates the error and contact the deal.II mailing lists with it to obtain help.
template <int dim>
Step5<dim>::Step5 () :
triangulation (Triangulation<dim>::maximum_smoothing), //If I don't have this line, the code works well with anisotropy refinement.
However, if I use Maximum_smoothing for my triangulation, I run into same error message.
fe (1),
dof_handler (triangulation)
{}