25#if BITPIT_ENABLE_MPI==1
29#include "bitpit_PABLO.hpp"
32using namespace bitpit;
78 pablo1.computeConnectivity();
79 pablo1.write(
"pablo00001_iter0");
82 pablo1.adaptGlobalRefine();
83 pablo1.updateConnectivity();
84 pablo1.write(
"pablo00001_iter1");
91 pablo1.setBalanceCodimension(1);
94 uint32_t nocts = pablo1.getNumOctants();
95 for (
unsigned int i=0; i<nocts; i++){
96 array<double,3> center = pablo1.getCenter(i);
99 pablo1.setBalance(i,
false);
107 for (
int iter=0; iter<nref1; iter++){
108 nocts = pablo1.getNumOctants();
109 for (
unsigned int i=0; i<nocts; i++){
111 Octant *oct = pablo1.getOctant(i);
113 array<double,3> center = pablo1.getCenter(oct);
114 double x = center[0];
115 double y = center[1];
118 if ((
pow((x-xc),2.0)+
pow((y-yc),2.0) <
pow(radius,2.0)) &&
125 pablo1.updateConnectivity();
126 pablo1.write(
"pablo00001_iter"+to_string(
static_cast<unsigned long long>(iter+2)));
138 nocts = pablo1.getNumOctants();
139 for (
unsigned int i=0; i<nocts; i++){
141 array<double,3> center = pablo1.getCenter(i);
142 double x = center[0];
143 double y = center[1];
144 if ((
pow((x-xc),2.0)+
pow((y-yc),2.0) <
pow(radius,2.0)) &&
145 (y>yc) && iter<=nref2 && pablo1.getLevel(i)<=iter+1){
148 pablo1.setMarker(i, 1);
151 done = pablo1.adapt();
152 pablo1.updateConnectivity();
153 pablo1.write(
"pablo00001_iter"+to_string(
static_cast<unsigned long long>(iter+nref1+2)));
158 pablo1.adaptGlobalRefine();
159 pablo1.updateConnectivity();
160 pablo1.write(
"pablo00001_iter"+to_string(
static_cast<unsigned long long>(iter+nref1+3)));
166int main(
int argc,
char *argv[])
168#if BITPIT_ENABLE_MPI==1
169 MPI_Init(&argc,&argv);
177#if BITPIT_ENABLE_MPI==1
178 MPI_Comm_size(MPI_COMM_WORLD, &nProcs);
179 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
193 }
catch (
const std::exception &exception) {
198#if BITPIT_ENABLE_MPI==1
void initialize(log::Mode mode, bool reset, int nProcesses, int rank)
void setMarker(int8_t marker)
std::array< T, d > pow(std::array< T, d > &x, double p)
#define BITPIT_UNUSED(variable)
Logger & cout(log::Level defaultSeverity, log::Visibility defaultVisibility)
LoggerManipulator< log::Level > fileVerbosity(const log::Level &threshold)
Logger & disableConsole(Logger &logger, const log::Level &level)
LoggerManager & manager()