Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
a7fa4fc
Started implementation of steady state solvers, equation systemss and…
TheBEllis Oct 6, 2023
6ff50f7
Added missing constructor to steadyStateFormulation.
TheBEllis Oct 6, 2023
4bdfea9
Added SteadyStateFormulation include header to formulation.hpp.
TheBEllis Oct 6, 2023
88cc9d1
Further implementation of thermomech formulation
TheBEllis Oct 28, 2023
f1e9fe1
Thermal Expansion formulation now building
TheBEllis Oct 30, 2023
86aa0cd
Added thermal_expansion_formulation include to factory.hpp
TheBEllis Oct 30, 2023
4713415
Added thermalExpansion example to examples
TheBEllis Oct 30, 2023
d232e99
Added thermalExpansion example to examples CMakeLists
TheBEllis Oct 30, 2023
ec3e1ff
Updated thermalExpansion formulation
TheBEllis Oct 30, 2023
59004e2
Added in constant value dirichlet bc's
TheBEllis Oct 30, 2023
de31e4d
Changed thermal expansion formulations to match new syntax after rebase
TheBEllis Oct 30, 2023
8d20dc3
Added steady_state_formulation include to formulation.hpp
TheBEllis Oct 30, 2023
448d913
thermal_expansion_formulation include to factory.hpp
TheBEllis Oct 30, 2023
8a708e5
Started added hephaestus boundary conditions to ThermalExpansionExample
TheBEllis Oct 30, 2023
04735b7
Updated boundary conditions in ThermalExpansionExample
TheBEllis Oct 31, 2023
cd29d62
Updated essential_bcs hpp to include dirichlet conditions
TheBEllis Oct 31, 2023
7ccf5cb
Added comments to describe inner product of MixedWeakDivergenceIntegr…
TheBEllis Nov 1, 2023
f283f81
Added integrators.hpp to get all integrator includes in one place, an…
TheBEllis Nov 1, 2023
110d331
Fixed coefficients in ThermalExpansionFormulation
TheBEllis Nov 1, 2023
66f0c36
Added simple_cube mesh to data to be used in ThermalExpansionExample
TheBEllis Nov 1, 2023
acef823
Renamed thermal expansion example folder and main file to fit with ot…
TheBEllis Nov 1, 2023
f286eda
Rebased on master
TheBEllis Nov 8, 2023
1a67edb
Revert "Renamed thermal expansion example folder and main file to fit…
TheBEllis Nov 8, 2023
84c7429
Deleted wrongly added Paraview files
TheBEllis Nov 8, 2023
07556e1
Added ConstructEquationSystem method to SteadyStateProblemBuilder
TheBEllis Nov 29, 2023
50a86bf
Implemented necessary hephaestus kernels for thermal expansion solve
TheBEllis Nov 29, 2023
e097f10
Implemented ThermalExpansionEquationSystem in ThermalExpansion formul…
TheBEllis Nov 29, 2023
f629091
Updated InitializeKernels method in steady_state_problem_builder to u…
TheBEllis Nov 30, 2023
5f44da1
Added SetEquationSystem method to equation_system_operator.cpp
TheBEllis Nov 30, 2023
c060325
Implemented hephaestus equation system functionality into thermal exp…
TheBEllis Nov 30, 2023
195312d
updated thermal expansion example to use hephaestus equation_system f…
TheBEllis Nov 30, 2023
baaf0fc
Made APPLY_TYPE enum public in vector dirichlet bc, so that it is acc…
TheBEllis Nov 30, 2023
1e092a7
Fixed spelling mistake in linear elasticity kernel
TheBEllis Nov 30, 2023
5c90645
Removed old commented out code
TheBEllis Nov 30, 2023
4446284
Corrected coefficient setup
TheBEllis Dec 4, 2023
06b094c
updated thermal expansion example
TheBEllis Dec 4, 2023
580c545
Removed wrongly included -1 multiplier in mixedweakdivergence integrator
TheBEllis Dec 4, 2023
1623f2f
Added domain_lf_kernel include to kernels.hpp
TheBEllis Dec 4, 2023
ea234d3
Fixed wrong integrator being used in mixed_weak_divergence_kernel
TheBEllis Dec 4, 2023
298db60
Renamed thermal expansion example src file to match other examples
TheBEllis Dec 4, 2023
e44e6a2
Removed CMakeFiles commits
TheBEllis Dec 4, 2023
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
Binary file added data/simple_cube.g
Binary file not shown.
3 changes: 2 additions & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ add_subdirectory(team7)
add_subdirectory(complex_team7)
add_subdirectory(closed_coil)
add_subdirectory(open_coil)
add_subdirectory(magnetostatic)
add_subdirectory(magnetostatic)
add_subdirectory(thermal_expansion)
23 changes: 23 additions & 0 deletions examples/thermal_expansion/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
file(GLOB_RECURSE example_src "*.cpp")

file(GLOB_RECURSE test_src_files "${PROJECT_SOURCE_DIR}/src/*.h" "${PROJECT_SOURCE_DIR}/src/*.hpp" "${PROJECT_SOURCE_DIR}/src/*.cpp")

set (${PROJECT_NAME}_INCLUDE_DIRS "")
foreach (_srcFile ${test_src_files})
get_filename_component(_dir ${_srcFile} PATH)
list (APPEND ${PROJECT_NAME}_INCLUDE_DIRS ${_dir})
endforeach()
list (REMOVE_DUPLICATES ${PROJECT_NAME}_INCLUDE_DIRS)


