Skip to content

Commit

Permalink
Merge pull request #336 from polyfem/pr_pressure_optimization
Browse files Browse the repository at this point in the history
Add new optimization objectives and parametrizations
  • Loading branch information
arvigj committed Jun 13, 2024
2 parents 115bcd8 + b1be302 commit 510d213
Show file tree
Hide file tree
Showing 55 changed files with 5,216 additions and 521 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,10 @@ target_link_libraries(polyfem PUBLIC simple_bvh::simple_bvh)
include(mshio)
target_link_libraries(polyfem PUBLIC mshio)

# Nanospline
include(nanospline)
target_link_libraries(polyfem PUBLIC nanospline)

# Geogram
include(geogram)
target_link_libraries(polyfem PUBLIC geogram)
Expand Down
13 changes: 13 additions & 0 deletions cmake/recipes/nanospline.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Nanospline (https://github.com/qnzhou/nanospline)
# License: Mozilla Public License 2.0

if(TARGET nanospline)
return()
endif()

message(STATUS "Third-party: creating target 'nanospline'")

option(NANOSPLINE_BUILD_TESTS "Build Tests" OFF)

include(CPM)
CPMAddPackage("gh:qnzhou/nanospline#de2e4d4daceb5e5058ea3092ddf1c6e5ba447c38")
2 changes: 1 addition & 1 deletion cmake/recipes/polyfem_data.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ else()
PREFIX ${FETCHCONTENT_BASE_DIR}/polyfem-test-data
SOURCE_DIR ${POLYFEM_DATA_DIR}
GIT_REPOSITORY https://github.com/polyfem/polyfem-data
GIT_TAG fbfcf330e3a5725414917c9fa33e5a2476a754a7
GIT_TAG 0a722d760163b1dc9178b306e631102bbc9ad845
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
Expand Down
39 changes: 33 additions & 6 deletions json-specs/input-spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -2056,13 +2056,13 @@
"pointer": "/materials/*/c3",
"type": "include",
"spec_file": "value-no.json",
"doc": "Third Parameter for 3 parameter Mooney-Rivlin"
"doc": "Third Parameter for Mooney-Rivlin"
},
{
"pointer": "/materials/*/d1",
"type": "include",
"spec_file": "value-no.json",
"doc": "MooneyRivlin third parameterFourth Parameter for 3 parameter Mooney-Rivlin"
"doc": "Fourth Parameter for Mooney-Rivlin"
},
{
"pointer": "/materials/*/alphas",
Expand Down Expand Up @@ -2271,6 +2271,17 @@
"type": "string",
"doc": "Dirichlet boundary condition loaded from a file, <node_id> <bc values>, 1 for scalar, 2/3 for tensor depending on dimension."
},
{
"pointer": "/boundary_conditions/dirichlet_boundary/*/value/*",
"type": "list",
"doc": "Dirichlet boundary condition specified per timestep."
},
{
"pointer": "/boundary_conditions/dirichlet_boundary/*/value/*/*",
"type": "include",
"spec_file": "value0.json",
"doc": "Dirichlet boundary condition specified per timestep."
},
{
"pointer": "/boundary_conditions/dirichlet_boundary/*/dimension",
"type": "list",
Expand Down Expand Up @@ -2370,7 +2381,7 @@
"value"
],
"optional": [
"interpolation"
"time_reference"
],
"doc": "pressure BC entry"
},
Expand All @@ -2388,10 +2399,26 @@
"doc": "Values of pressure boundary condition as a function of $x,y,z,t$"
},
{
"pointer": "/boundary_conditions/pressure_boundary/*/interpolation",
"pointer": "/boundary_conditions/pressure_boundary/*/value",
"type": "list",
"doc": "Values of pressure boundary condition specified per timestep"
},
{
"pointer": "/boundary_conditions/pressure_boundary/*/value/*",
"type": "include",
"spec_file": "interpolation.json",
"doc": "interpolation of boundary condition"
"spec_file": "value0.json",
"doc": "Values of pressure boundary condition specified per timestep"
},
{
"pointer": "/boundary_conditions/pressure_boundary/*/time_reference",
"default": [],
"type": "list",
"doc": "List of times when the pressure boundary condition is specified"
},
{
"pointer": "/boundary_conditions/pressure_boundary/*/time_reference/*",
"type": "float",
"doc": "Values of pressure boundary condition for timestep"
},
{
"pointer": "/boundary_conditions/pressure_cavity",
Expand Down
133 changes: 125 additions & 8 deletions json-specs/objective-spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@
"divide",
"plus-const",
"target",
"sdf-target",
"mesh-target",
"center-target",
"function-target",
"displacement-target",
"node-target",
"position",
"acceleration",
Expand All @@ -19,6 +22,8 @@
"stress",
"stress_norm",
"elastic_energy",
"quadratic_contact_force_norm",
"log_contact_force_norm",
"max_stress",
"compliance",
"weighted_solution",
Expand All @@ -31,6 +36,7 @@
"volume",
"soft_constraint",
"layer_thickness",
"layer_thickness_log",
"AMIPS",
"parametrized_product"
],
Expand Down Expand Up @@ -98,6 +104,44 @@
],
"doc": "TODO"
},
{
"pointer": "/",
"type": "object",
"type_name": "sdf-target",
"required": [
"state",
"type",
"delta"
],
"optional": [
"control_points",
"control_points_grid",
"knots",
"knots_u",
"knots_v",
"weight",
"print_energy",
"surface_selection"
],
"doc": "TODO"
},
{
"pointer": "/",
"type": "object",
"type_name": "mesh-target",
"required": [
"state",
"type",
"delta",
"mesh_path"
],
"optional": [
"weight",
"print_energy",
"surface_selection"
],
"doc": "TODO"
},
{
"pointer": "/",
"type": "object",
Expand Down Expand Up @@ -148,6 +192,23 @@
],
"doc": "TODO"
},
{
"pointer": "/",
"type": "object",
"type_name": "displacement-target",
"required": [
"state",
"type"
],
"optional": [
"weight",
"print_energy",
"target_displacement",
"active_dimension",
"surface_selection"
],
"doc": "TODO"
},
{
"pointer": "/",
"type": "object",
Expand Down Expand Up @@ -571,6 +632,38 @@
],
"doc": "Lp Norm of elastic stress over the volume selection"
},
{
"pointer": "/",
"type": "object",
"type_name": "quadratic_contact_force_norm",
"required": [
"state",
"type"
],
"optional": [
"surface_selection",
"dhat",
"weight",
"print_energy"
],
"doc": "Lp Norm of elastic stress over the volume selection"
},
{
"pointer": "/",
"type": "object",
"type_name": "log_contact_force_norm",
"required": [
"state",
"type"
],
"optional": [
"surface_selection",
"dhat",
"weight",
"print_energy"
],
"doc": "Lp Norm of elastic stress over the volume selection"
},
{
"pointer": "/force_matching_function",
"type": "list"
Expand Down Expand Up @@ -730,9 +823,29 @@
"pointer": "/",
"type": "object",
"type_name": "layer_thickness",
"required": [
"type",
"state"
],
"optional": [
"adjacent_boundary_id",
"dmin",
"boundary_ids",
"dhat",
"weight",
"print_energy"
],
"doc": "TODO"
},
{
"pointer": "/",
"type": "object",
"type_name": "layer_thickness_log",
"required": [
"type",
"state",
"dmin"
],
"optional": [
"boundary_ids",
"dhat",
"weight",
"print_energy"
Expand All @@ -746,15 +859,19 @@
"doc": "The support size of barrier function"
},
{
"pointer": "/adjacent_boundary_id",
"type": "int",
"default": -1,
"pointer": "/dmin",
"type": "float",
"doc": "The min distance of barrier function"
},
{
"pointer": "/boundary_ids",
"type": "list",
"default": [],
"doc": "TODO"
},
{
"pointer": "/dmin",
"type": "float",
"default": 0.0,
"pointer": "/boundary_ids/*",
"type": "int",
"doc": "TODO"
},
{
Expand Down
Loading

0 comments on commit 510d213

Please sign in to comment.