Skip to content

Commit

Permalink
Merge pull request #177 from tdegeus/test
Browse files Browse the repository at this point in the history
Checking all examples (in CI)
  • Loading branch information
tdegeus authored Feb 22, 2021
2 parents 330403b + bc062dd commit 389eefb
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 30 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ else()
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()

message(STATUS "Building GooseFEM ${GOOSEFEM_VERSION}")
message(STATUS "Building ${PROJECT_NAME} ${GOOSEFEM_VERSION}")

# Set target
# ==========
Expand Down
6 changes: 6 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ Deprecating in next version
* Mesh::Renumber::get
* Mesh::Reordered::get

New functions
-------------

* VectorPartitioned::dofs_is_u
* VectorPartitioned::dofs_is_p

Changes under the hood
----------------------

Expand Down
44 changes: 22 additions & 22 deletions docs/examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ find_package(HighFive REQUIRED)
find_package(XDMFWrite_HighFive REQUIRED)
find_package(GMatElastic REQUIRED)
find_package(GMatElastoPlastic REQUIRED)
# find_package(GMatElastoPlasticFiniteStrainSimo REQUIRED)
find_package(GMatElastoPlasticFiniteStrainSimo REQUIRED)
find_package(GMatNonLinearElastic REQUIRED)

add_library(libraries INTERFACE IMPORTED)
Expand All @@ -28,7 +28,7 @@ target_link_libraries(libraries INTERFACE
XDMFWrite_HighFive
GMatElastic
GMatElastoPlastic
# GMatElastoPlasticFiniteStrainSimo
GMatElastoPlasticFiniteStrainSimo
GMatNonLinearElastic)

if(SIMD)
Expand Down Expand Up @@ -74,34 +74,34 @@ add_test(NAME ${exec} COMMAND ${exec})

# create executable

# set(exec "statics_Periodic_ElastoPlastic_main")
# set(source "statics/Periodic_ElastoPlastic/main.cpp")
# add_executable(${exec} ${source})
# target_link_libraries(${exec} PRIVATE libraries)
# add_test(NAME ${exec} COMMAND ${exec})
set(exec "statics_Periodic_ElastoPlastic_main")
set(source "statics/Periodic_ElastoPlastic/main.cpp")
add_executable(${exec} ${source})
target_link_libraries(${exec} PRIVATE libraries)
add_test(NAME ${exec} COMMAND ${exec})

# create executable

# set(exec "statics_Periodic_ElastoPlasticFiniteStrainSimo_main")
# set(source "statics/Periodic_ElastoPlasticFiniteStrainSimo/main.cpp")
# add_executable(${exec} ${source})
# target_link_libraries(${exec} PRIVATE libraries)
# add_test(NAME ${exec} COMMAND ${exec})
set(exec "statics_Periodic_ElastoPlasticFiniteStrainSimo_main")
set(source "statics/Periodic_ElastoPlasticFiniteStrainSimo/main.cpp")
add_executable(${exec} ${source})
target_link_libraries(${exec} PRIVATE libraries)
add_test(NAME ${exec} COMMAND ${exec})

# create executable

# set(exec "statics_Periodic_LinearElastic_main")
# set(source "statics/Periodic_LinearElastic/main.cpp")
# add_executable(${exec} ${source})
# target_link_libraries(${exec} PRIVATE libraries)
# add_test(NAME ${exec} COMMAND ${exec})
set(exec "statics_Periodic_LinearElastic_main")
set(source "statics/Periodic_LinearElastic/main.cpp")
add_executable(${exec} ${source})
target_link_libraries(${exec} PRIVATE libraries)
add_test(NAME ${exec} COMMAND ${exec})

# create executable

# set(exec "statics_Periodic_NonLinearElastic_main")
# set(source "statics/Periodic_NonLinearElastic/main.cpp")
# add_executable(${exec} ${source})
# target_link_libraries(${exec} PRIVATE libraries)
# add_test(NAME ${exec} COMMAND ${exec})
set(exec "statics_Periodic_NonLinearElastic_main")
set(source "statics/Periodic_NonLinearElastic/main.cpp")
add_executable(${exec} ${source})
target_link_libraries(${exec} PRIVATE libraries)
add_test(NAME ${exec} COMMAND ${exec})


Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ int main()

// material model
// even though the problem is 2-d, the material model is 3-d, plane strain is implicitly assumed
GM::Matrix mat(nelem, nip);
size_t tdim = mat.ndim();
GM::Array<2> mat({nelem, nip});
size_t tdim = 3;

// some artificial material definition
xt::xtensor<size_t, 1> ehard = xt::ravel(xt::view(elmat, xt::range(0, 2), xt::range(0, 2)));
Expand Down Expand Up @@ -137,7 +137,9 @@ int main()
F += I2;

// stress & tangent
mat.tangent(F, Sig, C);
mat.setDefGrad(F);
mat.stress(Sig);
mat.tangent(C);

// internal force
elem.int_gradN_dot_tensor2_dV(Sig, fe);
Expand Down Expand Up @@ -194,7 +196,7 @@ int main()
disp += du;

// update shape functions
elem.update_x(vector.AsElement(coor + disp));
elem.update_x(vector.AsElement(xt::eval(coor + disp)));
}

// post-process
Expand All @@ -203,7 +205,8 @@ int main()
elem0.gradN_vector_T(ue, F);
F += I2;
GM::strain(F, Eps);
mat.stress(F, Sig);
mat.setDefGrad(F);
mat.stress(Sig);
// - integration point volume
xt::xtensor<double, 4> dV = elem.AsTensor<2>(elem.dV());
// - element average stress
Expand All @@ -215,8 +218,8 @@ int main()
// - write to output-file: increment numbers
H5::dump(file, "/stored", inc, {inc});
// - write to output-file: macroscopic response
H5::dump(file, "/macroscopic/sigeq", GM::Sigeq(Sigbar), {inc});
H5::dump(file, "/macroscopic/epseq", GM::Epseq(Epsbar), {inc});
H5::dump(file, "/macroscopic/sigeq", GM::Sigeq(Sigbar)(), {inc});
H5::dump(file, "/macroscopic/epseq", GM::Epseq(Epsbar)(), {inc});
// - write to output-file: element quantities
H5::dump(file, "/sigeq/" + std::to_string(inc), GM::Sigeq(Sigelem));
H5::dump(file, "/epseq/" + std::to_string(inc), GM::Epseq(Epselem));
Expand Down

0 comments on commit 389eefb

Please sign in to comment.