Skip to content

Commit

Permalink
Allocate length and areas again
Browse files Browse the repository at this point in the history
  • Loading branch information
RemiLehe committed Jan 18, 2025
1 parent dfe7aef commit 20a3d15
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
14 changes: 7 additions & 7 deletions Source/Initialization/WarpXInitData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1253,15 +1253,15 @@ void WarpX::InitializeEBGridData (int lev)

auto const eb_fact = fieldEBFactory(lev);

if (WarpX::electromagnetic_solver_id == ElectromagneticSolverAlgo::ECT) {
auto edge_lengths_lev = m_fields.get_alldirs(FieldType::edge_lengths, lev);
ComputeEdgeLengths(edge_lengths_lev, eb_fact);
ScaleEdges(edge_lengths_lev, CellSize(lev));

auto edge_lengths_lev = m_fields.get_alldirs(FieldType::edge_lengths, lev);
ComputeEdgeLengths(edge_lengths_lev, eb_fact);
ScaleEdges(edge_lengths_lev, CellSize(lev));
auto face_areas_lev = m_fields.get_alldirs(FieldType::face_areas, lev);
ComputeFaceAreas(face_areas_lev, eb_fact);
ScaleAreas(face_areas_lev, CellSize(lev));

auto face_areas_lev = m_fields.get_alldirs(FieldType::face_areas, lev);
ComputeFaceAreas(face_areas_lev, eb_fact);
ScaleAreas(face_areas_lev, CellSize(lev));
if (WarpX::electromagnetic_solver_id == ElectromagneticSolverAlgo::ECT) {

// Mark on which grid points E should be updated
MarkUpdateECellsECT( m_eb_update_E[lev], edge_lengths_lev );
Expand Down
5 changes: 3 additions & 2 deletions Source/WarpX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2317,8 +2317,6 @@ WarpX::AllocLevelMFs (int lev, const BoxArray& ba, const DistributionMapping& dm
guard_cells.ng_FieldSolver, lev, "m_eb_update_B[y]");
AllocInitMultiFab(m_eb_update_B[lev][2], amrex::convert(ba, Bz_nodal_flag), dm, ncomps,
guard_cells.ng_FieldSolver, lev, "m_eb_update_B[z]");
}
if (WarpX::electromagnetic_solver_id == ElectromagneticSolverAlgo::ECT) {

//! EB: Lengths of the mesh edges
m_fields.alloc_init(FieldType::edge_lengths, Direction{0}, lev, amrex::convert(ba, Ex_nodal_flag),
Expand All @@ -2336,6 +2334,9 @@ WarpX::AllocLevelMFs (int lev, const BoxArray& ba, const DistributionMapping& dm
m_fields.alloc_init(FieldType::face_areas, Direction{2}, lev, amrex::convert(ba, Bz_nodal_flag),
dm, ncomps, guard_cells.ng_FieldSolver, 0.0_rt);

}
if (WarpX::electromagnetic_solver_id == ElectromagneticSolverAlgo::ECT) {

AllocInitMultiFab(m_flag_info_face[lev][0], amrex::convert(ba, Bx_nodal_flag), dm, ncomps,
guard_cells.ng_FieldSolver, lev, "m_flag_info_face[x]");
AllocInitMultiFab(m_flag_info_face[lev][1], amrex::convert(ba, By_nodal_flag), dm, ncomps,
Expand Down

0 comments on commit 20a3d15

Please sign in to comment.