Skip to content

Commit

Permalink
Cleanup; only declare ISMR B field if enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
bprather committed Oct 2, 2024
1 parent 99b5b78 commit a7892f0
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 27 deletions.
22 changes: 8 additions & 14 deletions kharma/b_ct/b_ct.cpp
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
/*
/*
* File: b_ct.cpp
*
*
* BSD 3-Clause License
*
*
* Copyright (c) 2020, AFD Group at UIUC
* All rights reserved.
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
*
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Expand Down Expand Up @@ -111,12 +111,6 @@ std::shared_ptr<KHARMAPackage> B_CT::Initialize(ParameterInput *pin, std::shared
pkg->AddField("B_CT.cemf", m);
}

// INTERNAL SMR
// Hyerin (04/04/24) averaged B fields needed for ismr
// ISMR cache: not evolved, immediately copied to fluid state after averaging
m = Metadata({Metadata::Real, Metadata::Face, Metadata::Derived, Metadata::OneCopy});
pkg->AddField("ismr.fB_avg", m);

// CALLBACKS

// We implement a source term replacement, rather than addition,
Expand Down
4 changes: 0 additions & 4 deletions kharma/grmhd/grmhd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -704,10 +704,6 @@ void UpdateAveragedCtop(MeshData<Real> *md)
}
}
);

if (params.Get<bool>("excise_flux_" + bname)) {

}
}
}
}
Expand Down
23 changes: 14 additions & 9 deletions kharma/ismr/ismr.cpp
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
/*
/*
* File: ismr.cpp
*
*
* BSD 3-Clause License
*
*
* Copyright (c) 2020, AFD Group at UIUC
* All rights reserved.
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
*
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Expand Down Expand Up @@ -59,7 +59,12 @@ std::shared_ptr<KHARMAPackage> ISMR::Initialize(ParameterInput *pin, std::shared
// Incompatible with B_FluxCT due to non-local divB, yell
if (packages->AllPackages().count("B_FluxCT"))
throw std::runtime_error("Internal SMR is not compatible with Flux-CT magnetic field transport!");

// Otherwise declare a face temporary
if (packages->AllPackages().count("B_CT")) {
m = Metadata({Metadata::Real, Metadata::Face, Metadata::Derived, Metadata::OneCopy});
pkg->AddField("ismr.fB_avg", m);
}

// Incompatible with 2D simulations
if (pin->GetInteger("parthenon/meshblock", "nx3") == 1)
throw std::runtime_error("Internal SMR is not compatible with 2D blocks or meshes!");
Expand Down

0 comments on commit a7892f0

Please sign in to comment.