Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 78 additions & 33 deletions Source/BoundaryConditions/PEC_Insulator.H
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ public:
* \param[in] time current time of the simulation
* \param[in] split_pml_field whether pml the multifab is the regular Efield or split pml field
* \param[in] E_like whether the field is E like or B like
* \param[in] set_fields_x_lo the flags for the field along x at the lower boundary
* \param[in] set_fields_y_lo the flags for the field along y at the lower boundary
* \param[in] set_fields_z_lo the flags for the field along z at the lower boundary
* \param[in] set_fields_x_hi the flags for the field along x at the upper boundary
* \param[in] set_fields_y_hi the flags for the field along y at the upper boundary
* \param[in] set_fields_z_hi the flags for the field along z at the upper boundary
* \param[in] set_Fx_lo the flags for the field along x at the lower boundary
* \param[in] set_Fy_lo the flags for the field along y at the lower boundary
* \param[in] set_Fz_lo the flags for the field along z at the lower boundary
* \param[in] set_Fx_hi the flags for the field along x at the upper boundary
* \param[in] set_Fy_hi the flags for the field along y at the upper boundary
* \param[in] set_Fz_hi the flags for the field along z at the upper boundary
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe make the description consistent with changes from your previous PR?

e.g., the flags for the x-field at the lower boundaries

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fixed with a merge of development

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it? Looks like it is still the old way.

* \param[in] Fx_parsers_lo the parsers for the field along x at the lower boundary
* \param[in] Fy_parsers_lo the parsers for the field along y at the lower boundary
* \param[in] Fz_parsers_lo the parsers for the field along z at the lower boundary
Expand All @@ -109,19 +109,49 @@ public:
amrex::Real time,
bool split_pml_field,
bool E_like,
amrex::Vector<int> const & set_fields_x_lo,
amrex::Vector<int> const & set_fields_y_lo,
amrex::Vector<int> const & set_fields_z_lo,
amrex::Vector<int> const & set_fields_x_hi,
amrex::Vector<int> const & set_fields_y_hi,
amrex::Vector<int> const & set_fields_z_hi,
amrex::Vector<int> const & set_Fx_lo,
amrex::Vector<int> const & set_Fy_lo,
amrex::Vector<int> const & set_Fz_lo,
amrex::Vector<int> const & set_Fx_hi,
amrex::Vector<int> const & set_Fy_hi,
amrex::Vector<int> const & set_Fz_hi,
amrex::Vector<amrex::ParserExecutor<3>> const & Fx_parsers_lo,
amrex::Vector<amrex::ParserExecutor<3>> const & Fy_parsers_lo,
amrex::Vector<amrex::ParserExecutor<3>> const & Fz_parsers_lo,
amrex::Vector<amrex::ParserExecutor<3>> const & Fx_parsers_hi,
amrex::Vector<amrex::ParserExecutor<3>> const & Fy_parsers_hi,
amrex::Vector<amrex::ParserExecutor<3>> const & Fz_parsers_hi);

/* \brief Returns whether any E field is set on a boundary
* \param[in] idim dimension to check
* \param[in] iside side to check, 0 is lower, 1 is upper
* \return whether the E field is set on the boundary
*/
int IsESet(int idim, int iside) const { return ( iside == 1 ? m_set_E_hi[idim] : m_set_E_lo[idim] ); }

/* \brief Returns whether any B field is set on a boundary
* \param[in] idim dimension to check
* \param[in] iside side to check, 0 is lower, 1 is upper
* \return whether the B field is set on the boundary
*/
int IsBSet(int idim, int iside) const { return ( iside == 1 ? m_set_B_hi[idim] : m_set_B_lo[idim] ); }

/* \brief Returns whether the E field is set on a boundary
* \param[in] idim dimension to check
* \param[in] iside side to check, 0 is lower, 1 is upper
* \param[in] ifield which field to check, 0, 1, or 2
* \return whether the E field is set on the boundary
*/
int IsESet(int idim, int iside, int ifield) const;

/* \brief Returns whether the B field is set on a boundary
* \param[in] idim dimension to check
* \param[in] iside side to check, 0 is lower, 1 is upper
* \param[in] ifield which field to check, 0, 1, or 2
* \return whether the B field is set on the boundary
*/
int IsBSet(int idim, int iside, int ifield) const;

private:

