DFT-EFE
 
Loading...
Searching...
No Matches
GenerateMesh.h
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (c) 2021. *
3 * The Regents of the University of Michigan and DFT-EFE developers. *
4 * *
5 * This file is part of the DFT-EFE code. *
6 * *
7 * DFT-EFE is free software: you can redistribute it and/or modify *
8 * it under the terms of the Lesser GNU General Public License as *
9 * published by the Free Software Foundation, either version 3 of *
10 * the License, or (at your option) any later version. *
11 * *
12 * DFT-EFE is distributed in the hope that it will be useful, but *
13 * WITHOUT ANY WARRANTY; without even the implied warranty *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
15 * See the Lesser GNU General Public License for more details. *
16 * *
17 * You should have received a copy of the GNU Lesser General Public *
18 * License at the top level of DFT-EFE distribution. If not, see *
19 * <https://www.gnu.org/licenses/>. *
20 ******************************************************************************/
21
22/*
23 * @author Avirup Sircar
24 * The GenerateMesh for adaptive mesh generation around atom is borrowed from
25 * dftfe.
26 */
27
28#ifndef dftefeGenerateMesh_h
29#define dftefeGenerateMesh_h
30
35#include <utils/Point.h>
36#include <vector>
37#include <string>
38#include <memory>
39namespace dftefe
40{
41 namespace basis
42 {
48 {
49 public:
61 const std::vector<utils::Point> &atomCoordinates,
62 const std::vector<utils::Point> &domainBoundingVectors,
63 double radiusAroundAtom,
64 double meshSizeAroundAtom,
65 const std::vector<bool> & isPeriodicFlags,
66 const basis::CellMappingBase & cellMapping,
67 const MPI_Comm & mpiDomainCommunicator,
68 const MPI_Comm &mpiInterpoolCommunicator = utils::mpi::MPICommSelf);
69
81 const std::vector<utils::Point> &atomCoordinates,
82 const std::vector<utils::Point> &domainBoundingVectors,
83 double radiusAtAtom,
84 double meshSizeAtAtom,
85 double radiusAroundAtom,
86 double meshSizeAroundAtom,
87 const std::vector<bool> & isPeriodicFlags,
88 const basis::CellMappingBase & cellMapping,
89 const MPI_Comm & mpiDomainCommunicator,
90 const MPI_Comm &mpiInterpoolCommunicator = utils::mpi::MPICommSelf);
91
92 ~GenerateMesh() = default;
93
94 void
95 createMesh(TriangulationBase &triangulation);
96
97 private:
98 void
100 const std::vector<bool> &isPeriodicFlags);
101
102 bool
104 TriangulationBase & triangulation,
105 std::vector<size_type> & locallyOwnedCellsRefineFlags,
106 std::map<size_type, size_type> &cellIdToCellRefineFlagMapLocal,
107 const basis::CellMappingBase & cellMapping);
108
116 const std::vector<utils::Point> &d_atomCoordinates;
117 const std::vector<utils::Point> &d_domainBoundingVectors;
118 const std::vector<bool> & d_isPeriodicFlags;
119 const MPI_Comm & d_mpiDomainCommunicator;
123 std::vector<std::vector<bool>> d_triaCurrentRefinement;
124
125 }; // end of GenerateMesh
126 } // end of namespace basis
127} // end of namespace dftefe
128#endif // dftefeGenerateMesh_h
An abstract class to map a real point to parametric point and vice-versa.
Definition: CellMappingBase.h:27
Definition: GenerateMesh.h:48
const MPI_Comm & d_mpiInterpoolCommunicator
Definition: GenerateMesh.h:120
const std::vector< utils::Point > & d_domainBoundingVectors
Definition: GenerateMesh.h:117
double d_radiusAtAtom
Definition: GenerateMesh.h:111
bool d_adaptiveWithFineMesh
Definition: GenerateMesh.h:109
const std::vector< bool > & d_isPeriodicFlags
Definition: GenerateMesh.h:118
double d_radiusAroundAtom
Definition: GenerateMesh.h:112
size_type d_dim
Definition: GenerateMesh.h:110
bool refinementAlgorithm(TriangulationBase &triangulation, std::vector< size_type > &locallyOwnedCellsRefineFlags, std::map< size_type, size_type > &cellIdToCellRefineFlagMapLocal, const basis::CellMappingBase &cellMapping)
Definition: GenerateMesh.cpp:256
size_type d_maxRefinementSteps
Definition: GenerateMesh.h:115
double d_meshSizeAroundAtom
Definition: GenerateMesh.h:114
void generateCoarseMesh(TriangulationBase &triangulation, const std::vector< bool > &isPeriodicFlags)
Definition: GenerateMesh.cpp:155
utils::ConditionalOStream d_rootCout
Definition: GenerateMesh.h:122
const std::vector< utils::Point > & d_atomCoordinates
Definition: GenerateMesh.h:116
void createMesh(TriangulationBase &triangulation)
Definition: GenerateMesh.cpp:388
std::vector< std::vector< bool > > d_triaCurrentRefinement
Definition: GenerateMesh.h:123
double d_meshSizeAtAtom
Definition: GenerateMesh.h:113
const MPI_Comm & d_mpiDomainCommunicator
Definition: GenerateMesh.h:119
const basis::CellMappingBase & d_cellMapping
Definition: GenerateMesh.h:121
An abstract class for the triangulation class. The derived class specialises this class to dealii and...
Definition: TriangulationBase.h:17
Provides an interface to print based on whether a certain condition is met or not....
Definition: ConditionalOStream.h:45
MPIComm MPICommSelf
Definition: MPITypes.cpp:155
dealii includes
Definition: AtomFieldDataSpherical.cpp:31
unsigned int size_type
Definition: TypeConfig.h:8