Skip to content

Commit

Permalink
Hacky test version that works
Browse files Browse the repository at this point in the history
  • Loading branch information
larsson4 committed Feb 13, 2024
1 parent f8105c4 commit c1f34ac
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
2 changes: 2 additions & 0 deletions bin/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ int main(int argc, char *argv[])
else if (mode == "build_rom") BuildROM(MPI_COMM_WORLD);
else if (mode == "train_rom") TrainROM(MPI_COMM_WORLD);
else if (mode == "single_run") double dump = SingleRun(MPI_COMM_WORLD, output_file);
else if (mode == "test") TEMPRunAndCompare();
else if (mode == "output_operators") OutputOperators();
else
{
if (rank == 0) printf("Unknown mode %s!\n", mode.c_str());
Expand Down
4 changes: 2 additions & 2 deletions examples/linelast/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Copyright 2023 Lawrence Livermore National Security, LLC. See the top-level LICENSE file for details.
#
# SPDX-License-Identifier: MIT

file(COPY test_linelast.yml DESTINATION ${CMAKE_BINARY_DIR}/examples/linelast)
file(COPY meshes/beam-tri.mesh DESTINATION ${CMAKE_BINARY_DIR}/examples/linelast/meshes)
file(COPY meshes/beam-tet.mesh DESTINATION ${CMAKE_BINARY_DIR}/examples/linelast/meshes)

# Temporary for testing
file(COPY reference_fom/displaced_mfem_tri.mesh DESTINATION ${CMAKE_BINARY_DIR}/examples/linelast/reference_fom)
file(COPY reference_fom/displaced_mfem_tet.mesh DESTINATION ${CMAKE_BINARY_DIR}/examples/linelast/reference_fom)
file(COPY reference_fom/sol_mfem_tri.gf DESTINATION ${CMAKE_BINARY_DIR}/examples/linelast/reference_fom)
file(COPY reference_fom/sol_mfem_tet.gf DESTINATION ${CMAKE_BINARY_DIR}/examples/linelast/reference_fom)
file(COPY reference_fom/sol_mfem_tet.gf DESTINATION ${CMAKE_BINARY_DIR}/examples/linelast/reference_fom)
8 changes: 4 additions & 4 deletions include/interfaceinteg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,13 +233,13 @@ namespace mfem

PWConstCoefficient *lambda, *mu;

public:
InterfaceDGElasticityIntegrator(double alpha_, double kappa_) : alpha(alpha_), kappa(kappa_) {};

virtual void AssembleBlock(const int dim, const int row_ndofs,
static void AssembleBlock(const int dim, const int row_ndofs,
const int col_ndofs, const int row_offset, const int col_offset, const double jmatcoef,
const Vector &col_nL, const Vector &col_nM, const Vector &row_shape, const Vector &col_shape,
const Vector &col_dshape_dnM, const DenseMatrix &col_dshape, DenseMatrix &elmat, DenseMatrix &jmat);
public:
InterfaceDGElasticityIntegrator(PWConstCoefficient *lambda_, PWConstCoefficient *mu_, double alpha_, double kappa_) : lambda(lambda_), mu(mu_), alpha(alpha_), kappa(kappa_) {};


virtual void AssembleInterfaceMatrix(const FiniteElement &el1,
const FiniteElement &el2,
Expand Down
3 changes: 3 additions & 0 deletions include/linelast_solver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ class LinElastSolver : public MultiBlockSolver

virtual bool Solve();

// For testing operators
virtual void PrintOperators();

// Below are not implemented for FOM

virtual void SetupBCVariables() override;
Expand Down
2 changes: 2 additions & 0 deletions include/main_workflow.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,7 @@ void TrainROM(MPI_Comm comm);
void AuxiliaryTrainROM(MPI_Comm comm);
// return relative error if comparing solution.
double SingleRun(MPI_Comm comm, const std::string output_file = "");
void TEMPRunAndCompare();
void OutputOperators();

#endif

0 comments on commit c1f34ac

Please sign in to comment.