25#if BITPIT_ENABLE_MPI==1
29#include "bitpit_PABLO.hpp"
32using namespace bitpit;
72 for (iter=1; iter<5; iter++){
73 pablo3.adaptGlobalRefine();
82 uint32_t nocts = pablo3.getNumOctants();
83 vector<double> oct_data(nocts, 0.0);
86 for (
unsigned int i=0; i<nocts; i++){
88 vector<array<double,3> > nodes = pablo3.getNodes(i);
89 for (
int j=0; j<4; j++){
90 double x = nodes[j][0];
91 double y = nodes[j][1];
92 if ((
pow((x-xc),2.0)+
pow((y-yc),2.0) <=
pow(radius,2.0))){
100 pablo3.updateConnectivity();
101 pablo3.writeTest(
"pablo00003_iter"+to_string(
static_cast<unsigned long long>(iter)), oct_data);
105 for (iter=start; iter<start+25; iter++){
106 vector<double> oct_data_smooth(nocts, 0.0);
107 vector<uint32_t> neigh, neigh_t;
108 vector<bool> isghost, isghost_t;
109 uint8_t iface, nfaces;
111 for (
unsigned int i=0; i<nocts; i++){
116 for (codim=1; codim<3; codim++){
120 else if (codim == 2){
123 for (iface=0; iface<nfaces; iface++){
124 pablo3.findNeighbours(i,iface,codim,neigh_t,isghost_t);
125 neigh.insert(neigh.end(), neigh_t.begin(), neigh_t.end());
126 isghost.insert(isghost.end(), isghost_t.begin(), isghost_t.end());
131 oct_data_smooth[i] = oct_data[i]/(neigh.size()+1);
132 for (
unsigned int j=0; j<neigh.size(); j++){
137 oct_data_smooth[i] += oct_data[neigh[j]]/(neigh.size()+1);
143 pablo3.updateConnectivity();
144 pablo3.writeTest(
"pablo00003_iter"+to_string(
static_cast<unsigned long long>(iter)), oct_data_smooth);
146 oct_data = oct_data_smooth;
153int main(
int argc,
char *argv[])
155#if BITPIT_ENABLE_MPI==1
156 MPI_Init(&argc,&argv);
164#if BITPIT_ENABLE_MPI==1
165 MPI_Comm_size(MPI_COMM_WORLD, &nProcs);
166 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
180 }
catch (
const std::exception &exception) {
185#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()