25#if BITPIT_ENABLE_MPI==1
29#include "bitpit_PABLO.hpp"
31#if BITPIT_ENABLE_MPI==1
32#include "PABLO_userDataComm.hpp"
33#include "PABLO_userDataLB.hpp"
37using namespace bitpit;
67 pablo10.setBalance(idx,
false);
70 for (iter=1; iter<6; iter++){
71 pablo10.adaptGlobalRefine();
74#if BITPIT_ENABLE_MPI==1
76 pablo10.loadBalance();
83 double omega = 2.0*3.14/0.001;
86 xc = 0.25*cos(omega* Dt) + 0.5 ;
87 yc = 0.25*sin(omega* Dt) + 0.5;
91 uint32_t nocts = pablo10.getNumOctants();
92 vector<double> oct_data(nocts, 0.0);
98 for (iter=itstart; iter<itend; iter++){
100 xc = 0.25*cos(omega* Dt* (
double) iter) + 0.5 ;
101 yc = 0.25*sin(omega* Dt* (
double) iter) + 0.5;
104 for (
unsigned int i=0; i<nocts; i++){
107 vector<array<double,3> > nodes = pablo10.getNodes(i);
109 array<double,3> center = pablo10.getCenter(i);
110 oct_data[i] = sqrt((
pow((center[0]-xc),2.0)+
pow((center[1]-yc),2.0)+
pow((center[2]-zc),2.0)));
111 for (
int j=0; j<8; j++){
112 double x = nodes[j][0];
113 double y = nodes[j][1];
114 double z = nodes[j][2];
115 if (
pow((x-xc),2.0)+
pow((y-yc),2.0)+
pow((z-zc),2.0) <=
pow(radius,2.0)){
116 if (pablo10.getLevel(i) < 6){
118 pablo10.setMarker(i,1);
121 pablo10.setMarker(i,0);
126 if (pablo10.getLevel(i) > 5 && !inside){
128 pablo10.setMarker(i,-1);
136#if BITPIT_ENABLE_MPI==1
138 pablo10.loadBalance();
142 nocts = pablo10.getNumOctants();
143 vector<double> oct_data_new(nocts, 0.0);
144 for (
unsigned int i=0; i<nocts; i++){
145 array<double,3> center = pablo10.getCenter(i);
146 oct_data_new[i] = sqrt((
pow((center[0]-xc),2.0)+
pow((center[1]-yc),2.0)+
pow((center[2]-zc),2.0)));
149 oct_data.resize(nocts);
150 oct_data = oct_data_new;
151 oct_data_new.clear();
154 pablo10.updateConnectivity();
155 pablo10.writeTest(
"pablo00010_iter"+to_string(
static_cast<unsigned long long>(iter)), oct_data);
162int main(
int argc,
char *argv[])
164#if BITPIT_ENABLE_MPI==1
165 MPI_Init(&argc,&argv);
173#if BITPIT_ENABLE_MPI==1
174 MPI_Comm_size(MPI_COMM_WORLD, &nProcs);
175 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
189 }
catch (
const std::exception &exception) {
194#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()