{"id":26005398,"url":"https://github.com/precice/comsol-adapter","last_synced_at":"2025-07-23T09:36:35.640Z","repository":{"id":144913473,"uuid":"90967876","full_name":"precice/comsol-adapter","owner":"precice","description":"preCICE-adapter for the FEM code COMSOL Multi-Physics (currently unmaintained)","archived":false,"fork":false,"pushed_at":"2020-02-15T12:06:52.000Z","size":28,"stargazers_count":3,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-08T15:21:17.542Z","etag":null,"topics":["co-simulation","fem","fluid-structure-interaction","fsi","multi-physics","precice","precice-adapter"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/precice.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-05-11T10:36:01.000Z","updated_at":"2023-11-12T17:14:58.000Z","dependencies_parsed_at":"2023-07-09T05:31:43.564Z","dependency_job_id":null,"html_url":"https://github.com/precice/comsol-adapter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/precice/comsol-adapter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/precice%2Fcomsol-adapter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/precice%2Fcomsol-adapter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/precice%2Fcomsol-adapter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/precice%2Fcomsol-adapter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/precice","download_url":"https://codeload.github.com/precice/comsol-adapter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/precice%2Fcomsol-adapter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266655714,"owners_count":23963554,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["co-simulation","fem","fluid-structure-interaction","fsi","multi-physics","precice","precice-adapter"],"created_at":"2025-03-05T20:53:52.979Z","updated_at":"2025-07-23T09:36:35.612Z","avatar_url":"https://github.com/precice.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# preCICE-adapter for the FEM code COMSOL Multi-Physics\n\nThis folder contains files to use COMSOL as the structural solver in an FSI simulation.\nSince it was not possible to directly couple the C++ coded preCICE to the COMSOL\nAPI, we used FSI\\*ce as intermediate communication/data library. There are, hence,\ntwo important files: `comsol_simulation.c`, the interface with the COMSOL API, which uses\nFSI\\*ce to communicate the data to the intermediate (executable) component \n`ComsolPrecice.c`. `ComsolPrecice` uses FSI\\*ce to exchange data with \n`comsol_simulation`, and preCICE for the actual coupling.\n\nOnly 2D simulations have been done so far. For 3D, several changes to \n`comsol_simulation.c` and some to `ComsolPrecice.c` have to be done. \n\n\n\n## How to compile the files?\n\nThe compilation is done by SCons, check the SConstruct script for detailed \ninformation on the build variables. There is a debug and a release mode.\n\n`comsol_simulation.c` is compiled and linked into a shared object (.so). For that,\nit needs (among others) the pathes to the COMSOL installation, and the FSI\\*ce\nlibraries. These paths are hardcoded in the SConstruct file.\n\n`ComsolPrecice.c` is compiled into an executable. For that, it needs (among others)\nthe pathes to the FSI\\*ce libraries and the preCICE library. \n\n\n\n## How to run COMSOL for FSI simulations?\n\nThere are two executables to be run (in any order). The Comsol script needs to be \nrun as follows\n\n$ comsol script simulation\n\nThe keyword \"simulation\" tells the COMSOL script to run the simulation.m file in the\ncurrent directory. It can also be omitted and given in the scripting GUI. To run\nCOMSOL script without GUI, type\n\n$ comsol script -term\n\nWait until comsol started, then type \n\n$\u003e flreport('off')\n$\u003e simulation\n\nTo run `ComsolPrecice`, type\n\n\u003e ./ComsolPrecice Comsol precice_config.xml\n\nWhere COMSOL gives the name of the participant to preCICE, and precice_config.xml\ntells preCICE where to find the coupling configuration.\n\nHINT: Sometimes, after killing the COMSOL script, it happens that COMSOL starts, but\n      doesn't load the simulation.m file. It suffices to close and restart it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprecice%2Fcomsol-adapter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprecice%2Fcomsol-adapter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprecice%2Fcomsol-adapter/lists"}