add_executable(thermalexpansion ${example_src})
add_compile_options(thermalexpansion ${BUILD_TYPE_COMPILER_FLAGS})
target_include_directories(thermalexpansion PUBLIC ${MFEM_COMMON_INCLUDES} ${MFEM_INCLUDE_DIRS})
target_include_directories(thermalexpansion PUBLIC ${${PROJECT_NAME}_INCLUDE_DIRS})
target_include_directories(thermalexpansion PUBLIC ${PROJECT_SOURCE_DIR}/data/)

set_property(TARGET thermalexpansion PROPERTY CXX_STANDARD 17)

target_link_libraries(thermalexpansion ${GTEST_LIBRARY} ${GTEST_MAIN_LIBRARY} pthread)
target_link_libraries(thermalexpansion ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/lib${PROJECT_NAME}.so)
target_link_libraries(thermalexpansion ${MFEM_LIBRARIES} ${MFEM_COMMON_LIBRARY} -lrt)
120 changes: 120 additions & 0 deletions examples/thermal_expansion/Main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
#include "hephaestus.hpp"

const char *DATA_DIR = "../../data/";

hephaestus::Coefficients defineCoefficients(){

hephaestus::Coefficients coefficients;

coefficients.scalars.Register("thermal_expansion_coef",
new mfem::ConstantCoefficient(1e-04),
true);

coefficients.scalars.Register("thermal_conductivity",
new mfem::ConstantCoefficient(300),
true);

coefficients.scalars.Register("lame_param",
new mfem::ConstantCoefficient(10),
true);

coefficients.scalars.Register("shear_modulus",
new mfem::ConstantCoefficient(10),
true);

coefficients.scalars.Register("stress_free_temp",
new mfem::ConstantCoefficient(250),
true);

coefficients.scalars.Register("zero",
new mfem::ConstantCoefficient(0.0),
true);


return coefficients;
}

hephaestus::Outputs defineOutputs() {
// std::map<std::string, mfem::DataCollection *> data_collections;
// data_collections["ParaViewDataCollection"] =
// new mfem::ParaViewDataCollection("ThermalExpansionExample");
hephaestus::Outputs outputs;
outputs.Register("Paraview", new mfem::ParaViewDataCollection("ThermalExpansionExample"), true);
return outputs;
}


hephaestus::BCMap defineBoundaries() {

hephaestus::BCMap boundaries;
mfem::ConstantCoefficient *cold = new mfem::ConstantCoefficient(300.00);
mfem::ConstantCoefficient *hot = new mfem::ConstantCoefficient(500.00);
// mfem::VectorConstantCoefficient *zero = new mfem::VectorConstantCoefficient(mfem::Vector({0, 0, 0}));
mfem::Array<int> therm_bound_one_arr(1);
mfem::Array<int> therm_bound_two_arr(1);
mfem::Array<int> fixed_disp_arr(1);

therm_bound_one_arr = 1;
therm_bound_two_arr = 2;
fixed_disp_arr = 1;

boundaries.Register("thermal_boundary_one", new hephaestus::DirichletBC("temperature", therm_bound_one_arr, cold), true);
boundaries.Register("thermal_boundary_two", new hephaestus::DirichletBC("temperature", therm_bound_two_arr, hot), true);
boundaries.Register("fixed_displacement", new hephaestus::VectorDirichletBC("displacement", fixed_disp_arr, new mfem::VectorConstantCoefficient(mfem::Vector({0, 0, 0})), nullptr, hephaestus::VectorDirichletBC::APPLY_TYPE::STANDARD), true);

return boundaries;
}


int main(int argc, char *argv[]) {
mfem::OptionsParser args(argc, argv);
args.AddOption(&DATA_DIR, "-dataDir", "--data_directory",
"Directory storing input data for tests.");
args.Parse();
MPI_Init(&argc, &argv);

// Create Formulation
hephaestus::SteadyStateProblemBuilder *problem_builder = new hephaestus::ThermalExpansionFormulation();
// Set Mesh
mfem::Mesh mesh((std::string(DATA_DIR) + std::string("./simple_cube.g")).c_str(), 1,
1);
std::shared_ptr<mfem::ParMesh> pmesh =
std::make_shared<mfem::ParMesh>(mfem::ParMesh(MPI_COMM_WORLD, mesh));
problem_builder->SetMesh(pmesh);
problem_builder->AddFESpace(std::string("H1"), std::string("H1_3D_P1"));
problem_builder->AddFESpace(std::string("H1_3"), std::string("H1_3D_P1"), 3, mfem::Ordering::byVDIM);

problem_builder->AddGridFunction(std::string("temperature"),
std::string("H1"));
problem_builder->AddGridFunction(std::string("displacement"),
std::string("H1_3"));

hephaestus::Coefficients coefficients = defineCoefficients();
problem_builder->SetCoefficients(coefficients);

hephaestus::Outputs outputs = defineOutputs();
problem_builder->SetOutputs(outputs);

hephaestus::BCMap boundaries = defineBoundaries();
problem_builder->SetBoundaryConditions(boundaries);

hephaestus::InputParameters solver_options;
solver_options.SetParam("Tolerance", float(1.0e-5));
solver_options.SetParam("MaxIter", (unsigned int)1000);
solver_options.SetParam("PrintLevel", 0);
problem_builder->SetSolverOptions(solver_options);

hephaestus::ProblemBuildSequencer sequencer(problem_builder);
sequencer.ConstructEquationSystemProblem();
std::unique_ptr<hephaestus::SteadyStateProblem> problem =
problem_builder->ReturnProblem();
hephaestus::InputParameters exec_params;
exec_params.SetParam("Problem", problem.get());
hephaestus::SteadyExecutioner *executioner =
new hephaestus::SteadyExecutioner(exec_params);

mfem::out << "Created executioner";
executioner->Execute();

MPI_Finalize();
}
Loading