Hi,
I am working with [email protected] for one of my research projects and one of
the applications includes reading from a large mesh file. So I was using
the parallel::distributed::triangulation in my code which was working
perfectly but now as the size of my mesh files has increased more, I have
to switch to parallel::fullydistributed::triangulation but getting errors
in compilation of the code itself! I have written a basic example using
p:f:t and tried to compile it (attached to the mail) but I am getting an
undefined reference error (as shown below) although the code compiles well
for the p:d:t case!
error: undefined reference to 'void
dealii::GridTools::collect_periodic_faces<dealii::parallel::fullydistributed::Triangulation<2,
2> >(dealii::parallel::fullydistributed::Triangulation<2, 2> const&,
unsigned int, unsigned int, int,
std::vector<dealii::GridTools::PeriodicFacePair<dealii::parallel::fullydistributed::Triangulation<2,
2>::cell_iterator>,
std::allocator<dealii::GridTools::PeriodicFacePair<dealii::parallel::fullydistributed::Triangulation<2,
2>::cell_iterator> > >&, dealii::Tensor<1,
dealii::parallel::fullydistributed::Triangulation<2, 2>::space_dimension,
double> const&, dealii::FullMatrix<double> const&)'
Can you please help in what is probably going wrong from my side in
implementation of p:f:t?
--
Regards,
Aditya Pratap Singh
Master's Student (FAU Erlangen-Nurnberg)
--
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/CALh8KBgqO8j78x3crg8iGhXm1x-zBv4_juWxNy_fFS8zu9CQGA%40mail.gmail.com.
#include <deal.II/distributed/fully_distributed_tria.h>
#include <deal.II/base/exceptions.h>
#include <deal.II/grid/tria.h>
#include <deal.II/grid/tria_accessor.h>
#include <deal.II/grid/grid_in.h>
#include <deal.II/grid/grid_out.h>
#include <deal.II/grid/grid_tools.h>
#include <iostream>
#include <fstream>
#include <mpi.h>
using NumberType = double;
using UnsignedIntType = unsigned int;
template <UnsignedIntType dim>
void Read_meshFile(const std::string meshFileName,
dealii::Triangulation<dim>& triangulation)
{
const bool writeGrid = true;
typename dealii::GridIn<dim>::Format meshInputFormat =
dealii::GridIn<dim>::abaqus;
dealii::GridOut::OutputFormat meshOutputFormat = dealii::GridOut::vtk;
dealii::GridIn<dim> gridIn;
gridIn.attach_triangulation(triangulation);
std::ifstream gridInputStream(meshFileName);
gridIn.read(gridInputStream, meshInputFormat);
std::cout << "nElements: " << triangulation.n_active_cells()
<< "\t nNodes: " << triangulation.n_vertices()
<< std::endl;
}
template <UnsignedIntType dim>
void
Check_meshPeriodicity(dealii::parallel::fullydistributed::Triangulation<dim>&
triangulation,
const NumberType& rveEdgeLength,
const NumberType &boundaryTolCorrectionFactor)
{
const UnsignedIntType boundaryIDStart = 101;
//Write_boundaryIDs<dim>(triangulation, std::cout, true);
std::array<std::vector<dealii::GridTools::PeriodicFacePair< typename
dealii::parallel::fullydistributed::Triangulation<dim>::cell_iterator>>, dim>
periodicFacePairs;
for(UnsignedIntType boundaryPairCtr=0; boundaryPairCtr < dim;
++boundaryPairCtr)
dealii::GridTools::collect_periodic_faces(triangulation,
100 + boundaryIDStart +
boundaryPairCtr,
boundaryIDStart +
boundaryPairCtr,
boundaryPairCtr,
periodicFacePairs[boundaryPairCtr]);
std::cout << "Periodic Faces successfully found!!" << std::endl;
}
/** template insantiations **/
template void
Check_meshPeriodicity<2>(dealii::parallel::fullydistributed::Triangulation<2>&
triangulation,
const NumberType& rveEdgeLength,
const NumberType
&boundaryTolCorrectionFactor);
template void
Check_meshPeriodicity<3>(dealii::parallel::fullydistributed::Triangulation<3>&
triangulation,
const NumberType& rveEdgeLength,
const NumberType
&boundaryTolCorrectionFactor);
int main(int argc, char *argv[])
{
Assert(argc == 3 || argc == 4, dealii::ExcMessage("Insufficient number of
input arguments. "
"The program runs as \n ./verify-mesh meshFileName rveEdgeLength"));
dealii::Utilities::MPI::MPI_InitFinalize mpiInitialization(argc, argv, 1);
MPI_Comm const & mpiCommunicator(MPI_COMM_WORLD);
const UnsignedIntType dim = 3;
const std::string inputMeshFile = argv[1];
const NumberType rveEdgeLength = std::stoi(argv[2]);
NumberType rveBoundaryCorrectionFactor = 0.0;
if (argc == 4)
rveBoundaryCorrectionFactor = std::stod(argv[3]);
AssertThrow((rveBoundaryCorrectionFactor <= 0.05) &&
(rveBoundaryCorrectionFactor >= 0.0),
dealii::ExcMessage("RVE boundary correction factor out of
range. Must be within [0.0, 0.05]"));
dealii::parallel::fullydistributed::Triangulation<dim>
triangulation(mpiCommunicator);
Read_meshFile<dim>(inputMeshFile, triangulation);
Check_meshPeriodicity<dim>(triangulation, rveEdgeLength,
rveBoundaryCorrectionFactor);
}