Thank you for your reply.
I tried to follow your solution, but I am encountering an error. To what follows, I will post my code and error as well. I will be thankful if you give me a piece of advice to get rid of this error.
As I mentioned, my domain is a linear elastic cube that I am going to impose PBCs on opposite facec.
template <int dim>
void CubeVector<dim>::meshing()
{
const Point<dim> LL(0, 0, 0);
const Point<dim> RH(0.1, 0.1, 0.1);
std::vector<unsigned int> repetition(dim);
repetition[0] = 1;
repetition[1] = 1;
repetition[2] = 1;
GridGenerator::subdivided_hyper_rectangle(triangulation, repetition, LL, RH);
std::string mesh_name = "Rectangle-mesh";
std::ofstream outputmeshfile(mesh_name);
GridOut gridout;
gridout.write_eps(triangulation, outputmeshfile);
std::cout << " Mesh file output to "
<< mesh_name
<< std::endl;
// Boundary indicator // Assign name to every face. This indicators will be used for defining periodic faces.
double Lenght_x = RH[0] - LL[0];
double Lenght_y = RH[1] - LL[1];
double Lenght_z = RH[2] - LL[2];
for (auto& face : triangulation.active_face_iterators()){
if (face->at_boundary())
{
if (face->center()[0] == 0) { face->set_boundary_id(10);}
if (face->center()[0] == Lenght_x) { face->set_boundary_id(11);}
if (face->center()[1] == 0) { face->set_boundary_id(20);}
if (face->center()[1] == Lenght_y) { face->set_boundary_id(21);}
if (face->center()[2] == 0) { face->set_boundary_id(30);}
if (face->center()[2] == Lenght_z) { face->set_boundary_id(31);}
}
}
std::vector<GridTools::PeriodicFacePair<
GridGenerator::Triangulation<dim>::cell_iterator>>
periodicity_vector;
GridTools::collect_periodic_faces(triangulation,
10,
11,
0,
periodicity_vector);
}
/mnt/d/research/deal_ii_projects/3d_elasticity/step-1.cc: In member function ‘void CubeVector<dim>::meshing()’:
/mnt/d/research/deal_ii_projects/3d_elasticity/step-1.cc:179:19: error: ‘Triangulation’ is not a member of ‘dealii::GridGenerator’
179 | GridGenerator::Triangulation<dim>::cell_iterator>>
| ^~~~~~~~~~~~~
/mnt/d/research/deal_ii_projects/3d_elasticity/step-1.cc:179:19: note: suggested alternatives:
In file included from /usr/local/include/deal.II/grid/tria_description.h:23,
from /usr/local/include/deal.II/grid/tria.h:28,
from /mnt/d/research/deal_ii_projects/3d_elasticity/step-1.cc:2:
/usr/local/include/deal.II/grid/cell_id.h:37:7: note: ‘dealii::Triangulation’
37 | class Triangulation;
| ^~~~~~~~~~~~~
In file included from /usr/local/include/deal.II/distributed/tria.h:27,
from /usr/local/include/deal.II/fe/fe_tools.h:30,
from /usr/local/include/deal.II/fe/fe_system.h:28,
from /mnt/d/research/deal_ii_projects/3d_elasticity/step-1.cc:11:
/usr/local/include/deal.II/distributed/tria_base.h:302:9: note: ‘dealii::parallel::Triangulation’
302 | using Triangulation DEAL_II_DEPRECATED = TriangulationBase<dim, spacedim>;
| ^~~~~~~~~~~~~
In file included from /usr/local/include/deal.II/fe/fe_tools.h:30,
from /usr/local/include/deal.II/fe/fe_system.h:28,
from /mnt/d/research/deal_ii_projects/3d_elasticity/step-1.cc:11:
/usr/local/include/deal.II/distributed/tria.h:1403:11: note: ‘dealii::parallel::distributed::Triangulation’
1403 | class Triangulation
| ^~~~~~~~~~~~~
/mnt/d/research/deal_ii_projects/3d_elasticity/step-1.cc:179:36: error: template argument 1 is invalid
179 | GridGenerator::Triangulation<dim>::cell_iterator>>
| ^
/mnt/d/research/deal_ii_projects/3d_elasticity/step-1.cc:179:39: error: template argument 1 is invalid
179 | GridGenerator::Triangulation<dim>::cell_iterator>>
| ^~~~~~~~~~~~~
/mnt/d/research/deal_ii_projects/3d_elasticity/step-1.cc:179:39: error: template argument 2 is invalid
/mnt/d/research/deal_ii_projects/3d_elasticity/step-1.cc:179:52: error: expected unqualified-id before ‘>’ token
179 | GridGenerator::Triangulation<dim>::cell_iterator>>
| ^~
/mnt/d/research/deal_ii_projects/3d_elasticity/step-1.cc:182:14: error: ‘collect_periodic_faces’ is not a member of ‘dealii::GridTools’
182 | GridTools::collect_periodic_faces(triangulation,
| ^~~~~~~~~~~~~~~~~~~~~~
/mnt/d/research/deal_ii_projects/3d_elasticity/step-1.cc:186:4: error: ‘periodicity_vector’ was not declared in this scope
186 | periodicity_vector);
| ^~~~~~~~~~~~~~~~~~
/mnt/d/research/deal_ii_projects/3d_elasticity/step-1.cc: At global scope:
/mnt/d/research/deal_ii_projects/3d_elasticity/step-1.cc:190:70: error: template argument 1 is invalid
190 | std::vector<GridTools::PeriodicFacePair<Triangulation::cell_iterator>> periodicity_vector;
| ^~
/mnt/d/research/deal_ii_projects/3d_elasticity/step-1.cc:190:73: error: template argument 1 is invalid
190 | std::vector<GridTools::PeriodicFacePair<Triangulation::cell_iterator>> periodicity_vector;
| ^~~~~~~~~~~~~~~~~~
/mnt/d/research/deal_ii_projects/3d_elasticity/step-1.cc:190:73: error: template argument 2 is invalid
/mnt/d/research/deal_ii_projects/3d_elasticity/step-1.cc:192:39: error: expected constructor, destructor, or type conversion before ‘(’ token
192 | GridTools::collect_periodic_faces(dof_handler,10,11,0,matched_pairs);
| ^
/mnt/d/research/deal_ii_projects/3d_elasticity/step-1.cc: In instantiation of ‘void CubeVector<dim>::setup_system() [with int dim = 3]’:
/mnt/d/research/deal_ii_projects/3d_elasticity/step-1.cc:377:2: required from ‘void CubeVector<dim>::run() [with int dim = 3]’
/mnt/d/research/deal_ii_projects/3d_elasticity/step-1.cc:387:17: required from here
/mnt/d/research/deal_ii_projects/3d_elasticity/step-1.cc:198:21: warning: unused variable ‘total_dofs’ [-Wunused-variable]
198 | const unsigned int total_dofs = dof_handler.n_dofs();
| ^~~~~~~~~~
/mnt/d/research/deal_ii_projects/3d_elasticity/step-1.cc: In instantiation of ‘void CubeVector<dim>::assemble() [with int dim = 3]’:
/mnt/d/research/deal_ii_projects/3d_elasticity/step-1.cc:378:2: required from ‘void CubeVector<dim>::run() [with int dim = 3]’
/mnt/d/research/deal_ii_projects/3d_elasticity/step-1.cc:387:17: required from here
/mnt/d/research/deal_ii_projects/3d_elasticity/step-1.cc:289:9: warning: unused variable ‘x’ [-Wunused-variable]
289 | double x = fe_face_values.quadrature_point(face_q)[0];
| ^
make[3]: *** [CMakeFiles/step-1.dir/build.make:63: CMakeFiles/step-1.dir/step-1.cc.o] Error 1
make[2]: *** [CMakeFiles/Makefile2:272: CMakeFiles/step-1.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:252: CMakeFiles/run.dir/rule] Error 2
make: *** [Makefile:196: run] Error 2