Skip to content

Commit

Permalink
formatted some files
Browse files Browse the repository at this point in the history
  • Loading branch information
saurabh-s-sawant committed Aug 17, 2024
1 parent 0a93c74 commit 7eaa4e4
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 229 deletions.
4 changes: 0 additions & 4 deletions Source/Input/GeometryProperties/EmbeddedBoundaries.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1002,10 +1002,6 @@ void c_EmbeddedBoundaries::Specify_SurfSolnOnCutcells(amrex::MultiFab &mf,
if (map_basic_objects_soln_parser_flag[name]) /*specify value using parser*/
{
#ifdef TIME_DEPENDENT
// Multifab_Manipulation::SpecifyValueOnlyOnCutcells_UsingParser_4vars(mf,
// map_basic_objects_soln_parser[name]->compile<4>(),
// *geom,
// time);
amrex::ParserExecutor<4> const &macro_parser =
map_basic_objects_soln_parser[name]->compile<4>();

Expand Down
6 changes: 0 additions & 6 deletions Source/Solver/Transport/Broyden_Second_Parallel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,6 @@ void c_TransportSolver::
#else
void c_TransportSolver::Execute_Broyden_Modified_Second_Algorithm_Parallel()
{
// amrex::Print() << "Execute_Broyden_Modified_Second_Algorithm_Parallel\n";

// amrex::Print() << "\nBroydenStep: " << Broyden_Step
// << ", fraction: " << Broyden_fraction
// << ", scalar: " << Broyden_Scalar<< "\n";

auto const &h_n_curr_in = h_n_curr_in_data.table();
auto const &h_intermed_vector = h_intermed_vector_data.table();
auto *h_Intermed_values = h_Intermed_values_vec.dataPtr();
Expand Down
142 changes: 0 additions & 142 deletions Source/Solver/Transport/NEGF/NEGF_Common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2808,29 +2808,6 @@ void c_NEGF_Common<T>::Fetch_InputLocalCharge_FromNanostructure(
h_n_curr_in_glo_data.clear();
}

// template<typename T>
// void
// c_NEGF_Common<T>:: Gatherv_NEGFComputed_LocalCharge (RealTable1D&
// n_curr_out_glo_data)
//{
// auto const& h_RhoInduced_loc = h_RhoInduced_loc_data.table();
// auto const& n_curr_out_glo = n_curr_out_glo_data.table();
//
//
// MPI_Gatherv(&h_RhoInduced_loc(0),
// blkCol_size_loc,
// MPI_DOUBLE,
// &n_curr_out_glo(0),
// MPI_recv_count.data(),
// MPI_recv_disp.data(),
// MPI_DOUBLE,
// ParallelDescriptor::IOProcessorNumber(),
// ParallelDescriptor::Communicator());
//
// //MPI_Barrier(ParallelDescriptor::Communicator());
//
// }

template <typename T>
void c_NEGF_Common<T>::Scatterv_BroydenComputed_GlobalCharge(
RealTable1D &n_curr_in_glo_data)
Expand Down Expand Up @@ -2928,125 +2905,6 @@ void c_NEGF_Common<T>::Write_ChargeNorm(const std::string filename_prefix,
"'axial location / (nm)', 'norm");
}

// template<typename T>
// void
// c_NEGF_Common<T>:: GuessNewCharge_SimpleMixingAlg ()
//{
// /*update h_RhoInduced_glo*/
//
// if (ParallelDescriptor::IOProcessor())
// {
// amrex::Print() << "BroydenStep: " << Broyden_Step << "\n";
//
// auto const& n_curr_in = h_n_curr_in_data.table();
// auto const& n_curr_out = n_curr_out_data.table();
// auto const& n_prev_in = n_prev_in_data.table();
// auto const& F_curr = F_curr_data.table();
//
// SetVal_Table1D(Norm_data, 0.);
// auto const& Norm = Norm_data.table();
//
// RealTable1D sum_Fcurr_data({0},{num_field_sites},
// The_Pinned_Arena()); RealTable1D
// sum_deltaFcurr_data({0},{num_field_sites}, The_Pinned_Arena());
// RealTable1D delta_F_curr_data({0},{num_field_sites},
// The_Pinned_Arena());
//
// auto const& sum_Fcurr = sum_Fcurr_data.table();
// auto const& sum_deltaFcurr = sum_deltaFcurr_data.table();
// auto const& delta_F_curr = delta_F_curr_data.table();
//
// amrex::Real denom = 0.;
// amrex::Real total_diff = 0.;
// int m = Broyden_Step-1;
//
//
// for(int l=0; l < num_field_sites; ++l)
// {
// amrex::Real Fcurr = n_curr_in(l) - n_curr_out(l);
//
// delta_F_curr(l) = Fcurr - F_curr(l);
//
// F_curr(l) = Fcurr;
//
// denom += pow(delta_F_curr(l),2.);
//
// Norm(l) = fabs(Fcurr);
//
// total_diff += pow(Fcurr,2);
//
// sum_deltaFcurr(l) = 0;
// sum_Fcurr(l) = 0;
//
// }
// total_diff = sqrt(total_diff);
//
// for(int l=0; l < num_field_sites; ++l)
// {
// n_prev_in(l) = n_curr_in(l);
// n_curr_in(l) = n_prev_in(l) - Broyden_fraction*F_curr(l);
// }
//
// sum_Fcurr_data.clear();
// sum_deltaFcurr_data.clear();
// delta_F_curr_data.clear();
//
// for(int l=0; l < num_field_sites; ++l)
// {
// amrex::Print() << "l, Qm_in, Qm_out, Qm+1_in, F_curr, Norm: " <<
// l << " " << n_prev_in(l)
// << "
// " << n_curr_out(l)
// << " " << n_curr_in(l)
// << " " << F_curr(l)
// << " " << Norm(l)
// << "\n";
// }
// //int half_sites = int(num_field_sites/2);
// //for(int l=half_sites; l < half_sites+1; ++l)
// //{
// // amrex::Print() << "l, Qm_in, Qm_out, Qm+1_in, F_curr, Norm: "
// << l << " " << n_prev_in(l)
// // <<
// " " << n_curr_out(l)
// // << " " << n_curr_in(l)
// // << " " << F_curr(l)
// // << " " << Norm(l)
// // << "\n";
// //}
// //for(int l=num_field_sites-1; l < num_field_sites; ++l)
// //{
// // amrex::Print() << "l, Qm_in, Qm_out, Qm+1_in, F_curr, Norm: "
// << l << " " << n_prev_in(l)
// // <<
// " " << n_curr_out(l)
// // << " " << n_curr_in(l)
// // << " " << F_curr(l)
// // << " " << Norm(l)
// // << "\n";
// //}
//
//
// Broyden_Norm = Norm(0);
// int norm_index = 0;
// for(int l=1; l < num_field_sites; ++l)
// {
// if(Broyden_Norm < Norm(l))
// {
// Broyden_Norm = Norm(l);
// norm_index = l;
// }
// }
//
// amrex::Print() << "\nL2 norm: " << total_diff << " Max norm: " <<
// Broyden_Norm << " location: " << norm_index << "\n";
//
// Broyden_Step += 1;
// }
// }
//
//

template <typename T>
void c_NEGF_Common<T>::Compute_RhoNonEq()
{
Expand Down
5 changes: 0 additions & 5 deletions Source/Utils/CodeUtils/CodeUtil.H
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,6 @@ AMREX_GPU_DEVICE AMREX_FORCE_INLINE void ConvertParserIntoMultiFab_4vars(
"ConvertParserIntoMultiFab_4vars()************************\n";
#endif
}
// void GetXYZ(const int i, const int j, const int k,
// const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>& dx,
// const amrex::RealBox& real_box,
// const amrex::IntVect& iv,
// amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>& coord_vec);

#ifdef AMREX_USE_EB
void SpecifyValueOnlyOnCutcells(amrex::MultiFab &mf, amrex::Real const value);
Expand Down
47 changes: 0 additions & 47 deletions Source/Utils/CodeUtils/CodeUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -506,18 +506,6 @@ void Multifab_Manipulation::Copy_3DCartesian_To_2DAzimuthalLongitudinal(

amrex::Real theta =
atan2(cart[dir_ref2], cart[dir_ref1]);

// int az = theta*(cyl_ncell_ring/2*pi);
// int ax = index[dir_axial];
// if(ax > 0 and ax < Max_Ncell_Long) {
//(*cyl_surf_grid)(ax+1, ax+1) = mf_array(i,j,k);
// if(az < 0 or az > Max_Ncell_Azim) {
// (*cyl_surf_grid)(1, 1) = az;
// }
// if(az > 0 and az < Max_Ncell_Azim and ax > 0 and ax <
// Max_Ncell_Long) {
// (*cyl_surf_grid)(az+1, ax+1) = mf_array(i,j,k);
//}
}
});
}
Expand All @@ -526,41 +514,6 @@ void Multifab_Manipulation::Copy_3DCartesian_To_2DAzimuthalLongitudinal(

#endif // for AMREX_USE_EB

// AMREX_GPU_DEVICE AMREX_FORCE_INLINE
// void
////Multifab_Manipulation::GetXYZ(const int i, const int j, const int k,
//// const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>&
/// dx,
//// const amrex::RealBox& real_box, const amrex::IntVect&
/// iv, / amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>&
/// coord_vec)
// Multifab_Manipulation::GetXYZ(const int i, const int j, const int k,
// amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>& coord_vec)
//{
//#ifdef PRINT_NAME
// amrex::Print() <<
// "\n\n\t\t\t\t\t{************************Multifab_Manipulation::GetXYZ()************************\n";
// amrex::Print() << "\t\t\t\t\tin file: " << __FILE__ << " at line: " <<
// __LINE__ << "\n";
//#endif
// coord_vec[0] = i * dx[0];
// coord_vec[1] = j * dx[1];
// coord_vec[2] = k * dx[2];
//// amrex::Real fac_x = (1._rt - iv[0]) * dx[0] * 0.5_rt;
//// coord_vec[0] = i * dx[0] + real_box.lo(0) + fac_x;
////
//// amrex::Real fac_y = (1._rt - iv[1]) * dx[1] * 0.5_rt;
//// coord_vec[1] = j * dx[1] + real_box.lo(1) + fac_y;
////
//// amrex::Real fac_z = (1._rt - iv[2]) * dx[2] * 0.5_rt;
//// coord_vec[2] = k * dx[2] + real_box.lo(2) + fac_z;
//
//#ifdef PRINT_NAME
// amrex::Print() <<
// "\t\t\t\t\t}************************Multifab_Manipulation::GetXYZ()************************\n";
//#endif
//}

void PrintRunDiagnostics(amrex::Real initial_time)
{
#ifdef PRINT_NAME
Expand Down
27 changes: 2 additions & 25 deletions Source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,6 @@ int main(int argc, char *argv[])
{
amrex::Initialize(argc, argv);

#ifdef PRINT_NAME
amrex::Print()
<< "\n\n************************************************************\n";
amrex::Print()
<< "{**************************main(*)**************************\n";
amrex::Print() << "in file: " << __FILE__ << " at line: " << __LINE__
<< "\n";
amrex::Print()
<< "************************************************************\n";
#endif

amrex::Real initial_time = ParallelDescriptor::second();

{
Expand All @@ -35,28 +24,16 @@ int main(int argc, char *argv[])

// pCode.EstimateOfRequiredMemory();

pCode.PrintGlobalWarnings(
"the initialization step"); // Print warning at this stage
pCode.PrintGlobalWarnings("the initialization step");

pCode.Solve_PostProcess_Output();

pCode.Cleanup();

WARPX_PROFILE_VAR_STOP(pmain);

} // destructor of c_Code is called here and all objects it created are
// destructed in reverse order.
}

PrintRunDiagnostics(initial_time);

#ifdef PRINT_NAME
amrex::Print()
<< "\n\n**********************************************************\n";
amrex::Print()
<< "}**************************main(*)**************************\n";
amrex::Print()
<< "**********************************************************\n\n";
#endif

amrex::Finalize();
}

0 comments on commit 7eaa4e4

Please sign in to comment.