/* \brief Read in the parsers for the tangential fields, returning whether
Expand All @@ -139,49 +169,64 @@ private:
std::string const & coord1,
std::string const & coord2);

// Parsers specifying the region of each boundary that is insulator
amrex::Vector<std::unique_ptr<amrex::Parser>> m_insulator_area_lo;
amrex::Vector<std::unique_ptr<amrex::Parser>> m_insulator_area_hi;

amrex::Vector<amrex::ParserExecutor<2>> m_area_parsers_lo;
amrex::Vector<amrex::ParserExecutor<2>> m_area_parsers_hi;

// Flags whether any B fields are specified on each boundary
amrex::Vector<int> m_set_B_lo = {0, 0, 0};
amrex::Vector<int> m_set_B_hi = {0, 0, 0};

// Parsers for the two B fields tangential to each boundary
amrex::Vector<std::unique_ptr<amrex::Parser>> m_parsers_B1_lo;
amrex::Vector<std::unique_ptr<amrex::Parser>> m_parsers_B2_lo;
amrex::Vector<std::unique_ptr<amrex::Parser>> m_parsers_B1_hi;
amrex::Vector<std::unique_ptr<amrex::Parser>> m_parsers_B2_hi;

// Flags whether any E fields are specified on each boundary
amrex::Vector<int> m_set_E_lo = {0, 0, 0};
amrex::Vector<int> m_set_E_hi = {0, 0, 0};

// Parsers for the two B fields tangential to each boundary
amrex::Vector<std::unique_ptr<amrex::Parser>> m_parsers_E1_lo;
amrex::Vector<std::unique_ptr<amrex::Parser>> m_parsers_E2_lo;
amrex::Vector<std::unique_ptr<amrex::Parser>> m_parsers_E1_hi;
amrex::Vector<std::unique_ptr<amrex::Parser>> m_parsers_E2_hi;

amrex::Vector<int> m_set_Bfields_x_lo;
amrex::Vector<int> m_set_Bfields_y_lo;
amrex::Vector<int> m_set_Bfields_z_lo;

amrex::Vector<int> m_set_Bfields_x_hi;
amrex::Vector<int> m_set_Bfields_y_hi;
amrex::Vector<int> m_set_Bfields_z_hi;

amrex::Vector<amrex::ParserExecutor<3>> m_Bx_parsers_lo, m_By_parsers_lo, m_Bz_parsers_lo;
amrex::Vector<amrex::ParserExecutor<3>> m_Bx_parsers_hi, m_By_parsers_hi, m_Bz_parsers_hi;

amrex::Vector<int> m_set_Efields_x_lo;
amrex::Vector<int> m_set_Efields_y_lo;
amrex::Vector<int> m_set_Efields_z_lo;

amrex::Vector<int> m_set_Efields_x_hi;
amrex::Vector<int> m_set_Efields_y_hi;
amrex::Vector<int> m_set_Efields_z_hi;

amrex::Vector<amrex::ParserExecutor<3>> m_Ex_parsers_lo, m_Ey_parsers_lo, m_Ez_parsers_lo;
amrex::Vector<amrex::ParserExecutor<3>> m_Ex_parsers_hi, m_Ey_parsers_hi, m_Ez_parsers_hi;
// For each B field, the flags specifying whether it is set on each boundary
amrex::Vector<int> m_set_Bx_lo;
amrex::Vector<int> m_set_By_lo;
amrex::Vector<int> m_set_Bz_lo;
amrex::Vector<int> m_set_Bx_hi;
amrex::Vector<int> m_set_By_hi;
amrex::Vector<int> m_set_Bz_hi;

// For each B field, the parsers for the field value on each boundary
amrex::Vector<amrex::ParserExecutor<3>> m_Bx_parsers_lo;
amrex::Vector<amrex::ParserExecutor<3>> m_By_parsers_lo;
amrex::Vector<amrex::ParserExecutor<3>> m_Bz_parsers_lo;
amrex::Vector<amrex::ParserExecutor<3>> m_Bx_parsers_hi;
amrex::Vector<amrex::ParserExecutor<3>> m_By_parsers_hi;
amrex::Vector<amrex::ParserExecutor<3>> m_Bz_parsers_hi;

// For each E field, the flags specifying whether it is set on each boundary
amrex::Vector<int> m_set_Ex_lo;
amrex::Vector<int> m_set_Ey_lo;
amrex::Vector<int> m_set_Ez_lo;
amrex::Vector<int> m_set_Ex_hi;
amrex::Vector<int> m_set_Ey_hi;
amrex::Vector<int> m_set_Ez_hi;

// For each E field, the parsers for the field value on each boundary
amrex::Vector<amrex::ParserExecutor<3>> m_Ex_parsers_lo;
amrex::Vector<amrex::ParserExecutor<3>> m_Ey_parsers_lo;
amrex::Vector<amrex::ParserExecutor<3>> m_Ez_parsers_lo;
amrex::Vector<amrex::ParserExecutor<3>> m_Ex_parsers_hi;
amrex::Vector<amrex::ParserExecutor<3>> m_Ey_parsers_hi;
amrex::Vector<amrex::ParserExecutor<3>> m_Ez_parsers_hi;

};
#endif // PEC_INSULATOR_H_
Loading
Loading