Skip to content

Commit

Permalink
formatted files
Browse files Browse the repository at this point in the history
  • Loading branch information
saurabh-s-sawant committed Aug 22, 2024
1 parent 199082b commit 8ae1cca
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 20 deletions.
4 changes: 2 additions & 2 deletions Source/Solver/Transport/NEGF/CNT.H
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ class c_CNT : public c_NEGF_Common<ComplexType[NUM_MODES]>
MatrixBlock<BlkType> &gr, const ComplexType EmU) final;

public:

static int get_1D_site_id(int par_id_local_to_NS) {
static int get_1D_site_id(int par_id_local_to_NS)
{
return static_cast<int>(
amrex::Math::floor((par_id_local_to_NS - 1) / type_id[0]));
}
Expand Down
4 changes: 2 additions & 2 deletions Source/Solver/Transport/NEGF/Graphene.H
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ class c_Graphene : public c_NEGF_Common<ComplexType[NUM_MODES][NUM_MODES]>
}

public:

static int get_1D_site_id(int par_id_local_to_NS) {
static int get_1D_site_id(int par_id_local_to_NS)
{
return static_cast<int>(
amrex::Math::floor((par_id_local_to_NS - 1) / type_id[0]));
}
Expand Down
10 changes: 5 additions & 5 deletions Source/Solver/Transport/NEGF/NEGF_Common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ void c_NEGF_Common<T>::Define_MPISendCountAndDisp()
std::fill(MPI_send_count.begin(), MPI_send_count.end(), 0);
std::fill(MPI_send_disp.begin(), MPI_send_disp.end(), 0);
}
MPI_Gather(&(min_local_site_id), 1, MPI_INT, MPI_send_disp.data(), 1, MPI_INT,
ParallelDescriptor::IOProcessorNumber(),
MPI_Gather(&(min_local_site_id), 1, MPI_INT, MPI_send_disp.data(), 1,
MPI_INT, ParallelDescriptor::IOProcessorNumber(),
ParallelDescriptor::Communicator());

MPI_Gather(&(num_local_field_sites), 1, MPI_INT, MPI_send_count.data(), 1,
Expand Down Expand Up @@ -197,7 +197,8 @@ void c_NEGF_Common<T>::Initialize_ChargeAtFieldSites()
// // bool full_match = true;
// // for(int i=0; i < num_local_field_sites; ++i)
// // {
// // if(h_n_curr_in_loc(i) != h_n_curr_in_glo(i+min_local_site_id)
// // if(h_n_curr_in_loc(i) !=
// h_n_curr_in_glo(i+min_local_site_id)
// )

// // full_match = false;
Expand Down Expand Up @@ -1189,8 +1190,7 @@ void c_NEGF_Common<T>::Initialize_NEGF_Params(
const amrex::Real &initial_deposit_value,
const std::string &negf_foldername_str)
{
Set_KeyParams(name_str, id_counter,
initial_deposit_value);
Set_KeyParams(name_str, id_counter, initial_deposit_value);

Define_FoldersAndFiles(negf_foldername_str);

Expand Down
2 changes: 1 addition & 1 deletion Source/Solver/Transport/Nanostructure.H
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class c_Nanostructure
amrex::MultiFab *p_mf_deposit = nullptr;
const amrex::GpuArray<int, AMREX_SPACEDIM> *_n_cell;
amrex::Vector<s_Position3D> pos_vec;
int particle_id_offset=0;
int particle_id_offset = 0;

void Fill_AtomLocations();
void Read_AtomLocations();
Expand Down
10 changes: 5 additions & 5 deletions Source/Solver/Transport/Nanostructure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ void c_Nanostructure<NSType>::Fill_AtomLocations()
ParticleType p;
p.id() = ParticleType::NextID();

if(i==0) particle_id_offset = p.id()-1;
if (i == 0) particle_id_offset = p.id() - 1;

p.cpu() = ParallelDescriptor::MyProc();

Expand Down Expand Up @@ -128,7 +128,7 @@ void c_Nanostructure<NSType>::Fill_AtomLocations()
ParallelDescriptor::Bcast(&particle_id_offset, 1,
ParallelDescriptor::IOProcessorNumber());

Redistribute();
Redistribute();
}

template <typename NSType>
Expand Down Expand Up @@ -378,8 +378,7 @@ void c_Nanostructure<NSType>::Deposit_AtomAttributeToMesh()
int atoms_per_field_site = NSType::num_atoms_per_field_site;
int SIO = NSType::min_local_site_id;

amrex::Real vol =
AMREX_D_TERM(dx[0], *dx[1], *dx[2]);
amrex::Real vol = AMREX_D_TERM(dx[0], *dx[1], *dx[2]);

auto const &h_n_curr_in_loc = NSType::h_n_curr_in_loc_data.table();

Expand Down Expand Up @@ -460,7 +459,8 @@ void c_Nanostructure<NSType>::Obtain_PotentialAtSites()

int site_id = p_site_id[p];

int atom_id_at_site = get_atom_id_at_site(par_id_local_to_NS);
int atom_id_at_site =
get_atom_id_at_site(par_id_local_to_NS);

int remainder =
atom_id_at_site % num_atoms_per_field_site;
Expand Down
8 changes: 3 additions & 5 deletions Source/Utils/CodeUtils/ParticleStructure.H
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

// Extra Particle attributes in Struct-of-Arrays form
// real: phi, charge
// int: site_id
// int: site_id

struct realPA // real Particle Attribute
{
Expand All @@ -28,7 +28,7 @@ struct intPA // integer Particle Attribute
{
enum
{
site_id, //field_site_id local to nanostructure
site_id, // field_site_id local to nanostructure
NUM
};
};
Expand Down Expand Up @@ -104,9 +104,7 @@ class MyParIter

const IntVector &get_site_id() const
{
return this->GetStructOfArrays().GetIntData(
intPA::site_id);
return this->GetStructOfArrays().GetIntData(intPA::site_id);
}

};
#endif

0 comments on commit 8ae1cca

Please sign in to comment.