Skip to content

Commit

Permalink
Got the optimization running and all tes passingts with minimal changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Idrishab committed Oct 2, 2024
1 parent bded32b commit df17494
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 12 deletions.
11 changes: 7 additions & 4 deletions src/common/data_logging.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,13 @@ class ParaViewLogger
double time,
int rank)
{
fields.at(fieldname)->SetFromTrueDofs(state);
pv.SetCycle(timestep);
pv.SetTime(time);
pv.Save();
if (fields.count(fieldname) > 0)
{
fields.at(fieldname)->SetFromTrueDofs(state);
pv.SetCycle(timestep);
pv.SetTime(time);
pv.Save();
}
}

void registerField(const std::string &name, mfem::ParGridFunction &field)
Expand Down
9 changes: 5 additions & 4 deletions src/physics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ set(MISO_PHYSICS_HEADERS
physics.hpp
)


target_sources(miso
PRIVATE
common_outputs.cpp
Expand All @@ -27,10 +28,10 @@ target_sources(miso
${MISO_PHYSICS_HEADERS}
)

# get_target_property(MACH_PUBLIC_HEADERS mach PUBLIC_HEADER)
# set(MACH_PUBLIC_HEADERS ${MACH_PUBLIC_HEADERS} ${MACH_PHYSICS_HEADERS})
# set_target_properties(mach PROPERTIES
# PUBLIC_HEADER "${MACH_PUBLIC_HEADERS}"
# get_target_property(MISO_PUBLIC_HEADERS miso PUBLIC_HEADER)
# set(MISO_PUBLIC_HEADERS ${MISO_PUBLIC_HEADERS} ${MISO_PHYSICS_HEADERS})
# set_target_properties(miso PROPERTIES
# PUBLIC_HEADER "${MISO_PUBLIC_HEADERS}"
# )

add_public_headers_to_target(miso "${MISO_PHYSICS_HEADERS}")
Expand Down
6 changes: 6 additions & 0 deletions src/physics/electromagnetics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ target_sources(miso
${MISO_PHYSICS_ELECTROMAGNETICS_HEADERS}
)

# get_target_property(MISO_PUBLIC_HEADERS miso PUBLIC_HEADER)
# set(MISO_PUBLIC_HEADERS ${MISO_PUBLIC_HEADERS} ${MISO_PHYSICS_ELECTROMAGNETICS_HEADERS})
# set_target_properties(miso PROPERTIES
# PUBLIC_HEADER "${MISO_PUBLIC_HEADERS}"
# )

add_public_headers_to_target(miso "${MISO_PHYSICS_ELECTROMAGNETICS_HEADERS}")

target_include_directories(miso
Expand Down
6 changes: 3 additions & 3 deletions src/physics/electromagnetics/electromag_integ.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ void NonlinearDiffusionIntegratorMeshRevSens::AssembleRHSElementVect(

/// const double pointflux_norm = pointflux.Norml2();
pointflux_bar = 0.0;
if (fabs(pointflux_norm) > 1e-14)
if (fabs(pointflux_norm) > 1e-16)
{
add(pointflux_bar,
pointflux_norm_bar / pointflux_norm,
Expand Down Expand Up @@ -1651,14 +1651,14 @@ void DGInteriorFaceDiffusionIntegratorMeshRevSens::AssembleRHSElementVect(

/// const double ip_flux2_norm = ip_flux2.Norml2();
ip_flux2_bar = 0.0;
if (fabs(ip_flux2_norm) > 1e-14)
if (fabs(ip_flux2_norm) > 1e-16)
{
ip_flux2_bar.Add(ip_flux2_norm_bar / ip_flux2_norm, ip_flux2);
}

/// const double ip_flux1_norm = ip_flux1.Norml2();
ip_flux1_bar = 0.0;
if (fabs(ip_flux1_norm) > 1e-14)
if (fabs(ip_flux1_norm) > 1e-16)
{
ip_flux1_bar.Add(ip_flux1_norm_bar / ip_flux1_norm, ip_flux1);
}
Expand Down
2 changes: 2 additions & 0 deletions src/physics/physics.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
#include "electromagnetics/electromagnetics.hpp"
#include "fluidflow/fluidflow.hpp"
#include "thermal/thermal.hpp"
#include "joule/joule.hpp"
#include "diag_mass_integ.hpp"
#include "miso_input.hpp"
#include "miso_integrator.hpp"
#include "solver.hpp"

#endif
2 changes: 1 addition & 1 deletion src/physics/thermal/temp_integ.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define MISO_TEMP_INTEGRATOR

#include "mfem.hpp"
//#include "solver.hpp"
#include "solver.hpp"

namespace miso
{
Expand Down

0 comments on commit df17494

Please sign in to comment.