25#if BITPIT_ENABLE_MPI==1
29#include "bitpit_PABLO.hpp"
32using namespace bitpit;
76 pablo4.setBalance(idx,
false);
79 for (iter=1; iter<6; iter++){
80 pablo4.adaptGlobalRefine();
89 uint32_t nocts = pablo4.getNumOctants();
90 vector<double> oct_data(nocts, 0.0);
93 for (
unsigned int i=0; i<nocts; i++){
95 vector<array<double,3> > nodes = pablo4.getNodes(i);
96 array<double,3> center = pablo4.getCenter(i);
97 for (
int j=0; j<4; j++){
98 double x = nodes[j][0];
99 double y = nodes[j][1];
100 if ((
pow((x-xc),2.0)+
pow((y-yc),2.0) <=
pow(radius,2.0))){
101 oct_data[i] = (
pow((center[0]-xc),2.0)+
pow((center[1]-yc),2.0));
108 pablo4.updateConnectivity();
109 pablo4.writeTest(
"pablo00004_iter"+to_string(
static_cast<unsigned long long>(iter)), oct_data);
113 for (iter=start; iter<start+2; iter++){
114 for (
unsigned int i=0; i<nocts; i++){
116 vector<array<double,3> > nodes = pablo4.getNodes(i);
117 array<double,3> center = pablo4.getCenter(i);
118 for (
int j=0; j<4; j++){
119 double x = nodes[j][0];
120 double y = nodes[j][1];
121 if ((
pow((x-xc),2.0)+
pow((y-yc),2.0) <=
pow(radius,2.0))){
125 pablo4.setMarker(i,1);
130 pablo4.setMarker(i,-1);
137 vector<double> oct_data_new;
138 vector<uint32_t> mapper;
139 vector<bool> isghost;
141 nocts = pablo4.getNumOctants();
142 oct_data_new.resize(nocts, 0.0);
147 for (uint32_t i=0; i<nocts; i++){
148 pablo4.getMapping(i, mapper, isghost);
149 if (pablo4.getIsNewC(i)){
150 for (
int j=0; j<4; j++){
151 oct_data_new[i] += oct_data[mapper[j]]/4;
154 else if (pablo4.getIsNewR(i)){
155 oct_data_new[i] += oct_data[mapper[0]];
158 oct_data_new[i] += oct_data[mapper[0]];
163 pablo4.updateConnectivity();
164 pablo4.writeTest(
"pablo00004_iter"+to_string(
static_cast<unsigned long long>(iter)), oct_data_new);
166 oct_data = oct_data_new;
173int main(
int argc,
char *argv[])
175#if BITPIT_ENABLE_MPI==1
176 MPI_Init(&argc,&argv);
184#if BITPIT_ENABLE_MPI==1
185 MPI_Comm_size(MPI_COMM_WORLD, &nProcs);
186 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
200 }
catch (
const std::exception &exception) {
205#if BITPIT_ENABLE_MPI==1
void initialize(log::Mode mode, bool reset, int nProcesses, int rank)
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()