<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://e6.ijs.si/medusa/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=E6WikiAdmin</id>
		<title>Medusa: Coordinate Free Mehless Method implementation - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://e6.ijs.si/medusa/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=E6WikiAdmin"/>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php/Special:Contributions/E6WikiAdmin"/>
		<updated>2026-04-10T15:20:46Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.27.1</generator>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=List_of_wiki_contributors&amp;diff=3602</id>
		<title>List of wiki contributors</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=List_of_wiki_contributors&amp;diff=3602"/>
				<updated>2024-01-22T17:29:38Z</updated>
		
		<summary type="html">&lt;p&gt;E6WikiAdmin: /* Active */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Active ==&lt;br /&gt;
* [http://comms.ijs.si/~gkosec/ Gregor Kosec ] (Head of the Parallel and distributed systems laboratory) &lt;br /&gt;
* [https://e6.ijs.si/ParallelAndDistributedSystems/people/mjancic/ Mitja Jančič] (post-doc)&lt;br /&gt;
* [https://e6.ijs.si/ParallelAndDistributedSystems/people/mrot/ Miha Rot] (PhD Student)&lt;br /&gt;
* [https://e6.ijs.si/ParallelAndDistributedSystems/people/apozun/ Andrej Kolar - Požun] (PhD Student)&lt;br /&gt;
* [https://e6.ijs.si/ParallelAndDistributedSystems/people/fstrnisa/ Filip Strniša] (post-doc)&lt;br /&gt;
* [http://e6.ijs.si/~matjaz/ Matjaž Depolli] (senior research associate)&lt;br /&gt;
&lt;br /&gt;
== Felt bored and moved on ==&lt;br /&gt;
* [https://e6.ijs.si/ParallelAndDistributedSystems/people/jslak/ Jure Slak] (last seen at Google)&lt;br /&gt;
* Anja Petković (last seen as PhD student at FMF)&lt;br /&gt;
* Ivan Pribec (PhD student at TUM)&lt;br /&gt;
* Jure Lapajne (last seen working on master's thesis at FMF)&lt;br /&gt;
* Matjaž Ličar (last seen at Slovenian Environmental Agency)&lt;br /&gt;
* Maks Kolman (last seen at Google)&lt;br /&gt;
* Blaž Stojanovič&lt;br /&gt;
* Anja Pirnat (last seen working on master's thesis at FMF)&lt;br /&gt;
* Jure Močnik - Berljavac (last seen working on master's thesis at FMF)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''JSI - Jozef Stefan Institute&lt;br /&gt;
&lt;br /&gt;
''FMF - Faculty of Mathematics and Physics, University of Ljubljana&lt;br /&gt;
&lt;br /&gt;
''TUM - Technische Universität München''&lt;/div&gt;</summary>
		<author><name>E6WikiAdmin</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=List_of_wiki_contributors&amp;diff=3601</id>
		<title>List of wiki contributors</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=List_of_wiki_contributors&amp;diff=3601"/>
				<updated>2024-01-22T17:29:23Z</updated>
		
		<summary type="html">&lt;p&gt;E6WikiAdmin: /* Active */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Active ==&lt;br /&gt;
* [http://comms.ijs.si/~gkosec/ Gregor Kosec ] (Head of the Parallel and distributed systems laboratory) &lt;br /&gt;
* [https://e6.ijs.si/ParallelAndDistributedSystems/people/mrot/ Miha Rot] (PhD Student)&lt;br /&gt;
* [https://e6.ijs.si/ParallelAndDistributedSystems/people/apozun/ Andrej Kolar - Požun] (PhD Student)&lt;br /&gt;
* [https://e6.ijs.si/ParallelAndDistributedSystems/people/fstrnisa/ Filip Strniša] (post-doc)&lt;br /&gt;
* [http://e6.ijs.si/~matjaz/ Matjaž Depolli] (senior research associate)&lt;br /&gt;
* [https://e6.ijs.si/ParallelAndDistributedSystems/people/mjancic/ Mitja Jančič] (post-doc)&lt;br /&gt;
&lt;br /&gt;
== Felt bored and moved on ==&lt;br /&gt;
* [https://e6.ijs.si/ParallelAndDistributedSystems/people/jslak/ Jure Slak] (last seen at Google)&lt;br /&gt;
* Anja Petković (last seen as PhD student at FMF)&lt;br /&gt;
* Ivan Pribec (PhD student at TUM)&lt;br /&gt;
* Jure Lapajne (last seen working on master's thesis at FMF)&lt;br /&gt;
* Matjaž Ličar (last seen at Slovenian Environmental Agency)&lt;br /&gt;
* Maks Kolman (last seen at Google)&lt;br /&gt;
* Blaž Stojanovič&lt;br /&gt;
* Anja Pirnat (last seen working on master's thesis at FMF)&lt;br /&gt;
* Jure Močnik - Berljavac (last seen working on master's thesis at FMF)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''JSI - Jozef Stefan Institute&lt;br /&gt;
&lt;br /&gt;
''FMF - Faculty of Mathematics and Physics, University of Ljubljana&lt;br /&gt;
&lt;br /&gt;
''TUM - Technische Universität München''&lt;/div&gt;</summary>
		<author><name>E6WikiAdmin</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=List_of_wiki_contributors&amp;diff=3600</id>
		<title>List of wiki contributors</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=List_of_wiki_contributors&amp;diff=3600"/>
				<updated>2024-01-22T17:29:12Z</updated>
		
		<summary type="html">&lt;p&gt;E6WikiAdmin: /* Felt bored and moved on */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Active ==&lt;br /&gt;
* [http://comms.ijs.si/~gkosec/ Gregor Kosec ] (Head of the Parallel and distributed systems laboratory) &lt;br /&gt;
* [https://e6.ijs.si/ParallelAndDistributedSystems/people/mrot/ Miha Rot] (PhD Student)&lt;br /&gt;
* [https://e6.ijs.si/ParallelAndDistributedSystems/people/apozun/ Andrej Kolar - Požun] (PhD Student)&lt;br /&gt;
* [https://e6.ijs.si/ParallelAndDistributedSystems/people/fstrnisa/ Filip Strniša] (post-doc)&lt;br /&gt;
* [http://e6.ijs.si/~matjaz/ Matjaž Depolli] (senior research associate)&lt;br /&gt;
&lt;br /&gt;
== Felt bored and moved on ==&lt;br /&gt;
* [https://e6.ijs.si/ParallelAndDistributedSystems/people/jslak/ Jure Slak] (last seen at Google)&lt;br /&gt;
* Anja Petković (last seen as PhD student at FMF)&lt;br /&gt;
* Ivan Pribec (PhD student at TUM)&lt;br /&gt;
* Jure Lapajne (last seen working on master's thesis at FMF)&lt;br /&gt;
* Matjaž Ličar (last seen at Slovenian Environmental Agency)&lt;br /&gt;
* Maks Kolman (last seen at Google)&lt;br /&gt;
* Blaž Stojanovič&lt;br /&gt;
* Anja Pirnat (last seen working on master's thesis at FMF)&lt;br /&gt;
* Jure Močnik - Berljavac (last seen working on master's thesis at FMF)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''JSI - Jozef Stefan Institute&lt;br /&gt;
&lt;br /&gt;
''FMF - Faculty of Mathematics and Physics, University of Ljubljana&lt;br /&gt;
&lt;br /&gt;
''TUM - Technische Universität München''&lt;/div&gt;</summary>
		<author><name>E6WikiAdmin</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=List_of_wiki_contributors&amp;diff=3599</id>
		<title>List of wiki contributors</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=List_of_wiki_contributors&amp;diff=3599"/>
				<updated>2024-01-22T17:28:42Z</updated>
		
		<summary type="html">&lt;p&gt;E6WikiAdmin: /* Felt bored and moved on */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Active ==&lt;br /&gt;
* [http://comms.ijs.si/~gkosec/ Gregor Kosec ] (Head of the Parallel and distributed systems laboratory) &lt;br /&gt;
* [https://e6.ijs.si/ParallelAndDistributedSystems/people/mrot/ Miha Rot] (PhD Student)&lt;br /&gt;
* [https://e6.ijs.si/ParallelAndDistributedSystems/people/apozun/ Andrej Kolar - Požun] (PhD Student)&lt;br /&gt;
* [https://e6.ijs.si/ParallelAndDistributedSystems/people/fstrnisa/ Filip Strniša] (post-doc)&lt;br /&gt;
* [http://e6.ijs.si/~matjaz/ Matjaž Depolli] (senior research associate)&lt;br /&gt;
&lt;br /&gt;
== Felt bored and moved on ==&lt;br /&gt;
* [https://e6.ijs.si/ParallelAndDistributedSystems/people/jslak/ Jure Slak] (last seen at Google)&lt;br /&gt;
* [https://e6.ijs.si/ParallelAndDistributedSystems/people/mjancic/ Mitja Jančič] &lt;br /&gt;
* Anja Petković (last seen as PhD student at FMF)&lt;br /&gt;
* Ivan Pribec (PhD student at TUM)&lt;br /&gt;
* Jure Lapajne (last seen working on master's thesis at FMF)&lt;br /&gt;
* Matjaž Ličar (last seen at Slovenian Environmental Agency)&lt;br /&gt;
* Maks Kolman (last seen at Google)&lt;br /&gt;
* Blaž Stojanovič&lt;br /&gt;
* Anja Pirnat (last seen working on master's thesis at FMF)&lt;br /&gt;
* Jure Močnik - Berljavac (last seen working on master's thesis at FMF)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''JSI - Jozef Stefan Institute&lt;br /&gt;
&lt;br /&gt;
''FMF - Faculty of Mathematics and Physics, University of Ljubljana&lt;br /&gt;
&lt;br /&gt;
''TUM - Technische Universität München''&lt;/div&gt;</summary>
		<author><name>E6WikiAdmin</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=List_of_wiki_contributors&amp;diff=3598</id>
		<title>List of wiki contributors</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=List_of_wiki_contributors&amp;diff=3598"/>
				<updated>2024-01-22T17:27:30Z</updated>
		
		<summary type="html">&lt;p&gt;E6WikiAdmin: /* Active */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Active ==&lt;br /&gt;
* [http://comms.ijs.si/~gkosec/ Gregor Kosec ] (Head of the Parallel and distributed systems laboratory) &lt;br /&gt;
* [https://e6.ijs.si/ParallelAndDistributedSystems/people/mrot/ Miha Rot] (PhD Student)&lt;br /&gt;
* [https://e6.ijs.si/ParallelAndDistributedSystems/people/apozun/ Andrej Kolar - Požun] (PhD Student)&lt;br /&gt;
* [https://e6.ijs.si/ParallelAndDistributedSystems/people/fstrnisa/ Filip Strniša] (post-doc)&lt;br /&gt;
* [http://e6.ijs.si/~matjaz/ Matjaž Depolli] (senior research associate)&lt;br /&gt;
&lt;br /&gt;
== Felt bored and moved on ==&lt;br /&gt;
* [https://e6.ijs.si/ParallelAndDistributedSystems/people/jslak/ Jure Slak] (last seen at Google)&lt;br /&gt;
* [https://e6.ijs.si/ParallelAndDistributedSystems/people/mjancic/ Mitja Jančič] &lt;br /&gt;
* Anja Petković (last seen as PhD student at FMF)&lt;br /&gt;
* Ivan Pribec (PhD student at TUM)&lt;br /&gt;
* Jure Lapajne (last seen working on master's thesis at FMF)&lt;br /&gt;
* Matjaž Ličar (last seen at Slovenian Environmental Agency)&lt;br /&gt;
* Maks Kolman (last seen at Google)&lt;br /&gt;
* Blaž Stojanovič&lt;br /&gt;
* Anja Pirnat (last seen working on master's thesis at FMF)&lt;br /&gt;
* Jure Močnik - Berljavac (last seen working on master's thesis at FMF)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''JSI - Jozef Stefan Institute&lt;br /&gt;
&lt;br /&gt;
''FMF - Faculty of Mathematics and Physics, University of Ljubljana&lt;br /&gt;
&lt;br /&gt;
''LBGT - Lehrstuhl für Brau- und Getränketechnologie''&lt;br /&gt;
&lt;br /&gt;
''TUM - Technische Universität München''&lt;/div&gt;</summary>
		<author><name>E6WikiAdmin</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=List_of_wiki_contributors&amp;diff=3597</id>
		<title>List of wiki contributors</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=List_of_wiki_contributors&amp;diff=3597"/>
				<updated>2024-01-22T17:25:25Z</updated>
		
		<summary type="html">&lt;p&gt;E6WikiAdmin: /* Felt bored and moved on */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Active ==&lt;br /&gt;
* [http://comms.ijs.si/~gkosec/ Gregor Kosec ] (Head of the Parallel and distributed systems laboratory) &lt;br /&gt;
* Miha Rot (PhD student)&lt;br /&gt;
* [http://e6.ijs.si/~matjaz/ Matjaž Depolli] (research associate)&lt;br /&gt;
&lt;br /&gt;
== Felt bored and moved on ==&lt;br /&gt;
* [https://e6.ijs.si/ParallelAndDistributedSystems/people/jslak/ Jure Slak] (last seen at Google)&lt;br /&gt;
* [https://e6.ijs.si/ParallelAndDistributedSystems/people/mjancic/ Mitja Jančič] &lt;br /&gt;
* Anja Petković (last seen as PhD student at FMF)&lt;br /&gt;
* Ivan Pribec (PhD student at TUM)&lt;br /&gt;
* Jure Lapajne (last seen working on master's thesis at FMF)&lt;br /&gt;
* Matjaž Ličar (last seen at Slovenian Environmental Agency)&lt;br /&gt;
* Maks Kolman (last seen at Google)&lt;br /&gt;
* Blaž Stojanovič&lt;br /&gt;
* Anja Pirnat (last seen working on master's thesis at FMF)&lt;br /&gt;
* Jure Močnik - Berljavac (last seen working on master's thesis at FMF)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''JSI - Jozef Stefan Institute&lt;br /&gt;
&lt;br /&gt;
''FMF - Faculty of Mathematics and Physics, University of Ljubljana&lt;br /&gt;
&lt;br /&gt;
''LBGT - Lehrstuhl für Brau- und Getränketechnologie''&lt;br /&gt;
&lt;br /&gt;
''TUM - Technische Universität München''&lt;/div&gt;</summary>
		<author><name>E6WikiAdmin</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=List_of_wiki_contributors&amp;diff=3596</id>
		<title>List of wiki contributors</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=List_of_wiki_contributors&amp;diff=3596"/>
				<updated>2024-01-22T17:24:32Z</updated>
		
		<summary type="html">&lt;p&gt;E6WikiAdmin: /* Felt bored and moved on */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Active ==&lt;br /&gt;
* [http://comms.ijs.si/~gkosec/ Gregor Kosec ] (Head of the Parallel and distributed systems laboratory) &lt;br /&gt;
* Miha Rot (PhD student)&lt;br /&gt;
* [http://e6.ijs.si/~matjaz/ Matjaž Depolli] (research associate)&lt;br /&gt;
&lt;br /&gt;
== Felt bored and moved on ==&lt;br /&gt;
* [http://e6.ijs.si/~jslak/ Jure Slak] (last seen at Google)&lt;br /&gt;
* [https://e6.ijs.si/ParallelAndDistributedSystems/people/mjancic/ Mitja Jančič] &lt;br /&gt;
* Anja Petković (last seen as PhD student at FMF)&lt;br /&gt;
* Ivan Pribec (PhD student at TUM)&lt;br /&gt;
* Jure Lapajne (last seen working on master's thesis at FMF)&lt;br /&gt;
* Matjaž Ličar (last seen at Slovenian Environmental Agency)&lt;br /&gt;
* Maks Kolman (last seen at Google)&lt;br /&gt;
* Blaž Stojanovič&lt;br /&gt;
* Anja Pirnat (last seen working on master's thesis at FMF)&lt;br /&gt;
* Jure Močnik - Berljavac (last seen working on master's thesis at FMF)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''JSI - Jozef Stefan Institute&lt;br /&gt;
&lt;br /&gt;
''FMF - Faculty of Mathematics and Physics, University of Ljubljana&lt;br /&gt;
&lt;br /&gt;
''LBGT - Lehrstuhl für Brau- und Getränketechnologie''&lt;br /&gt;
&lt;br /&gt;
''TUM - Technische Universität München''&lt;/div&gt;</summary>
		<author><name>E6WikiAdmin</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=List_of_wiki_contributors&amp;diff=3595</id>
		<title>List of wiki contributors</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=List_of_wiki_contributors&amp;diff=3595"/>
				<updated>2024-01-22T17:22:36Z</updated>
		
		<summary type="html">&lt;p&gt;E6WikiAdmin: /* Active */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Active ==&lt;br /&gt;
* [http://comms.ijs.si/~gkosec/ Gregor Kosec ] (Head of the Parallel and distributed systems laboratory) &lt;br /&gt;
* Miha Rot (PhD student)&lt;br /&gt;
* [http://e6.ijs.si/~matjaz/ Matjaž Depolli] (research associate)&lt;br /&gt;
&lt;br /&gt;
== Felt bored and moved on ==&lt;br /&gt;
* [http://e6.ijs.si/~jslak/ Jure Slak] (post-doc)&lt;br /&gt;
* Mitja Jančič (PhD student) &lt;br /&gt;
* Anja Petković (last seen as PhD student at FMF)&lt;br /&gt;
* Jure Lapajne (last seen working on master's thesis at FMF)&lt;br /&gt;
* Matjaž Ličar (last seen at Slovenian Environmental Agency)&lt;br /&gt;
* Maks Kolman (last seen at Google)&lt;br /&gt;
* Blaž Stojanovič&lt;br /&gt;
* Anja Pirnat (last seen working on master's thesis at FMF)&lt;br /&gt;
* Jure Močnik - Berljavac (last seen working on master's thesis at FMF)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''JSI - Jozef Stefan Institute&lt;br /&gt;
&lt;br /&gt;
''FMF - Faculty of Mathematics and Physics, University of Ljubljana&lt;br /&gt;
&lt;br /&gt;
''LBGT - Lehrstuhl für Brau- und Getränketechnologie''&lt;br /&gt;
&lt;br /&gt;
''TUM - Technische Universität München''&lt;/div&gt;</summary>
		<author><name>E6WikiAdmin</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=List_of_wiki_contributors&amp;diff=3594</id>
		<title>List of wiki contributors</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=List_of_wiki_contributors&amp;diff=3594"/>
				<updated>2024-01-22T17:22:29Z</updated>
		
		<summary type="html">&lt;p&gt;E6WikiAdmin: /* Felt bored and moved on */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Active ==&lt;br /&gt;
* [http://comms.ijs.si/~gkosec/ Gregor Kosec ] (Head of the Parallel and distributed systems laboratory) &lt;br /&gt;
* Miha Rot (PhD student)&lt;br /&gt;
* [http://e6.ijs.si/~matjaz/ Matjaž Depolli] (research associate)&lt;br /&gt;
* Ivan Pribec (PhD student at TUM)&lt;br /&gt;
&lt;br /&gt;
== Felt bored and moved on ==&lt;br /&gt;
* [http://e6.ijs.si/~jslak/ Jure Slak] (post-doc)&lt;br /&gt;
* Mitja Jančič (PhD student) &lt;br /&gt;
* Anja Petković (last seen as PhD student at FMF)&lt;br /&gt;
* Jure Lapajne (last seen working on master's thesis at FMF)&lt;br /&gt;
* Matjaž Ličar (last seen at Slovenian Environmental Agency)&lt;br /&gt;
* Maks Kolman (last seen at Google)&lt;br /&gt;
* Blaž Stojanovič&lt;br /&gt;
* Anja Pirnat (last seen working on master's thesis at FMF)&lt;br /&gt;
* Jure Močnik - Berljavac (last seen working on master's thesis at FMF)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''JSI - Jozef Stefan Institute&lt;br /&gt;
&lt;br /&gt;
''FMF - Faculty of Mathematics and Physics, University of Ljubljana&lt;br /&gt;
&lt;br /&gt;
''LBGT - Lehrstuhl für Brau- und Getränketechnologie''&lt;br /&gt;
&lt;br /&gt;
''TUM - Technische Universität München''&lt;/div&gt;</summary>
		<author><name>E6WikiAdmin</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=List_of_wiki_contributors&amp;diff=3593</id>
		<title>List of wiki contributors</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=List_of_wiki_contributors&amp;diff=3593"/>
				<updated>2024-01-22T17:22:17Z</updated>
		
		<summary type="html">&lt;p&gt;E6WikiAdmin: /* Active */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Active ==&lt;br /&gt;
* [http://comms.ijs.si/~gkosec/ Gregor Kosec ] (Head of the Parallel and distributed systems laboratory) &lt;br /&gt;
* Miha Rot (PhD student)&lt;br /&gt;
* [http://e6.ijs.si/~matjaz/ Matjaž Depolli] (research associate)&lt;br /&gt;
* Ivan Pribec (PhD student at TUM)&lt;br /&gt;
&lt;br /&gt;
== Felt bored and moved on ==&lt;br /&gt;
* Anja Petković (last seen as PhD student at FMF)&lt;br /&gt;
* Jure Lapajne (last seen working on master's thesis at FMF)&lt;br /&gt;
* Matjaž Ličar (last seen at Slovenian Environmental Agency)&lt;br /&gt;
* Maks Kolman (last seen at Google)&lt;br /&gt;
* Blaž Stojanovič&lt;br /&gt;
* Anja Pirnat (last seen working on master's thesis at FMF)&lt;br /&gt;
* Jure Močnik - Berljavac (last seen working on master's thesis at FMF)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''JSI - Jozef Stefan Institute&lt;br /&gt;
&lt;br /&gt;
''FMF - Faculty of Mathematics and Physics, University of Ljubljana&lt;br /&gt;
&lt;br /&gt;
''LBGT - Lehrstuhl für Brau- und Getränketechnologie''&lt;br /&gt;
&lt;br /&gt;
''TUM - Technische Universität München''&lt;/div&gt;</summary>
		<author><name>E6WikiAdmin</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=Medusa&amp;diff=3592</id>
		<title>Medusa</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=Medusa&amp;diff=3592"/>
				<updated>2024-01-22T17:05:04Z</updated>
		
		<summary type="html">&lt;p&gt;E6WikiAdmin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!--__NOTITLE__--&amp;gt;&lt;br /&gt;
'''Welcome to the Medusa wiki. To visit the main website, go to [http://e6.ijs.si/medusa/ http://e6.ijs.si/medusa/].'''&lt;br /&gt;
&lt;br /&gt;
In [http://e6.ijs.si/ParallelAndDistributedSystems/ Parallel and Distributed Systems Laboratory] we are working on a C++ library that is first and foremost focused on tools for solving Partial Differential Equations by meshless methods. The basic idea is to create generic codes for tools that are needed for solving not only PDEs but many other problems, e.g. Moving Least Squares approximation, $k$-d tree, domain generation engines, etc.&lt;br /&gt;
We call this open source meshless project [http://e6.ijs.si/medusa/ Medusa: Coordinate Free Meshless Method implementation (MM)].&lt;br /&gt;
&lt;br /&gt;
Technical details about code and examples  can be found on our [http://e6.ijs.si/medusa/docs/ documentation page] and [https://gitlab.com/e62Lab/medusa Gitlab repository]. [[File:C.png|100px||link=https://gitlab.com/e62Lab/medusa|alt=Alt text|code]] [[File:doxygen.png|100px|link=http://e6.ijs.si/medusa/docs/|alt=Alt text|Documentation page]]&lt;br /&gt;
&lt;br /&gt;
This wiki site is meant for more relaxed discussions about general principles, possible and already implemented applications, preliminary analyses, etc.&lt;br /&gt;
Note, that there are many grammatical mistakes, typos, stupid sentences, etc. This wiki is meant for quick information exchange and therefore we do not invest a lot of energy into styling :).  &lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [https://gitlab.com/e62Lab/medusa Code on Gitlab]&lt;br /&gt;
* [[How to build | Installation and building]]&lt;br /&gt;
* [[Including this library in your project | Including this library in your project]]&lt;br /&gt;
* [[Testing | Running tests]]&lt;br /&gt;
* [http://e6.ijs.si/medusa/docs/ Technical documentation]&lt;br /&gt;
* [[Coding style | Coding style]]&lt;br /&gt;
* [[Wiki editing guide | Wiki editing and backup guide]]&lt;br /&gt;
&lt;br /&gt;
== Building blocks ==&lt;br /&gt;
Medusa is modular coordinate-free parallel implementation of a numerical framework designed, but not limited to, for solving PDEs. In this section we present main modules of the library that can be also used as a standalone tools. &lt;br /&gt;
* [[Positioning of computational nodes]] &lt;br /&gt;
* [[Relaxation of the nodal distribution]]&lt;br /&gt;
* [[Refinement of the nodal distribution]]&lt;br /&gt;
* [[k-d tree|''k''-d tree and other spatial search structures]] &lt;br /&gt;
* [[Solving system | Solving linear system - including over and underdetermined systems]]&lt;br /&gt;
* [[Weighted Least Squares (WLS)]]&lt;br /&gt;
* [[Computation of shape functions]]&lt;br /&gt;
* [[Radial basis function-generated finite differences (RBF-FD)]]&lt;br /&gt;
* [[Ghost nodes (theory)]]&lt;br /&gt;
* [[Integrators for time stepping]]&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
In this section we present exact examples. Each of the below solutions can be found also in in the repository under examples. More explanation about the physical background and solution procedure can be found in following sections.&lt;br /&gt;
* [[Philosophy of examples and how to run them]]&lt;br /&gt;
* [[Poisson's equation]]&lt;br /&gt;
* [[Heat equation]]&lt;br /&gt;
* [[Linear elasticity]]&lt;br /&gt;
* [[Complex-valued problems]]&lt;br /&gt;
* [[Coupled domains]]&lt;br /&gt;
* [[Parametric domains | Parametric domains &amp;amp;ndash; Curved surface with variable density]]&lt;br /&gt;
* [[NURBS domains | Domains modeled with non-uniform rational basis splines (NURBS)]]&lt;br /&gt;
* [[Determining the interior of the domain by oversampling the boundary]]&lt;br /&gt;
* [[Computer-aided design - Importing IGES and STEP files]]&lt;br /&gt;
* [[Realistic 3D models|Working with 3D surface mesh models ]]&lt;br /&gt;
* [[customization | Operator customization]]&lt;br /&gt;
* [[Ghost nodes]]&lt;br /&gt;
* [[Electromagnetic scattering]]&lt;br /&gt;
* [[Schrödinger equation]]&lt;br /&gt;
* [[Wave equation]]&lt;br /&gt;
* [[Cahn-Hilliard equation]]&lt;br /&gt;
* [[Fluid mechanics]]&lt;br /&gt;
* [[Solid Mechanics | Solid mechanics]]&lt;br /&gt;
&lt;br /&gt;
== Discussions / Applications ==&lt;br /&gt;
This section is meant for general discussion about the physical background of the examples, the solution procedures, various applications, etc. Note, that code snippets presented in discussion might not reflect the actual state of Medusa.  &lt;br /&gt;
* [[Convection Diffusion equation | Convection Diffusion equation]]&lt;br /&gt;
* [[Adaptivity|H-adaptivity]]&lt;br /&gt;
* [[Hp-adaptivity]]&lt;br /&gt;
* [[Solid Mechanics]]&lt;br /&gt;
** [[Point contact]]&lt;br /&gt;
** [[Hertzian contact]]&lt;br /&gt;
** [[Cantilever beam]]&lt;br /&gt;
** [[Fretting fatigue case]]&lt;br /&gt;
** [[Plasticity]]&lt;br /&gt;
* [[Fluid Mechanics]]&lt;br /&gt;
** [[Lid driven cavity]]&lt;br /&gt;
** [[Burger's equation]]&lt;br /&gt;
** [[de Vahl Davis natural convection test]]&lt;br /&gt;
** [[Natural convection in 3D irregular domain]]&lt;br /&gt;
** [[Natural convection from heated cylinder]]&lt;br /&gt;
** [[Natural convection between concentric cylinders]]&lt;br /&gt;
** [[Non-Newtonian fluid]]&lt;br /&gt;
* [[Computational electromagnetics]]&lt;br /&gt;
** [[Triple dielectric step in 1D]]&lt;br /&gt;
** [[Scattering from an infinite cylinder]]&lt;br /&gt;
** [[Point source near an anisotropic lens]]&lt;br /&gt;
* Other applications&lt;br /&gt;
** [[Attenuation due to liquid water content in the atmosphere|Attenuation of a satellite communication]]&lt;br /&gt;
** [[Heart rate variability detection]]&lt;br /&gt;
** [[Bioheat equation]]&lt;br /&gt;
&lt;br /&gt;
== Performance analyses ==&lt;br /&gt;
* [[Execution on Intel® Xeon Phi™ co-processor]]&lt;br /&gt;
* [[1D MLSM and FDM comparison]]&lt;br /&gt;
* [[:File:tech_report.pdf|Execution overheads due to clumsy types::technical report]] [[File:pdf-file.gif]]&lt;br /&gt;
* [[Solving sparse systems]]&lt;br /&gt;
* [[Eigen paralelization]]&lt;br /&gt;
&lt;br /&gt;
== Last changes ==&lt;br /&gt;
&amp;lt;news unique=1 limit = 5&amp;gt;&lt;br /&gt;
*{{{timeanddate}}} :: {{{title}}} &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/news&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Miscellaneous ==&lt;br /&gt;
* FAQ  - [[Frequently asked questions]]. &lt;br /&gt;
* [[List of wiki contributors]]&lt;br /&gt;
* List of library contributors: [http://e6.ijs.si/medusa/about#about-contributors See the official website]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
For all related papers including conference contributions, monographs and book chapters check https://e6.ijs.si/ParallelAndDistributedSystems/publications/&lt;br /&gt;
&lt;br /&gt;
{{Box-round|title= Selected papers |&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/153678339.pdf M. Jančič, G. Kosec; Strong form mesh‑free hp‑adaptive solution of linear elasticity problem, Engineering with computers, vol. 39, 2023 [DOI: 10.1007/s00366-023-01843-6]]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/98533123.pdf M. Depolli, J. Slak, G. Kosec; Parallel domain discretization algorithm for RBF-FD and other meshless numerical methods for solving PDEs, Computers &amp;amp; Structures, 2022 [DOI: 10.1016/j.compstruc.2022.106773]]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/69777155.pdf J. Slak, G. Kosec; Medusa : A C++ library for solving PDEs using strong form mesh-free methods, ACM transactions on mathematical software, vol. 47, 2021 [DOI: 10.1145/3450966]]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/56730115.pdf U. Duh, G. Kosec, J. Slak; Fast variable density node generation on parametric surfaces with application to mesh-free methods, SIAM journal on scientific computing, vol. 43, 2021 [DOI: 10.1137/20M1325642]]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/52715011.pdf M. Jančič, J. Slak, G. Kosec; Monomial augmentation guidelines for RBF-FD from accuracy versus computational time perspective, Journal of scientific computing, vol. 87, 2021 [DOI: 10.1007/s10915-020-01401-y]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/32782887.pdf J. Slak, G. Kosec; On generation of node distributions for meshless PDE discretizations, SIAM journal on scientific computing, vol. 41, 2019 [DOI: 10.1137/18M1231456]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/32424999.pdf G. Kosec, J. Slak, M. Depolli, R. Trobec, K. Pereira, S. Tomar, T. Jacquemin, S. Bordas, M. Wahab; Weak and strong from meshless methods for linear elastic problem under fretting contact conditions, Tribology international, vol. 138, 2019]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/32230439.pdf J. Slak, G. Kosec; Adaptive radial basis function-generated finite differences method for contact problems, International journal for numerical methods in engineering, vol. 119, 2019 [DOI: 10.1002/nme.6067]]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/32388135.pdf M. Maksić, V. Djurica, A. Souvent, J. Slak, M. Depolli, G. Kosec; Cooling of overhead power lines due to the natural convection, International journal of electrical power &amp;amp; energy systems, 2019]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/31107623.pdf J. Slak, G. Kosec; Refined meshless local strong form solution of Cauchy-Navier equation on an irregular domain, Engineering analysis with boundary elements, vol. 100, 2019]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/29639719.pdf M. Depolli, G. Kosec; Assessment of differential evolution for multi-objective optimization in a natural convection problem solved by a local meshless method, Engineering optimization, 2017, vol. 49, no. 4, pp. 675-692]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/29512743.pdf G. Kosec; A local numerical solution of a fluid-flow problem on an irregular domain, Advances in engineering software, vol. 120, 2018 [DOI: 10.1016/j.advengsoft.2016.05.010]]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/27912487.pdf G. Kosec, R. Trobec; Simulation of semiconductor devices with a local numerical approach, Engineering analysis with boundary elements, 2015 [DOI: 10.1016/j.enganabound.2014.07.013]]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/3218939.pdf G. Kosec, B. Šarler; Simulation of macrosegregation with mesosegregates in binary metallic casts by a meshless method, Engineering analysis with boundary elements]&lt;br /&gt;
&lt;br /&gt;
[http://comms.ijs.si/~gkosec/data/papers/27339815.pdf G. Kosec, M. Depolli, A. Rashkovska, R. Trobec; Super linear speedup in a local parallel meshless solution of thermo-fluid problem, Computers &amp;amp; Structures, vol. 133, 2014]&lt;br /&gt;
&lt;br /&gt;
[http://comms.ijs.si/~gkosec/data/papers/26785063.pdf G. Kosec, P. Zinterhof; Local strong form meshless method on multiple Graphics Processing Units, Computer modeling in engineering &amp;amp; sciences, vol. 91, 2013]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/2599419.pdf G. Kosec, B. Šarler; Solution of a low Prandtl number natural convection benchmark by a local meshless method, International journal of numerical methods for heat &amp;amp; fluid flow]&lt;br /&gt;
&lt;br /&gt;
[http://comms.ijs.si/~gkosec/data/papers/EABE2499.pdf R. Trobec, G. Kosec, M. Šterk, B. Šarler; Comparison of local weak and strong form meshless methods for 2-D diffusion equation, Engineering analysis with boundary elements, vol. 36, 2012]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/1905659.pdf G. Kosec, M. Založnik, B. Šarler, H. Combeau; A meshless approach towards solution of macrosegregation phenomena, Computers, materials &amp;amp; continua : CMC, vol. 22, 2011 ]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/992507.pdf G. Kosec, B. Šarler; Solution of thermo-fluid problems by collocation with local pressure correction, International journal of numerical methods for heat &amp;amp; fluid flow, vol.18, 2008]&lt;br /&gt;
&lt;br /&gt;
R. Trobec, G. Kosec; Parallel scientific computing : theory, algorithms, and applications of mesh based and meshless methods, 2015&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Related pages==&lt;br /&gt;
* http://e6.ijs.si/ParallelAndDistributedSystems/products/medusa/&lt;/div&gt;</summary>
		<author><name>E6WikiAdmin</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=HP-adaptivity&amp;diff=3591</id>
		<title>HP-adaptivity</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=HP-adaptivity&amp;diff=3591"/>
				<updated>2024-01-22T17:03:13Z</updated>
		
		<summary type="html">&lt;p&gt;E6WikiAdmin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Box-round|title= Related papers |&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/153678339.pdf M. Jančič, G. Kosec; Strong form mesh‑free hp‑adaptive solution of linear elasticity problem, Engineering with computers, vol. 39, 2023 [DOI: 10.1007/s00366-023-01843-6]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Adaptive solution procedures are essential in problems where the accuracy of the numerical solution varies spatially and are currently subject of intensive studies. Two conceptually different adaptive approaches have been proposed, namely $p$-adaptivity or $h$-, $r$-adaptivity. In $p$-adaptivity, the accuracy of the numerical solution is varied by changing the order of approximation, while in $h$- and $r$-adaptivity the resolution of the spatial discretization is adjusted for the same purpose. In the $h$-adaptive approach, nodes are added or removed from the domain as needed, while in the $r$-adaptive approach, the total number of nodes remains constant - the nodes are only repositioned with respect to the desired accuracy. Ultimately, $h$- and $p$-adaptivities can be combined to form the so-called $hp$-adaptivity, where the accuracy of the solution is controlled with the order of the method and the resolution of the spatial discretization.&lt;br /&gt;
&lt;br /&gt;
__FORCETOC__&lt;br /&gt;
&lt;br /&gt;
==  Basic concept ==&lt;br /&gt;
&lt;br /&gt;
The proposed $hp$-adaptive solution procedure follows the well-established paradigm based on an iterative loop, where each iteration step consists of four modules:&lt;br /&gt;
* '''Solve''' - A numerical solution $\widehat{u}$ is obtained.&lt;br /&gt;
* '''Estimate''' - An estimate of the spatial accuracy of the numerical solution is calculated using error indicators.&lt;br /&gt;
* '''Mark''' - Depending on the error indicator values $\eta _i$, a marking strategy is used to mark the computational nodes for (de)refinement.&lt;br /&gt;
* '''Refine''' - Refinement strategy is employed to define the amount of the (de)refinement.&lt;br /&gt;
&lt;br /&gt;
Expected result is drafted in figure below.&lt;br /&gt;
&lt;br /&gt;
[[File:refinement_workflow.png|800px]]&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
The implementation of $hp$-adaptive solution procedure can be found [https://gitlab.com/e62Lab/public/2022_p_hp-adaptivity here].&lt;br /&gt;
&lt;br /&gt;
== Solution procedure ==&lt;br /&gt;
=== Solve ===&lt;br /&gt;
&lt;br /&gt;
First a numerical solution $\widehat{u}$ to the governing problem must be obtained. In general, the numerical treatment of a system of PDEs is done in several steps. First, the domain is discretized by positioning the nodes, then the linear differential operators in each computational node are approximated, and, finally, the system of PDEs is discretized and assembled into a large sparse linear system. To obtain a numerical solution $\widehat{u}$, the sparse system is solved.&lt;br /&gt;
&lt;br /&gt;
=== Estimate (IMEX error indicator) ===&lt;br /&gt;
In the estimation step, critical areas with high error of the numerical solution are identified. Identifying such areas is not a trivial task. In rare cases, where a closed form solution to the governing system of PDEs exists, we can not only indicate such areas but also estimate the accuracy of the numerical solution. However, for real-world problems, which are often subject of numerical simulations, closed form solutions do not exist. Therefore, other objective metrics are needed to indicate the computational nodes with high error of the numerical solution. Numerical tools used in such cases are commonly referred to as ''error indicators''.&lt;br /&gt;
&lt;br /&gt;
We have chosen to use our own error indication algorithm IMEX &amp;lt;ref name=&amp;quot;imex&amp;quot;&amp;gt; Jančič, Mitja, Filip Strniša, and Gregor Kosec. &amp;quot;Implicit-Explicit Error Indicator based on Approximation Order.&amp;quot; arXiv preprint arXiv:2204.01022 (2022).&amp;lt;/ref&amp;gt; for implementation-related convenience reasons. This error indicator makes use of the implicitly obtained numerical solution and explicit operators (approximated by higher-order basis) to reconstruct the right-hand side of the governing problem.&lt;br /&gt;
&lt;br /&gt;
To further explain basic idea of IMEX, let us define a PDE of type:&lt;br /&gt;
$$&lt;br /&gt;
    \mathcal L u = f_{RHS},&lt;br /&gt;
$$&lt;br /&gt;
where $\mathcal L$ is a differential operator applied to the scalar field $u$ and $f_{RHS}$ is a function. To obtain an error indicator field $\eta$, the problem is first solved implicitly by using a lower order approximation of operators $\mathcal L$, $\mathcal L^{(lo)}_{im}$, obtaining the solution $u^{(im)}$ in the process. The implicitly computed field $u^{(im)}$ is then used to explicitly reconstruct the right-hand side of the governing problem, but this time using a higher order approximation of $\mathcal L$, $\mathcal L^{(hi)}_{ex}$, obtaining $f_{RHS}^{(ex)}$ in the process.&lt;br /&gt;
Finally, $f_{RHS}^{(ex)}$ and $f_{RHS}$ are compared $\eta = \left | f_{RHS} - f_{RHS}^{(ex)} \right |$ to indicate the error of the numerical solution.&lt;br /&gt;
&lt;br /&gt;
=== Mark ===&lt;br /&gt;
&lt;br /&gt;
After the error indicator $\eta$ had been obtained for each computational point in $\Omega$, a marking strategy is employed. The main objective of this step is to flag the nodes with too high or too low error indicator values in order to achieve a uniformly distributed precision of the numerical solution and reduce computational costs - by avoiding fine local field descriptions and high order approximations where this is not required. Furthermore, the marking strategy not only decides whether or not (de)refinement should take place at a given computational node, but also defines the type of the refinement procedure in cases where there are multiple to choose from.&lt;br /&gt;
&lt;br /&gt;
In each adaptivity iteration, the marking strategy starts by checking the error indicator values $\eta _i$ for all computational nodes in the domain. If $\eta _i$ is greater than $\alpha \eta_{max}$ for a free model parameter $\alpha \in (0, 1)$, the node is marked for refinement. If $\eta _i$ is less than $\beta \eta_{max}$ for a free model parameter $\beta \in (0,1) \land \beta \leq \alpha$, the node is marked for derefinement. Otherwise, the node is left unmarked meaning no refinement should take place. The marking strategy can be summarized with a single equation&lt;br /&gt;
$$&lt;br /&gt;
    \begin{cases}&lt;br /&gt;
        \eta _i &amp;gt; \alpha \eta_{max},                          &amp;amp; \text{ refine}     \\&lt;br /&gt;
        \beta \eta_{max} \leq \eta _i \leq \alpha \eta_{max}, &amp;amp; \text{ do nothing} \\&lt;br /&gt;
        \eta _i &amp;lt; \beta \eta_{max},                           &amp;amp; \text{ derefine}&lt;br /&gt;
    \end{cases}.&lt;br /&gt;
$$&lt;br /&gt;
&lt;br /&gt;
In the context of mesh-based methods, it has already been observed, that this strategy is indeed simple to implement, however, far from optimal in terms of achieving good convergence rates. Our studies have shown that a slight modification to the originally proposed strategy can significantly improve the performance of an $hp$-adaptive solution procedure in the context of mesh-free methods, but at the cost of higher number of free parameters - making it more difficult to understand. Nevertheless, the strategy is modified by introducing parameters $\left \{ \alpha_h, \beta_h \right \}$ and $\left \{ \alpha_p, \beta_p \right \}$ for separate treatment of $h$- and $p$-refinements respectively. A schematic is shown in figure below.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot from 2022-09-20 08-25-34.png|800px]]&lt;br /&gt;
&lt;br /&gt;
=== Refine ===&lt;br /&gt;
&lt;br /&gt;
After obtaining the list of nodes marked for modification, the refinement module is initialized. In this module, the local field description and local approximation order for the unmarked nodes are left unchanged, while the rest are further processed to determine other refinement-type-specific details - such as the amount of the (de)refinement. &lt;br /&gt;
&lt;br /&gt;
We use the following $h$-refinement rule&lt;br /&gt;
$$&lt;br /&gt;
    \label{eq:refinement}&lt;br /&gt;
    h_i^{new}(\b p) = \frac{h_i^{old}}{\frac{\eta_i - \alpha \eta _{max}}{\eta_{max} - \alpha\eta_{max}}\big(\lambda - 1\big) + 1}&lt;br /&gt;
$$&lt;br /&gt;
for the dimensionless parameter $\lambda \in [1, \infty)$ allowing us to control the aggressiveness of the refinement - the larger the value, the greater the change. This refinement rule also conveniently refines the areas with higher error indicator values more than the ones that are closer to the upper refinement threshold $\alpha_h \eta_{max}$. Similarly, a derefinement rule is proposed&lt;br /&gt;
$$&lt;br /&gt;
    \label{eq:derefinement}&lt;br /&gt;
    h_i^{new}(\b p) = \frac{h_i^{old}}{\frac{\beta \eta _{max} - \eta_i}{\beta\eta_{max} - \eta_{min}}\big(\frac{1}{\vartheta} - 1\big) + 1},&lt;br /&gt;
$$&lt;br /&gt;
where parameter $\vartheta \in [1, \infty)$ allows us to control the aggressiveness of derefinement.&lt;br /&gt;
&lt;br /&gt;
The same refinement and derefinement strategies were applied to control the local approximation order, except this time the value is rounded to the nearest integer. Similarly and for the same reasons as we did with the marking strategy, we consider a separate treatment of $h$- and $p$-adaptive procedures, by introducing (de)refinement aggressiveness parameters $\left \{\lambda_h, \vartheta_h \right \}$ and $\left \{\lambda_p, \vartheta_p \right \}$ for $h$- and $p$-refinement types respectively.&lt;br /&gt;
&lt;br /&gt;
[[File:refinement_rules.png|800px]]&lt;br /&gt;
&lt;br /&gt;
=== Finalization step ===&lt;br /&gt;
&lt;br /&gt;
Before the 4 modules can be iteratively repeated, the domain is rediscretized taking into account the newly computed local internodal distances $h_i^{new}(\b p)$ and the local approximation orders $m_i^{new}(\b p)$. However, both are only known in the computational nodes, while global functions $\widehat{h}^{new}(\b p)$ and $\widehat{m}^{new}(\b p)$ over our entire domain space $\Omega$ are required. These are obtained by employing the Sheppard's inverse distance weighting interpolation.&lt;br /&gt;
&lt;br /&gt;
Figure below schematically demonstrates 3 examples of $hp$-refinements. For the sake of demonstration, the refinement parameters for $h$- and $p$-adaptivity are the same, i.e. $\left \{ \alpha, \beta, \lambda, \vartheta \right \} = \left \{ \alpha_h, \beta_h, \lambda_h, \vartheta_h \right \} = \left \{ \alpha_p, \beta_p, \lambda_p, \vartheta_p \right \}$. Additionally, the derefinement aggressiveness $\vartheta$ and the upper threshold $\beta$ are kept constant, so, effectively, only the upper bound of refinement $\alpha$ and refinement aggressiveness $\lambda$ are altered. We observe that the effect refinement parameters is somewhat intuitive. The larger the aggressiveness $\lambda$ the better the local field description and the larger the number of nodes with high approximation order. Similar effect is observed with manipulating the upper refinement threshold $\alpha$, except the effect comes at a smoother manner. Also observe that all refined states were able to increase the accuracy of the numerical solution from the initial state.&lt;br /&gt;
&lt;br /&gt;
[[File:refinement_demonstration.png|800px]]&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
=== Example peak problem ===&lt;br /&gt;
&lt;br /&gt;
The proposed $hp$-adaptive solution procedure is demonstrated on a synthetical example. We chose a 2-dimensional Poisson problem with exponentially strong source positioned at $\boldsymbol x_s = \Big (\frac{1}{2}, \frac{1}{3}\Big )$. This example is categorized as a difficult problem and is commonly used to test the performance of adaptive solution procedures. The problem has a tractable solution $u(\boldsymbol x)=e^{-a \left \| \boldsymbol x - \boldsymbol x_s \right \|^2}$, which allows us to evaluate the precision of the numerical solution $\widehat{u}$, e.g.\ in terms of the infinity norm.&lt;br /&gt;
&lt;br /&gt;
Governing equations are&lt;br /&gt;
$$&lt;br /&gt;
    \nabla^2 u (\boldsymbol x)   = 2a e^{-a \left \| \boldsymbol x - \boldsymbol x_s \right \|^2}(2a\left \| \boldsymbol x - \boldsymbol x_s \right \| - d) \quad \quad \text{in } \Omega,   \\&lt;br /&gt;
    u (\boldsymbol x)        = e^{-a \left \| \boldsymbol x - \boldsymbol x_s \right \|^2}                                       \quad \quad  \text{on } \Gamma_d, \\&lt;br /&gt;
    \nabla u (\boldsymbol x) = -2a(\boldsymbol x - \boldsymbol x_s)e^{-a \left \| \boldsymbol x - \boldsymbol x_s \right \|^2}                           \quad \quad\text{on } \Gamma_n,&lt;br /&gt;
$$&lt;br /&gt;
&lt;br /&gt;
Figure below shows example indicator fields for initial iteration, intermediate iteration and iteration that achieved the best accuracy of the numerical solution. The third column shows the IMEX error indicator. We can see that the IMEX successfully located the position of the strong source at $\boldsymbol x_s = \Big (\frac{1}{2}, \frac{1}{3}\Big )$ as the highest indicator values are seen in its neighborhood. Moreover, the second column shows that the accuracy of the numerical solution and uniformity of error distribution have both been significantly improved by the $hp$-adaptive solution procedure, further proving that the IMEX can be successfully employed as a reliable error indicator.&lt;br /&gt;
&lt;br /&gt;
[[File:refinement_demonstration_2d.png|800px]]&lt;br /&gt;
&lt;br /&gt;
The behavior of IMEX over 70 adaptivity iterations is further studied in figure below. We are pleased to see that the convergence limit of the indicator around iteration $N_{iter}=60$ agrees well with the convergence limit of the numerical solution. &lt;br /&gt;
&lt;br /&gt;
[[File:error_indicator_convergence.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Finally, the convergence behavior of the proposed $hp$-adaptive solution procedure is studied. In addition to the convergence of a single $hp$-adaptive run, the convergences obtained without the use of refinement procedures, i.e. solutions obtained with uniform internodal spacing and approximation orders over the entire domain, are shown in figure below. The figure evidently shows that a $hp$-adaptive solution procedure was able to notably improve the numerical solution in terms of accuracy and required computational points.&lt;br /&gt;
&lt;br /&gt;
[[File:convergence_of_h_hp.png|800px]]&lt;br /&gt;
&lt;br /&gt;
=== Application to linear elasticity problems: Fretting fatigue contact ===&lt;br /&gt;
&lt;br /&gt;
The application of the proposed $hp$-adaptive solution procedure is further expanded to study a linear elasticity problem. Specifically, we obtain a $hp$-refined solution to fretting fatigue contact problem &amp;lt;ref name=&amp;quot;fwo&amp;quot;&amp;gt;Pereira, Kyvia, et al. &amp;quot;On the convergence of stresses in fretting fatigue.&amp;quot; Materials 9.8 (2016): 639.&amp;lt;/ref&amp;gt;, for which the authors believe no closed form solution is known.&lt;br /&gt;
&lt;br /&gt;
The problem formulation is given here &amp;lt;ref name=&amp;quot;slak&amp;quot;&amp;gt;Slak, Jure, and Gregor Kosec. &amp;quot;Adaptive radial basis function–generated finite differences method for contact problems.&amp;quot; International Journal for Numerical Methods in Engineering 119.7 (2019): 661-686.&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Figure below shows an example of $hp$-refined solution to fretting fatigue problem at the last adaptivity iteration with $N=46\,626$ computational nodes. We see that the solution procedure successfully located the two critical points, i.e. the fixed top left corner with a stress singularity and the area in the middle of the top edge where the contact is simulated. Note that the highest stress values (approximately $2$ times higher) have been computed in the singularity in the top left corner, but those nodes are not shown since our focus is shifted towards the area under the contact.&lt;br /&gt;
&lt;br /&gt;
[[File:fwo_solution_hp.png|800px]]&lt;br /&gt;
&lt;br /&gt;
For a detailed analysis, we look at the surface traction $\sigma_{xx}$, as it is often used to determine the location of crack initiation. The surface traction is shown in figure below for $6$ selected adaptivity iterations. The mesh-free nodes are colored according to the local approximation order enforced by the $hp$-adaptive solution procedure. The message of this figure is twofold. Firstly, it is clear that the proposed IMEX error indicator can be successfully used in linear elasticity problems, and secondly, we observe that the $hp$-adaptive solution procedure successfully approximated the surface traction in the neighborhood of the contact. In the process, the local field description under the contact has been significantly improved and also the local approximation orders have taken a non-trivial distribution.&lt;br /&gt;
&lt;br /&gt;
[[File:fwo_abaqus.png|800px]]&lt;br /&gt;
&lt;br /&gt;
The surface traction is additionally accompanied with the FEM results on a much denser mesh with more than 100\,000 DOFs obtained with the commercial solver Abaqus\textsuperscript{\textregistered}. To compute the absolute difference between the two methods, the mesh-free solution has been interpolated to Abaqus's computational points using the Sheppard's inverse distance weighting interpolation with $2$ closest neighbors. We see that the absolute difference is decreasing with the number of adaptivity iterations, finally settling at approximately 2 % of the maximum value under the contact at initial iteration. The highest absolute difference is expectedly located at the edges of the contact, i.e. around $x=a$ and $x=-a$, while the difference in the rest of the contact is even smaller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>E6WikiAdmin</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=Poisson%27s_equation&amp;diff=3590</id>
		<title>Poisson's equation</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=Poisson%27s_equation&amp;diff=3590"/>
				<updated>2024-01-22T17:02:46Z</updated>
		
		<summary type="html">&lt;p&gt;E6WikiAdmin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Box-round|title= Related papers |&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/52715011.pdf M. Jančič, J. Slak, G. Kosec; Monomial augmentation guidelines for RBF-FD from accuracy versus computational time perspective, Journal of scientific computing, vol. 87, 2021 [DOI: 10.1007/s10915-020-01401-y]]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/69777155.pdf J. Slak, G. Kosec; Medusa : A C++ library for solving PDEs using strong form mesh-free methods, ACM transactions on mathematical software, vol. 47, 2021 [DOI: 10.1145/3450966]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
== Dirichlet boundary conditions ==&lt;br /&gt;
It is fitting that examples start with a simple case, and we will gradually make our way towards more complicated cases with different domain shapes, boundary conditions and approximation types.&lt;br /&gt;
Consider the solution of the 2D Poisson equation on a unit square with Dirichlet boundary conditions:&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
    	\Delta u &amp;amp;= f      &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
    	  u &amp;amp;= 0           &amp;amp;&amp;amp;\text{on } \partial \Omega,&lt;br /&gt;
	\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
where $u(x,y)$ is the solution to the problem, $\Omega = [0, 1] \times [0, 1]$ and in the case we will consider $f(x,y) = -2\pi^2\sin(\pi x)\sin(\pi y)$, as it makes for &lt;br /&gt;
a simple solution $u(x,y) = \sin(\pi x)\sin(\pi y)$.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
First, we construct our domain and discretize it, then find support (neighborhood) for each node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
BoxShape&amp;lt;Vec2d&amp;gt; box(0.0, 1.0);&lt;br /&gt;
double dx = 0.01;&lt;br /&gt;
DomainDiscretization&amp;lt;Vec2d&amp;gt; domain = box.discretizeWithStep(dx);&lt;br /&gt;
&lt;br /&gt;
int N = domain.size();&lt;br /&gt;
domain.findSupport(FindClosest(9));&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We constructed a box shape, discretized it with a constant step dx (both inside and the boundary) and choose the closest 9 nodes of each node as its support. The next step is to construct our approximation engine. &lt;br /&gt;
Simply put, approximation engines are classes responsible for [[Computation of shape functions|computing shape functions]] for given operator and points. While many different setups are supported in Medusa we will start off simple,&lt;br /&gt;
with an approximation that reproduces standard Finite Difference method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
int m = 2&lt;br /&gt;
WLS&amp;lt;Monomials&amp;lt;Vec2d&amp;gt;, NoWeight&amp;lt;Vec2d&amp;gt;, ScaleToFarthest&amp;gt; wls(Monomials&amp;lt;Vec2d&amp;gt;::tensorBasis(m));&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We constructed a [[Weighted Least Squares (WLS) | WLS]] engine using monomial tensor basis of order 2. Finally, we write the equations for our problem by directly translating&lt;br /&gt;
the mathematical formulation above into code. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
for (int i : domain.interior()) {&lt;br /&gt;
    double x = domain.pos(i, 0);&lt;br /&gt;
    double y = domain.pos(i, 1);&lt;br /&gt;
    op.lap(i) = -2*PI*PI*std::sin(PI*x)*std::sin(PI*y);&lt;br /&gt;
}&lt;br /&gt;
for (int i : domain.boundary()) {&lt;br /&gt;
    op.value(i) = 0.0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here is the plot of the solution $u(x, y)$.&lt;br /&gt;
&lt;br /&gt;
[[File:dirichlet.png|800px]]&lt;br /&gt;
&lt;br /&gt;
The whole example can be found as [https://gitlab.com/e62Lab/medusa poisson_dirichlet_2D.cpp] along with the plot script that can be run by Matlab or Octave [https://gitlab.com/e62Lab/medusa poisson_dirichlet_2D.m].&lt;br /&gt;
Same goes for similar cases solved in 1D and 3D and their respective plot scripts.&lt;br /&gt;
&lt;br /&gt;
== Mixed boundary conditions  == &lt;br /&gt;
&lt;br /&gt;
We can obtain the solution to the above problem by solving it on just a quarter of the original domain and using mixed boundary conditions. By using Dirichlet boundary conditions on the bottom and the left side of the square domain, and Neumann boundary conditions on the right and upper side of the domain we are effectively solving the same problem but on a quarter of the domain. Our problem is now:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
    	\Delta u &amp;amp;= f      &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
    	  u &amp;amp;= 0           &amp;amp;&amp;amp;\text{on } \partial \Omega_1 \cup \partial \Omega_3,\\&lt;br /&gt;
          \frac{du}{d \b{\hat{n}}} &amp;amp;= 0           &amp;amp;&amp;amp;\text{on } \partial \Omega_2 \cup \partial \Omega_4 &lt;br /&gt;
	\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where $\partial \Omega_1$, $\partial \Omega_2$, $\partial \Omega_3$ and $\partial \Omega_4$ are left, right, bottom and top boundary respectively. The domain is $\Omega = [0, 0.5] \times [0, 0.5]$, and $\frac{du}{d \b{\hat{n}}}$ is the normal derivative (on the boundary).&lt;br /&gt;
&lt;br /&gt;
When constructing approximation engines, there are a lot of different options, you can choose between different basis functions, weights, scale functions and each setup comes with its advantages and disadvantages. Some might work for certain problems and some might not. When writing the examples we tried to present the reader with as many different options as possible. &lt;br /&gt;
&lt;br /&gt;
Let us solve the problem using Gaussian RBF (Radial Basis Functions) instead of Monomials:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
    // shape = 30&lt;br /&gt;
    // m = 9&lt;br /&gt;
    WLS&amp;lt;Gaussians&amp;lt;Vec2d&amp;gt;, NoWeight&amp;lt;Vec2d&amp;gt;, ScaleToFarthest,&lt;br /&gt;
            Eigen::LLT&amp;lt;Eigen::MatrixXd&amp;gt;&amp;gt; wls({9, 30});&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
While the case is the same for the nodes inside the domain, we need to change the boundary conditions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
    int BOTTOM = -3;&lt;br /&gt;
    int TOP = -4;&lt;br /&gt;
    int LEFT = -1;&lt;br /&gt;
    int RIGHT = -2;&lt;br /&gt;
&lt;br /&gt;
    for (int i : (domain.types() == LEFT) + (domain.types() == BOTTOM)) {&lt;br /&gt;
        op.value(i) = 0.0;  // Dirichlet boundary conditions on the left and bottom edge of the box&lt;br /&gt;
    }&lt;br /&gt;
    for (int i : (domain.types() == TOP) + (domain.types() == RIGHT)) {&lt;br /&gt;
        // Neumann boundary conditions on upper and right edge of the box&lt;br /&gt;
        op.neumann(i, domain.normal(i)) = 0.0;&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When solving a PDE implicitly a system of equations needs to be solved to obtain the solution. For this, we use [http://eigen.tuxfamily.org/index.php?title=Main_Page Eigen].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
    Eigen::BiCGSTAB&amp;lt;decltype(M), Eigen::IncompleteLUT&amp;lt;double&amp;gt;&amp;gt; solver;&lt;br /&gt;
    solver.compute(M);&lt;br /&gt;
    ScalarFieldd u = solver.solve(rhs);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Matrix M and rhs are the sparse matrix and vector in which we wrote (with the help of Medusa) the system of equations that when solved gives us an approximate solution of our problem. We solve the system using an Eigen linear equation solver, in this case, the BiCGStab algorithm with ILUT preconditioning. The solution is plotted below:&lt;br /&gt;
&lt;br /&gt;
[[File:mixed.png|800px]]&lt;br /&gt;
&lt;br /&gt;
The whole example can be found as [https://gitlab.com/e62Lab/medusa poisson_mixed_2D.cpp] along with the plot script that can be run by Matlab or Octave [https://gitlab.com/e62Lab/medusa poisson_mixed_2D.m]. Similar examples such as mixed boundary conditions on a circular domain, mixed boundary conditions on an irregular domain and a solution to a similar problem using monomial augmentation of radial basis functions can be found [https://gitlab.com/e62Lab/medusa here].&lt;br /&gt;
&lt;br /&gt;
== Full Neumann boundary conditions ==&lt;br /&gt;
When solving the Navier-Stokes equation with Explicit Pressure correction, a Poisson's equation with full Neumann boundary conditions needs to be solved. In order for this type of problem to be solved, it needs to satisfy the compatibility condition. Inside the domain we still have:&lt;br /&gt;
&lt;br /&gt;
$$ &lt;br /&gt;
    \Delta u = f &lt;br /&gt;
$$&lt;br /&gt;
&lt;br /&gt;
The Poisson equation has a solution for the requisite function $u(x,y)$, when the integral of the source function $f(x,y)$ over our domain needs to be equal to the net flow rate, that is expressed by the boundary integral of the normal derivative of $u(x,y)$. In mathematical formulation, for our 2D case:&lt;br /&gt;
&lt;br /&gt;
$$&lt;br /&gt;
    \int_{\Omega} f(x,y) dxdy = \int_{\partial \Omega} \frac{du}{d \b{\hat{n}}} dl&lt;br /&gt;
$$&lt;br /&gt;
&lt;br /&gt;
Where again $\Omega$ is our domain, $\partial \Omega$ is the boundary of our domain, $dl$ is the differential arc length along the boundary. When the compatibility condition is met, the Poisson equation has a solution that can be determined up to an arbitrary constant. To obtain only one solution another constraint needs to be implemented. One option is to select a node and set it to a constant, e.g. p(0, 0) = 0, however much more stable approach is to enforce solution with an additional condition, also referred to as a regularization:&lt;br /&gt;
&lt;br /&gt;
$$&lt;br /&gt;
    \int_{\Omega }^{{}}{u(x,y)d}\Omega = 0&lt;br /&gt;
$$&lt;br /&gt;
&lt;br /&gt;
On our unit square domain, $\Omega = [0, 1] \times [0, 1]$ an example case that satisfies the compatibility condition would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
    for (int i : domain.interior()) {&lt;br /&gt;
        op.lap(i) = 2;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    int BOTTOM = -3;&lt;br /&gt;
    int TOP = -4;&lt;br /&gt;
    int LEFT = -1;&lt;br /&gt;
    int RIGHT = -2;&lt;br /&gt;
&lt;br /&gt;
    for (int i : (domain.types() == LEFT)) {&lt;br /&gt;
        op.der1(i, 0) = 0.0;&lt;br /&gt;
    }&lt;br /&gt;
    for (int i : (domain.types() == RIGHT)) {&lt;br /&gt;
        op.der1(i, 0) = 1.0;&lt;br /&gt;
    }&lt;br /&gt;
    for (int i : (domain.types() == BOTTOM)) {&lt;br /&gt;
        op.der1(i, 1) = 0.0;&lt;br /&gt;
    }&lt;br /&gt;
    for (int i : (domain.types() == TOP)) {&lt;br /&gt;
        op.der1(i, 1) = 1.0;&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which is simply, $\Delta u = 2$ inside $\Omega$ while $\frac{du}{d \b{\hat{n}}} = 1$ on top and right boundary and $\frac{du}{d \b{\hat{n}}} = 0$ on the other two. With a little mental math we see that the compatibility condition is met, $2 * 1 = 0 + 1 + 0 + 1$. With that out of the way let us see how we implement regularization:&lt;br /&gt;
&lt;br /&gt;
Well the idea add another line and column to matrix M holding the shape function s, and enforce the condition. We do this by adding a Lagrange multiplier $\alpha$:&lt;br /&gt;
&lt;br /&gt;
$$&lt;br /&gt;
\left[ \begin{matrix}&lt;br /&gt;
   {{M}_{11}} &amp;amp; .. &amp;amp; {{M}_{1n}} &amp;amp; 1  \\&lt;br /&gt;
   .. &amp;amp; .. &amp;amp; .. &amp;amp; 1  \\&lt;br /&gt;
   {{M}_{n1}} &amp;amp; ... &amp;amp; {{M}_{nn}} &amp;amp; 1  \\&lt;br /&gt;
   1 &amp;amp; 1 &amp;amp; 1 &amp;amp; 0  \\&lt;br /&gt;
\end{matrix} \right]\left[ \begin{matrix}&lt;br /&gt;
   {{u}_{1}}  \\&lt;br /&gt;
   ...  \\&lt;br /&gt;
   {{u}_{n}}  \\&lt;br /&gt;
   \alpha   \\&lt;br /&gt;
\end{matrix} \right]=\left[ \begin{matrix}&lt;br /&gt;
   rhs_1  \\&lt;br /&gt;
   ...  \\&lt;br /&gt;
   rhs_n  \\&lt;br /&gt;
   0  \\&lt;br /&gt;
\end{matrix} \right]&lt;br /&gt;
$$&lt;br /&gt;
&lt;br /&gt;
When the problem is well-posed $\alpha$ should be equal to zero, or at least very close. Let us fill our matrix M:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
    // regularization&lt;br /&gt;
    // set the last row and column of the matrix&lt;br /&gt;
    for (int i = 0; i &amp;lt; N; ++i) {&lt;br /&gt;
        M.coeffRef(N, i) = 1;&lt;br /&gt;
        M.coeffRef(i, N) = 1;&lt;br /&gt;
    }&lt;br /&gt;
    // set the sum of all values&lt;br /&gt;
    rhs[N] = 0.0;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we take a look at the matrix we will see the extra row and column that enforce our constraint. They should be the last column and the last row of the matrix:&lt;br /&gt;
&lt;br /&gt;
[[File:sparse_neumann_problem.png|800px]]&lt;br /&gt;
&lt;br /&gt;
With this done we can solve the problem, just as we did in the examples above. &lt;br /&gt;
&lt;br /&gt;
[[File:poisson_neumann_2D.png|800px]]&lt;br /&gt;
&lt;br /&gt;
For $dx = 0.05$ we get $\alpha = -1.03846 \cdot 10^{-13}$, which is expected from a valid solution. &lt;br /&gt;
&lt;br /&gt;
The whole example can be found as [https://gitlab.com/e62Lab/medusa poisson_neumann_2D.cpp] along with the plot script that can be run by Matlab or Octave [https://gitlab.com/e62Lab/medusa poisson_neumann_2D.m].&lt;br /&gt;
&lt;br /&gt;
== 3D model case ==&lt;br /&gt;
&lt;br /&gt;
A 3D domain &amp;lt;code&amp;gt;triceratops.h5&amp;lt;/code&amp;gt; was created from the Mathematica's triceratops model. The point coordinates can be imported to medusa and used as a domain. In the example given in &amp;lt;code&amp;gt;triceratops.cpp&amp;lt;/code&amp;gt; &lt;br /&gt;
the equation $-\nabla^u = 1$ with $u=0$ on the boundary is solved.&lt;br /&gt;
&lt;br /&gt;
The plot of the solution obtained using &amp;lt;code&amp;gt;triceratops.m&amp;lt;/code&amp;gt; is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:triceratops_example.png|800px]]&lt;br /&gt;
&lt;br /&gt;
== Convergence rate - including high order solution ==&lt;br /&gt;
Assume a $d$-dimensional Poisson problem with mixed boundary conditions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
\nabla ^2 u(\boldsymbol x) &amp;amp;= -d \pi ^2 \prod_{i=1} ^d \sin(\pi x_i) \qquad &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
u(\boldsymbol x) &amp;amp;= \prod _{i = 1} ^d \sin(\pi x_i) \qquad &amp;amp;&amp;amp; \text{on } \Gamma_d,\\&lt;br /&gt;
\frac{\partial u}{\partial \boldsymbol n}(\boldsymbol x) &amp;amp;= \pi \sum_{i=1}^d n_i \cos(\pi x_i) \prod_{j\neq i} \sin(\pi x_j)&lt;br /&gt;
\qquad &amp;amp;&amp;amp; \text{on } \Gamma_n,&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where $n_i$ are components of the unit normal vector $\boldsymbol n$, $\Omega$ is a $d$-dimensional ball with origin at $\boldsymbol x = \boldsymbol{1} \boldsymbol{/} \boldsymbol{2}$ and radius $r = 1/2$, and $\Gamma_d$, $\Gamma_n$ are left and right halves of the boundary, respectively:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
\Omega &amp;amp;= \left\{ \boldsymbol x, \ \left\|\boldsymbol x - \boldsymbol{\frac 1 2}\right\| &amp;lt; \frac 1 2 \right\}, \\&lt;br /&gt;
\Gamma_d &amp;amp;= \left \{ \boldsymbol x \in \partial \Omega,\boldsymbol x_1 &amp;lt; \frac 1 2 \right \}, \\&lt;br /&gt;
\Gamma_n &amp;amp;= \left \{ \boldsymbol x \in \partial \Omega,\boldsymbol x_1 \geq \frac 1 2 \right \}.&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Solution of the above case is&lt;br /&gt;
$u(\boldsymbol x) = \prod _{i = 1} ^d \sin(\pi x_i)$,&lt;br /&gt;
allowing us to validate the numerically obtained solution $u_h$.&lt;br /&gt;
&lt;br /&gt;
Numerical results are computed using RBF-FD with PHS radial basis function&lt;br /&gt;
$\phi(r) = r^3$ and monomial augmentation - thus control over the method order is enabled. Radial function was kept same for all cases,&lt;br /&gt;
however, various orders of monomial augmentation were tested. Solution to the problem is obtained using monomials up to and including degree&lt;br /&gt;
$m$, for $m \in \left \{2, 4, 6, 8 \right \}$.&lt;br /&gt;
&lt;br /&gt;
[[File:Ball_ConvergenceAll.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Figure above shows the $e_\infty$ error for $d=1$, $d=2$, and $d=3$ dimensions.&lt;br /&gt;
The span of the horizontal axis is chosen in such a way that the total number of nodes in the&lt;br /&gt;
largest case was around $N = 10^5$ in all dimensions.&lt;br /&gt;
The observed convergence rates are independent of domain dimension and match the predicted order $O(h^m)$. All of the plots in $d=1$ case and $m=8$ sub-case of $d=2$ case eventually diverge due to the errors in finite precision arithmetic.&lt;br /&gt;
The dotted line in $d=1$ case shows the $\varepsilon/h^2$ line, where $\varepsilon \approx 2.22 \cdot 10^{-16}$.&lt;br /&gt;
&lt;br /&gt;
== Higher dimensional space ==&lt;br /&gt;
&lt;br /&gt;
We now demonstrate a solution to a Poisson problem in a 4-dimensional irregular domain. The irregular domain $\Omega$ is defined as&lt;br /&gt;
$\Omega = B_ 0 \setminus (B_ 1 \cup B_ 2 \cup B_ 3)$, where&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
B_ 0 &amp;amp;= \left \{\boldsymbol x \in \R^4, \ \left\|\boldsymbol x - \boldsymbol{\frac 1 2}\right\| &amp;lt; \frac 1 2 \right \}, \\&lt;br /&gt;
B_ 1 &amp;amp;= \left \{\boldsymbol x \in \R^4, \ \left\|\boldsymbol x - \left(\frac 1 2, 1, \frac 1 2, \frac 1 2\right)\right\|&lt;br /&gt;
\le \frac 1 4 \right \}, \\&lt;br /&gt;
B_ 2 &amp;amp;= \left \{\boldsymbol x \in \R^4, \ \left\|\boldsymbol x - \boldsymbol{0}\right\| \le \frac{13}{16} \right \} \text{&lt;br /&gt;
	and} \\&lt;br /&gt;
B_ 3 &amp;amp;= \left \{\boldsymbol x \in \R^4, \ \left\|\boldsymbol x - \left(\frac 1 2, \frac 1 2, \frac 3 4,&lt;br /&gt;
\frac 1 2\right)\right\| \le \frac 1 8 \right \}&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
are balls in $\R^4$.&lt;br /&gt;
&lt;br /&gt;
Dirichlet and Neumann boundary conditions are defined similarly to before, i.e. $\Gamma_d$ is the&lt;br /&gt;
left half and $\Gamma_n$ is the right half of $\partial\Omega$. Additionally the boundary of the&lt;br /&gt;
smallest ball $\partial B_ 3$ is added to Dirichlet boundary&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
\Gamma_d &amp;amp;= \left \{ \boldsymbol x\in \partial \Omega, x_1 &amp;lt; \frac 1 2 \right \} \cup \partial B_3 ,\\&lt;br /&gt;
\Gamma_n &amp;amp;= \left \{ \boldsymbol x\in \partial \Omega, x_1 \geq \frac 1 2 \right \} \setminus \partial B_ 3.&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Numerical solution $u_h$ was obtained using RBF-FD with PHS $\phi (r) = r^3$ augmented with&lt;br /&gt;
polynomials of degree $m=2$&lt;br /&gt;
&lt;br /&gt;
Figure below shows the numerically obtained solution. Four three-dimensional&lt;br /&gt;
slices are shown, defined by setting one coordinate to $x_i = 1/2$.&lt;br /&gt;
Modified Sheppard's interpolation algorithm was used to interpolate the&lt;br /&gt;
solution to an intermediate grid, used for plotting the slices.&lt;br /&gt;
&lt;br /&gt;
[[File:4Dsolution.png|800px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>E6WikiAdmin</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=HP-adaptivity&amp;diff=3589</id>
		<title>HP-adaptivity</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=HP-adaptivity&amp;diff=3589"/>
				<updated>2024-01-22T17:02:04Z</updated>
		
		<summary type="html">&lt;p&gt;E6WikiAdmin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Box-round|title= Related papers |&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/153678339.pdf M. Jančič, G. Kosec; Strong form mesh‑free hp‑adaptive solution of linear elasticity problem, Engineering with computers, vol. 39, 2023 DOI: 10.1007/s00366-023-01843-6]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Adaptive solution procedures are essential in problems where the accuracy of the numerical solution varies spatially and are currently subject of intensive studies. Two conceptually different adaptive approaches have been proposed, namely $p$-adaptivity or $h$-, $r$-adaptivity. In $p$-adaptivity, the accuracy of the numerical solution is varied by changing the order of approximation, while in $h$- and $r$-adaptivity the resolution of the spatial discretization is adjusted for the same purpose. In the $h$-adaptive approach, nodes are added or removed from the domain as needed, while in the $r$-adaptive approach, the total number of nodes remains constant - the nodes are only repositioned with respect to the desired accuracy. Ultimately, $h$- and $p$-adaptivities can be combined to form the so-called $hp$-adaptivity, where the accuracy of the solution is controlled with the order of the method and the resolution of the spatial discretization.&lt;br /&gt;
&lt;br /&gt;
__FORCETOC__&lt;br /&gt;
&lt;br /&gt;
==  Basic concept ==&lt;br /&gt;
&lt;br /&gt;
The proposed $hp$-adaptive solution procedure follows the well-established paradigm based on an iterative loop, where each iteration step consists of four modules:&lt;br /&gt;
* '''Solve''' - A numerical solution $\widehat{u}$ is obtained.&lt;br /&gt;
* '''Estimate''' - An estimate of the spatial accuracy of the numerical solution is calculated using error indicators.&lt;br /&gt;
* '''Mark''' - Depending on the error indicator values $\eta _i$, a marking strategy is used to mark the computational nodes for (de)refinement.&lt;br /&gt;
* '''Refine''' - Refinement strategy is employed to define the amount of the (de)refinement.&lt;br /&gt;
&lt;br /&gt;
Expected result is drafted in figure below.&lt;br /&gt;
&lt;br /&gt;
[[File:refinement_workflow.png|800px]]&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
The implementation of $hp$-adaptive solution procedure can be found [https://gitlab.com/e62Lab/public/2022_p_hp-adaptivity here].&lt;br /&gt;
&lt;br /&gt;
== Solution procedure ==&lt;br /&gt;
=== Solve ===&lt;br /&gt;
&lt;br /&gt;
First a numerical solution $\widehat{u}$ to the governing problem must be obtained. In general, the numerical treatment of a system of PDEs is done in several steps. First, the domain is discretized by positioning the nodes, then the linear differential operators in each computational node are approximated, and, finally, the system of PDEs is discretized and assembled into a large sparse linear system. To obtain a numerical solution $\widehat{u}$, the sparse system is solved.&lt;br /&gt;
&lt;br /&gt;
=== Estimate (IMEX error indicator) ===&lt;br /&gt;
In the estimation step, critical areas with high error of the numerical solution are identified. Identifying such areas is not a trivial task. In rare cases, where a closed form solution to the governing system of PDEs exists, we can not only indicate such areas but also estimate the accuracy of the numerical solution. However, for real-world problems, which are often subject of numerical simulations, closed form solutions do not exist. Therefore, other objective metrics are needed to indicate the computational nodes with high error of the numerical solution. Numerical tools used in such cases are commonly referred to as ''error indicators''.&lt;br /&gt;
&lt;br /&gt;
We have chosen to use our own error indication algorithm IMEX &amp;lt;ref name=&amp;quot;imex&amp;quot;&amp;gt; Jančič, Mitja, Filip Strniša, and Gregor Kosec. &amp;quot;Implicit-Explicit Error Indicator based on Approximation Order.&amp;quot; arXiv preprint arXiv:2204.01022 (2022).&amp;lt;/ref&amp;gt; for implementation-related convenience reasons. This error indicator makes use of the implicitly obtained numerical solution and explicit operators (approximated by higher-order basis) to reconstruct the right-hand side of the governing problem.&lt;br /&gt;
&lt;br /&gt;
To further explain basic idea of IMEX, let us define a PDE of type:&lt;br /&gt;
$$&lt;br /&gt;
    \mathcal L u = f_{RHS},&lt;br /&gt;
$$&lt;br /&gt;
where $\mathcal L$ is a differential operator applied to the scalar field $u$ and $f_{RHS}$ is a function. To obtain an error indicator field $\eta$, the problem is first solved implicitly by using a lower order approximation of operators $\mathcal L$, $\mathcal L^{(lo)}_{im}$, obtaining the solution $u^{(im)}$ in the process. The implicitly computed field $u^{(im)}$ is then used to explicitly reconstruct the right-hand side of the governing problem, but this time using a higher order approximation of $\mathcal L$, $\mathcal L^{(hi)}_{ex}$, obtaining $f_{RHS}^{(ex)}$ in the process.&lt;br /&gt;
Finally, $f_{RHS}^{(ex)}$ and $f_{RHS}$ are compared $\eta = \left | f_{RHS} - f_{RHS}^{(ex)} \right |$ to indicate the error of the numerical solution.&lt;br /&gt;
&lt;br /&gt;
=== Mark ===&lt;br /&gt;
&lt;br /&gt;
After the error indicator $\eta$ had been obtained for each computational point in $\Omega$, a marking strategy is employed. The main objective of this step is to flag the nodes with too high or too low error indicator values in order to achieve a uniformly distributed precision of the numerical solution and reduce computational costs - by avoiding fine local field descriptions and high order approximations where this is not required. Furthermore, the marking strategy not only decides whether or not (de)refinement should take place at a given computational node, but also defines the type of the refinement procedure in cases where there are multiple to choose from.&lt;br /&gt;
&lt;br /&gt;
In each adaptivity iteration, the marking strategy starts by checking the error indicator values $\eta _i$ for all computational nodes in the domain. If $\eta _i$ is greater than $\alpha \eta_{max}$ for a free model parameter $\alpha \in (0, 1)$, the node is marked for refinement. If $\eta _i$ is less than $\beta \eta_{max}$ for a free model parameter $\beta \in (0,1) \land \beta \leq \alpha$, the node is marked for derefinement. Otherwise, the node is left unmarked meaning no refinement should take place. The marking strategy can be summarized with a single equation&lt;br /&gt;
$$&lt;br /&gt;
    \begin{cases}&lt;br /&gt;
        \eta _i &amp;gt; \alpha \eta_{max},                          &amp;amp; \text{ refine}     \\&lt;br /&gt;
        \beta \eta_{max} \leq \eta _i \leq \alpha \eta_{max}, &amp;amp; \text{ do nothing} \\&lt;br /&gt;
        \eta _i &amp;lt; \beta \eta_{max},                           &amp;amp; \text{ derefine}&lt;br /&gt;
    \end{cases}.&lt;br /&gt;
$$&lt;br /&gt;
&lt;br /&gt;
In the context of mesh-based methods, it has already been observed, that this strategy is indeed simple to implement, however, far from optimal in terms of achieving good convergence rates. Our studies have shown that a slight modification to the originally proposed strategy can significantly improve the performance of an $hp$-adaptive solution procedure in the context of mesh-free methods, but at the cost of higher number of free parameters - making it more difficult to understand. Nevertheless, the strategy is modified by introducing parameters $\left \{ \alpha_h, \beta_h \right \}$ and $\left \{ \alpha_p, \beta_p \right \}$ for separate treatment of $h$- and $p$-refinements respectively. A schematic is shown in figure below.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot from 2022-09-20 08-25-34.png|800px]]&lt;br /&gt;
&lt;br /&gt;
=== Refine ===&lt;br /&gt;
&lt;br /&gt;
After obtaining the list of nodes marked for modification, the refinement module is initialized. In this module, the local field description and local approximation order for the unmarked nodes are left unchanged, while the rest are further processed to determine other refinement-type-specific details - such as the amount of the (de)refinement. &lt;br /&gt;
&lt;br /&gt;
We use the following $h$-refinement rule&lt;br /&gt;
$$&lt;br /&gt;
    \label{eq:refinement}&lt;br /&gt;
    h_i^{new}(\b p) = \frac{h_i^{old}}{\frac{\eta_i - \alpha \eta _{max}}{\eta_{max} - \alpha\eta_{max}}\big(\lambda - 1\big) + 1}&lt;br /&gt;
$$&lt;br /&gt;
for the dimensionless parameter $\lambda \in [1, \infty)$ allowing us to control the aggressiveness of the refinement - the larger the value, the greater the change. This refinement rule also conveniently refines the areas with higher error indicator values more than the ones that are closer to the upper refinement threshold $\alpha_h \eta_{max}$. Similarly, a derefinement rule is proposed&lt;br /&gt;
$$&lt;br /&gt;
    \label{eq:derefinement}&lt;br /&gt;
    h_i^{new}(\b p) = \frac{h_i^{old}}{\frac{\beta \eta _{max} - \eta_i}{\beta\eta_{max} - \eta_{min}}\big(\frac{1}{\vartheta} - 1\big) + 1},&lt;br /&gt;
$$&lt;br /&gt;
where parameter $\vartheta \in [1, \infty)$ allows us to control the aggressiveness of derefinement.&lt;br /&gt;
&lt;br /&gt;
The same refinement and derefinement strategies were applied to control the local approximation order, except this time the value is rounded to the nearest integer. Similarly and for the same reasons as we did with the marking strategy, we consider a separate treatment of $h$- and $p$-adaptive procedures, by introducing (de)refinement aggressiveness parameters $\left \{\lambda_h, \vartheta_h \right \}$ and $\left \{\lambda_p, \vartheta_p \right \}$ for $h$- and $p$-refinement types respectively.&lt;br /&gt;
&lt;br /&gt;
[[File:refinement_rules.png|800px]]&lt;br /&gt;
&lt;br /&gt;
=== Finalization step ===&lt;br /&gt;
&lt;br /&gt;
Before the 4 modules can be iteratively repeated, the domain is rediscretized taking into account the newly computed local internodal distances $h_i^{new}(\b p)$ and the local approximation orders $m_i^{new}(\b p)$. However, both are only known in the computational nodes, while global functions $\widehat{h}^{new}(\b p)$ and $\widehat{m}^{new}(\b p)$ over our entire domain space $\Omega$ are required. These are obtained by employing the Sheppard's inverse distance weighting interpolation.&lt;br /&gt;
&lt;br /&gt;
Figure below schematically demonstrates 3 examples of $hp$-refinements. For the sake of demonstration, the refinement parameters for $h$- and $p$-adaptivity are the same, i.e. $\left \{ \alpha, \beta, \lambda, \vartheta \right \} = \left \{ \alpha_h, \beta_h, \lambda_h, \vartheta_h \right \} = \left \{ \alpha_p, \beta_p, \lambda_p, \vartheta_p \right \}$. Additionally, the derefinement aggressiveness $\vartheta$ and the upper threshold $\beta$ are kept constant, so, effectively, only the upper bound of refinement $\alpha$ and refinement aggressiveness $\lambda$ are altered. We observe that the effect refinement parameters is somewhat intuitive. The larger the aggressiveness $\lambda$ the better the local field description and the larger the number of nodes with high approximation order. Similar effect is observed with manipulating the upper refinement threshold $\alpha$, except the effect comes at a smoother manner. Also observe that all refined states were able to increase the accuracy of the numerical solution from the initial state.&lt;br /&gt;
&lt;br /&gt;
[[File:refinement_demonstration.png|800px]]&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
=== Example peak problem ===&lt;br /&gt;
&lt;br /&gt;
The proposed $hp$-adaptive solution procedure is demonstrated on a synthetical example. We chose a 2-dimensional Poisson problem with exponentially strong source positioned at $\boldsymbol x_s = \Big (\frac{1}{2}, \frac{1}{3}\Big )$. This example is categorized as a difficult problem and is commonly used to test the performance of adaptive solution procedures. The problem has a tractable solution $u(\boldsymbol x)=e^{-a \left \| \boldsymbol x - \boldsymbol x_s \right \|^2}$, which allows us to evaluate the precision of the numerical solution $\widehat{u}$, e.g.\ in terms of the infinity norm.&lt;br /&gt;
&lt;br /&gt;
Governing equations are&lt;br /&gt;
$$&lt;br /&gt;
    \nabla^2 u (\boldsymbol x)   = 2a e^{-a \left \| \boldsymbol x - \boldsymbol x_s \right \|^2}(2a\left \| \boldsymbol x - \boldsymbol x_s \right \| - d) \quad \quad \text{in } \Omega,   \\&lt;br /&gt;
    u (\boldsymbol x)        = e^{-a \left \| \boldsymbol x - \boldsymbol x_s \right \|^2}                                       \quad \quad  \text{on } \Gamma_d, \\&lt;br /&gt;
    \nabla u (\boldsymbol x) = -2a(\boldsymbol x - \boldsymbol x_s)e^{-a \left \| \boldsymbol x - \boldsymbol x_s \right \|^2}                           \quad \quad\text{on } \Gamma_n,&lt;br /&gt;
$$&lt;br /&gt;
&lt;br /&gt;
Figure below shows example indicator fields for initial iteration, intermediate iteration and iteration that achieved the best accuracy of the numerical solution. The third column shows the IMEX error indicator. We can see that the IMEX successfully located the position of the strong source at $\boldsymbol x_s = \Big (\frac{1}{2}, \frac{1}{3}\Big )$ as the highest indicator values are seen in its neighborhood. Moreover, the second column shows that the accuracy of the numerical solution and uniformity of error distribution have both been significantly improved by the $hp$-adaptive solution procedure, further proving that the IMEX can be successfully employed as a reliable error indicator.&lt;br /&gt;
&lt;br /&gt;
[[File:refinement_demonstration_2d.png|800px]]&lt;br /&gt;
&lt;br /&gt;
The behavior of IMEX over 70 adaptivity iterations is further studied in figure below. We are pleased to see that the convergence limit of the indicator around iteration $N_{iter}=60$ agrees well with the convergence limit of the numerical solution. &lt;br /&gt;
&lt;br /&gt;
[[File:error_indicator_convergence.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Finally, the convergence behavior of the proposed $hp$-adaptive solution procedure is studied. In addition to the convergence of a single $hp$-adaptive run, the convergences obtained without the use of refinement procedures, i.e. solutions obtained with uniform internodal spacing and approximation orders over the entire domain, are shown in figure below. The figure evidently shows that a $hp$-adaptive solution procedure was able to notably improve the numerical solution in terms of accuracy and required computational points.&lt;br /&gt;
&lt;br /&gt;
[[File:convergence_of_h_hp.png|800px]]&lt;br /&gt;
&lt;br /&gt;
=== Application to linear elasticity problems: Fretting fatigue contact ===&lt;br /&gt;
&lt;br /&gt;
The application of the proposed $hp$-adaptive solution procedure is further expanded to study a linear elasticity problem. Specifically, we obtain a $hp$-refined solution to fretting fatigue contact problem &amp;lt;ref name=&amp;quot;fwo&amp;quot;&amp;gt;Pereira, Kyvia, et al. &amp;quot;On the convergence of stresses in fretting fatigue.&amp;quot; Materials 9.8 (2016): 639.&amp;lt;/ref&amp;gt;, for which the authors believe no closed form solution is known.&lt;br /&gt;
&lt;br /&gt;
The problem formulation is given here &amp;lt;ref name=&amp;quot;slak&amp;quot;&amp;gt;Slak, Jure, and Gregor Kosec. &amp;quot;Adaptive radial basis function–generated finite differences method for contact problems.&amp;quot; International Journal for Numerical Methods in Engineering 119.7 (2019): 661-686.&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Figure below shows an example of $hp$-refined solution to fretting fatigue problem at the last adaptivity iteration with $N=46\,626$ computational nodes. We see that the solution procedure successfully located the two critical points, i.e. the fixed top left corner with a stress singularity and the area in the middle of the top edge where the contact is simulated. Note that the highest stress values (approximately $2$ times higher) have been computed in the singularity in the top left corner, but those nodes are not shown since our focus is shifted towards the area under the contact.&lt;br /&gt;
&lt;br /&gt;
[[File:fwo_solution_hp.png|800px]]&lt;br /&gt;
&lt;br /&gt;
For a detailed analysis, we look at the surface traction $\sigma_{xx}$, as it is often used to determine the location of crack initiation. The surface traction is shown in figure below for $6$ selected adaptivity iterations. The mesh-free nodes are colored according to the local approximation order enforced by the $hp$-adaptive solution procedure. The message of this figure is twofold. Firstly, it is clear that the proposed IMEX error indicator can be successfully used in linear elasticity problems, and secondly, we observe that the $hp$-adaptive solution procedure successfully approximated the surface traction in the neighborhood of the contact. In the process, the local field description under the contact has been significantly improved and also the local approximation orders have taken a non-trivial distribution.&lt;br /&gt;
&lt;br /&gt;
[[File:fwo_abaqus.png|800px]]&lt;br /&gt;
&lt;br /&gt;
The surface traction is additionally accompanied with the FEM results on a much denser mesh with more than 100\,000 DOFs obtained with the commercial solver Abaqus\textsuperscript{\textregistered}. To compute the absolute difference between the two methods, the mesh-free solution has been interpolated to Abaqus's computational points using the Sheppard's inverse distance weighting interpolation with $2$ closest neighbors. We see that the absolute difference is decreasing with the number of adaptivity iterations, finally settling at approximately 2 % of the maximum value under the contact at initial iteration. The highest absolute difference is expectedly located at the edges of the contact, i.e. around $x=a$ and $x=-a$, while the difference in the rest of the contact is even smaller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>E6WikiAdmin</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=HP-adaptivity&amp;diff=3588</id>
		<title>HP-adaptivity</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=HP-adaptivity&amp;diff=3588"/>
				<updated>2024-01-22T17:01:57Z</updated>
		
		<summary type="html">&lt;p&gt;E6WikiAdmin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Box-round|title= Related papers |&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/153678339.pdf M. Jančič, G. Kosec; Strong form mesh‑free hp‑adaptive solution of linear elasticity problem, Engineering with computers, vol. 39, 2023 [DOI: 10.1007/s00366-023-01843-6]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Adaptive solution procedures are essential in problems where the accuracy of the numerical solution varies spatially and are currently subject of intensive studies. Two conceptually different adaptive approaches have been proposed, namely $p$-adaptivity or $h$-, $r$-adaptivity. In $p$-adaptivity, the accuracy of the numerical solution is varied by changing the order of approximation, while in $h$- and $r$-adaptivity the resolution of the spatial discretization is adjusted for the same purpose. In the $h$-adaptive approach, nodes are added or removed from the domain as needed, while in the $r$-adaptive approach, the total number of nodes remains constant - the nodes are only repositioned with respect to the desired accuracy. Ultimately, $h$- and $p$-adaptivities can be combined to form the so-called $hp$-adaptivity, where the accuracy of the solution is controlled with the order of the method and the resolution of the spatial discretization.&lt;br /&gt;
&lt;br /&gt;
__FORCETOC__&lt;br /&gt;
&lt;br /&gt;
==  Basic concept ==&lt;br /&gt;
&lt;br /&gt;
The proposed $hp$-adaptive solution procedure follows the well-established paradigm based on an iterative loop, where each iteration step consists of four modules:&lt;br /&gt;
* '''Solve''' - A numerical solution $\widehat{u}$ is obtained.&lt;br /&gt;
* '''Estimate''' - An estimate of the spatial accuracy of the numerical solution is calculated using error indicators.&lt;br /&gt;
* '''Mark''' - Depending on the error indicator values $\eta _i$, a marking strategy is used to mark the computational nodes for (de)refinement.&lt;br /&gt;
* '''Refine''' - Refinement strategy is employed to define the amount of the (de)refinement.&lt;br /&gt;
&lt;br /&gt;
Expected result is drafted in figure below.&lt;br /&gt;
&lt;br /&gt;
[[File:refinement_workflow.png|800px]]&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
The implementation of $hp$-adaptive solution procedure can be found [https://gitlab.com/e62Lab/public/2022_p_hp-adaptivity here].&lt;br /&gt;
&lt;br /&gt;
== Solution procedure ==&lt;br /&gt;
=== Solve ===&lt;br /&gt;
&lt;br /&gt;
First a numerical solution $\widehat{u}$ to the governing problem must be obtained. In general, the numerical treatment of a system of PDEs is done in several steps. First, the domain is discretized by positioning the nodes, then the linear differential operators in each computational node are approximated, and, finally, the system of PDEs is discretized and assembled into a large sparse linear system. To obtain a numerical solution $\widehat{u}$, the sparse system is solved.&lt;br /&gt;
&lt;br /&gt;
=== Estimate (IMEX error indicator) ===&lt;br /&gt;
In the estimation step, critical areas with high error of the numerical solution are identified. Identifying such areas is not a trivial task. In rare cases, where a closed form solution to the governing system of PDEs exists, we can not only indicate such areas but also estimate the accuracy of the numerical solution. However, for real-world problems, which are often subject of numerical simulations, closed form solutions do not exist. Therefore, other objective metrics are needed to indicate the computational nodes with high error of the numerical solution. Numerical tools used in such cases are commonly referred to as ''error indicators''.&lt;br /&gt;
&lt;br /&gt;
We have chosen to use our own error indication algorithm IMEX &amp;lt;ref name=&amp;quot;imex&amp;quot;&amp;gt; Jančič, Mitja, Filip Strniša, and Gregor Kosec. &amp;quot;Implicit-Explicit Error Indicator based on Approximation Order.&amp;quot; arXiv preprint arXiv:2204.01022 (2022).&amp;lt;/ref&amp;gt; for implementation-related convenience reasons. This error indicator makes use of the implicitly obtained numerical solution and explicit operators (approximated by higher-order basis) to reconstruct the right-hand side of the governing problem.&lt;br /&gt;
&lt;br /&gt;
To further explain basic idea of IMEX, let us define a PDE of type:&lt;br /&gt;
$$&lt;br /&gt;
    \mathcal L u = f_{RHS},&lt;br /&gt;
$$&lt;br /&gt;
where $\mathcal L$ is a differential operator applied to the scalar field $u$ and $f_{RHS}$ is a function. To obtain an error indicator field $\eta$, the problem is first solved implicitly by using a lower order approximation of operators $\mathcal L$, $\mathcal L^{(lo)}_{im}$, obtaining the solution $u^{(im)}$ in the process. The implicitly computed field $u^{(im)}$ is then used to explicitly reconstruct the right-hand side of the governing problem, but this time using a higher order approximation of $\mathcal L$, $\mathcal L^{(hi)}_{ex}$, obtaining $f_{RHS}^{(ex)}$ in the process.&lt;br /&gt;
Finally, $f_{RHS}^{(ex)}$ and $f_{RHS}$ are compared $\eta = \left | f_{RHS} - f_{RHS}^{(ex)} \right |$ to indicate the error of the numerical solution.&lt;br /&gt;
&lt;br /&gt;
=== Mark ===&lt;br /&gt;
&lt;br /&gt;
After the error indicator $\eta$ had been obtained for each computational point in $\Omega$, a marking strategy is employed. The main objective of this step is to flag the nodes with too high or too low error indicator values in order to achieve a uniformly distributed precision of the numerical solution and reduce computational costs - by avoiding fine local field descriptions and high order approximations where this is not required. Furthermore, the marking strategy not only decides whether or not (de)refinement should take place at a given computational node, but also defines the type of the refinement procedure in cases where there are multiple to choose from.&lt;br /&gt;
&lt;br /&gt;
In each adaptivity iteration, the marking strategy starts by checking the error indicator values $\eta _i$ for all computational nodes in the domain. If $\eta _i$ is greater than $\alpha \eta_{max}$ for a free model parameter $\alpha \in (0, 1)$, the node is marked for refinement. If $\eta _i$ is less than $\beta \eta_{max}$ for a free model parameter $\beta \in (0,1) \land \beta \leq \alpha$, the node is marked for derefinement. Otherwise, the node is left unmarked meaning no refinement should take place. The marking strategy can be summarized with a single equation&lt;br /&gt;
$$&lt;br /&gt;
    \begin{cases}&lt;br /&gt;
        \eta _i &amp;gt; \alpha \eta_{max},                          &amp;amp; \text{ refine}     \\&lt;br /&gt;
        \beta \eta_{max} \leq \eta _i \leq \alpha \eta_{max}, &amp;amp; \text{ do nothing} \\&lt;br /&gt;
        \eta _i &amp;lt; \beta \eta_{max},                           &amp;amp; \text{ derefine}&lt;br /&gt;
    \end{cases}.&lt;br /&gt;
$$&lt;br /&gt;
&lt;br /&gt;
In the context of mesh-based methods, it has already been observed, that this strategy is indeed simple to implement, however, far from optimal in terms of achieving good convergence rates. Our studies have shown that a slight modification to the originally proposed strategy can significantly improve the performance of an $hp$-adaptive solution procedure in the context of mesh-free methods, but at the cost of higher number of free parameters - making it more difficult to understand. Nevertheless, the strategy is modified by introducing parameters $\left \{ \alpha_h, \beta_h \right \}$ and $\left \{ \alpha_p, \beta_p \right \}$ for separate treatment of $h$- and $p$-refinements respectively. A schematic is shown in figure below.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot from 2022-09-20 08-25-34.png|800px]]&lt;br /&gt;
&lt;br /&gt;
=== Refine ===&lt;br /&gt;
&lt;br /&gt;
After obtaining the list of nodes marked for modification, the refinement module is initialized. In this module, the local field description and local approximation order for the unmarked nodes are left unchanged, while the rest are further processed to determine other refinement-type-specific details - such as the amount of the (de)refinement. &lt;br /&gt;
&lt;br /&gt;
We use the following $h$-refinement rule&lt;br /&gt;
$$&lt;br /&gt;
    \label{eq:refinement}&lt;br /&gt;
    h_i^{new}(\b p) = \frac{h_i^{old}}{\frac{\eta_i - \alpha \eta _{max}}{\eta_{max} - \alpha\eta_{max}}\big(\lambda - 1\big) + 1}&lt;br /&gt;
$$&lt;br /&gt;
for the dimensionless parameter $\lambda \in [1, \infty)$ allowing us to control the aggressiveness of the refinement - the larger the value, the greater the change. This refinement rule also conveniently refines the areas with higher error indicator values more than the ones that are closer to the upper refinement threshold $\alpha_h \eta_{max}$. Similarly, a derefinement rule is proposed&lt;br /&gt;
$$&lt;br /&gt;
    \label{eq:derefinement}&lt;br /&gt;
    h_i^{new}(\b p) = \frac{h_i^{old}}{\frac{\beta \eta _{max} - \eta_i}{\beta\eta_{max} - \eta_{min}}\big(\frac{1}{\vartheta} - 1\big) + 1},&lt;br /&gt;
$$&lt;br /&gt;
where parameter $\vartheta \in [1, \infty)$ allows us to control the aggressiveness of derefinement.&lt;br /&gt;
&lt;br /&gt;
The same refinement and derefinement strategies were applied to control the local approximation order, except this time the value is rounded to the nearest integer. Similarly and for the same reasons as we did with the marking strategy, we consider a separate treatment of $h$- and $p$-adaptive procedures, by introducing (de)refinement aggressiveness parameters $\left \{\lambda_h, \vartheta_h \right \}$ and $\left \{\lambda_p, \vartheta_p \right \}$ for $h$- and $p$-refinement types respectively.&lt;br /&gt;
&lt;br /&gt;
[[File:refinement_rules.png|800px]]&lt;br /&gt;
&lt;br /&gt;
=== Finalization step ===&lt;br /&gt;
&lt;br /&gt;
Before the 4 modules can be iteratively repeated, the domain is rediscretized taking into account the newly computed local internodal distances $h_i^{new}(\b p)$ and the local approximation orders $m_i^{new}(\b p)$. However, both are only known in the computational nodes, while global functions $\widehat{h}^{new}(\b p)$ and $\widehat{m}^{new}(\b p)$ over our entire domain space $\Omega$ are required. These are obtained by employing the Sheppard's inverse distance weighting interpolation.&lt;br /&gt;
&lt;br /&gt;
Figure below schematically demonstrates 3 examples of $hp$-refinements. For the sake of demonstration, the refinement parameters for $h$- and $p$-adaptivity are the same, i.e. $\left \{ \alpha, \beta, \lambda, \vartheta \right \} = \left \{ \alpha_h, \beta_h, \lambda_h, \vartheta_h \right \} = \left \{ \alpha_p, \beta_p, \lambda_p, \vartheta_p \right \}$. Additionally, the derefinement aggressiveness $\vartheta$ and the upper threshold $\beta$ are kept constant, so, effectively, only the upper bound of refinement $\alpha$ and refinement aggressiveness $\lambda$ are altered. We observe that the effect refinement parameters is somewhat intuitive. The larger the aggressiveness $\lambda$ the better the local field description and the larger the number of nodes with high approximation order. Similar effect is observed with manipulating the upper refinement threshold $\alpha$, except the effect comes at a smoother manner. Also observe that all refined states were able to increase the accuracy of the numerical solution from the initial state.&lt;br /&gt;
&lt;br /&gt;
[[File:refinement_demonstration.png|800px]]&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
=== Example peak problem ===&lt;br /&gt;
&lt;br /&gt;
The proposed $hp$-adaptive solution procedure is demonstrated on a synthetical example. We chose a 2-dimensional Poisson problem with exponentially strong source positioned at $\boldsymbol x_s = \Big (\frac{1}{2}, \frac{1}{3}\Big )$. This example is categorized as a difficult problem and is commonly used to test the performance of adaptive solution procedures. The problem has a tractable solution $u(\boldsymbol x)=e^{-a \left \| \boldsymbol x - \boldsymbol x_s \right \|^2}$, which allows us to evaluate the precision of the numerical solution $\widehat{u}$, e.g.\ in terms of the infinity norm.&lt;br /&gt;
&lt;br /&gt;
Governing equations are&lt;br /&gt;
$$&lt;br /&gt;
    \nabla^2 u (\boldsymbol x)   = 2a e^{-a \left \| \boldsymbol x - \boldsymbol x_s \right \|^2}(2a\left \| \boldsymbol x - \boldsymbol x_s \right \| - d) \quad \quad \text{in } \Omega,   \\&lt;br /&gt;
    u (\boldsymbol x)        = e^{-a \left \| \boldsymbol x - \boldsymbol x_s \right \|^2}                                       \quad \quad  \text{on } \Gamma_d, \\&lt;br /&gt;
    \nabla u (\boldsymbol x) = -2a(\boldsymbol x - \boldsymbol x_s)e^{-a \left \| \boldsymbol x - \boldsymbol x_s \right \|^2}                           \quad \quad\text{on } \Gamma_n,&lt;br /&gt;
$$&lt;br /&gt;
&lt;br /&gt;
Figure below shows example indicator fields for initial iteration, intermediate iteration and iteration that achieved the best accuracy of the numerical solution. The third column shows the IMEX error indicator. We can see that the IMEX successfully located the position of the strong source at $\boldsymbol x_s = \Big (\frac{1}{2}, \frac{1}{3}\Big )$ as the highest indicator values are seen in its neighborhood. Moreover, the second column shows that the accuracy of the numerical solution and uniformity of error distribution have both been significantly improved by the $hp$-adaptive solution procedure, further proving that the IMEX can be successfully employed as a reliable error indicator.&lt;br /&gt;
&lt;br /&gt;
[[File:refinement_demonstration_2d.png|800px]]&lt;br /&gt;
&lt;br /&gt;
The behavior of IMEX over 70 adaptivity iterations is further studied in figure below. We are pleased to see that the convergence limit of the indicator around iteration $N_{iter}=60$ agrees well with the convergence limit of the numerical solution. &lt;br /&gt;
&lt;br /&gt;
[[File:error_indicator_convergence.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Finally, the convergence behavior of the proposed $hp$-adaptive solution procedure is studied. In addition to the convergence of a single $hp$-adaptive run, the convergences obtained without the use of refinement procedures, i.e. solutions obtained with uniform internodal spacing and approximation orders over the entire domain, are shown in figure below. The figure evidently shows that a $hp$-adaptive solution procedure was able to notably improve the numerical solution in terms of accuracy and required computational points.&lt;br /&gt;
&lt;br /&gt;
[[File:convergence_of_h_hp.png|800px]]&lt;br /&gt;
&lt;br /&gt;
=== Application to linear elasticity problems: Fretting fatigue contact ===&lt;br /&gt;
&lt;br /&gt;
The application of the proposed $hp$-adaptive solution procedure is further expanded to study a linear elasticity problem. Specifically, we obtain a $hp$-refined solution to fretting fatigue contact problem &amp;lt;ref name=&amp;quot;fwo&amp;quot;&amp;gt;Pereira, Kyvia, et al. &amp;quot;On the convergence of stresses in fretting fatigue.&amp;quot; Materials 9.8 (2016): 639.&amp;lt;/ref&amp;gt;, for which the authors believe no closed form solution is known.&lt;br /&gt;
&lt;br /&gt;
The problem formulation is given here &amp;lt;ref name=&amp;quot;slak&amp;quot;&amp;gt;Slak, Jure, and Gregor Kosec. &amp;quot;Adaptive radial basis function–generated finite differences method for contact problems.&amp;quot; International Journal for Numerical Methods in Engineering 119.7 (2019): 661-686.&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Figure below shows an example of $hp$-refined solution to fretting fatigue problem at the last adaptivity iteration with $N=46\,626$ computational nodes. We see that the solution procedure successfully located the two critical points, i.e. the fixed top left corner with a stress singularity and the area in the middle of the top edge where the contact is simulated. Note that the highest stress values (approximately $2$ times higher) have been computed in the singularity in the top left corner, but those nodes are not shown since our focus is shifted towards the area under the contact.&lt;br /&gt;
&lt;br /&gt;
[[File:fwo_solution_hp.png|800px]]&lt;br /&gt;
&lt;br /&gt;
For a detailed analysis, we look at the surface traction $\sigma_{xx}$, as it is often used to determine the location of crack initiation. The surface traction is shown in figure below for $6$ selected adaptivity iterations. The mesh-free nodes are colored according to the local approximation order enforced by the $hp$-adaptive solution procedure. The message of this figure is twofold. Firstly, it is clear that the proposed IMEX error indicator can be successfully used in linear elasticity problems, and secondly, we observe that the $hp$-adaptive solution procedure successfully approximated the surface traction in the neighborhood of the contact. In the process, the local field description under the contact has been significantly improved and also the local approximation orders have taken a non-trivial distribution.&lt;br /&gt;
&lt;br /&gt;
[[File:fwo_abaqus.png|800px]]&lt;br /&gt;
&lt;br /&gt;
The surface traction is additionally accompanied with the FEM results on a much denser mesh with more than 100\,000 DOFs obtained with the commercial solver Abaqus\textsuperscript{\textregistered}. To compute the absolute difference between the two methods, the mesh-free solution has been interpolated to Abaqus's computational points using the Sheppard's inverse distance weighting interpolation with $2$ closest neighbors. We see that the absolute difference is decreasing with the number of adaptivity iterations, finally settling at approximately 2 % of the maximum value under the contact at initial iteration. The highest absolute difference is expectedly located at the edges of the contact, i.e. around $x=a$ and $x=-a$, while the difference in the rest of the contact is even smaller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>E6WikiAdmin</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=HP-adaptivity&amp;diff=3587</id>
		<title>HP-adaptivity</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=HP-adaptivity&amp;diff=3587"/>
				<updated>2024-01-22T17:01:38Z</updated>
		
		<summary type="html">&lt;p&gt;E6WikiAdmin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Box-round|title= Related papers |&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/153678339.pdf M. Jančič, G. Kosec; Strong form mesh‑free hp‑adaptive solution of linear elasticity problem, Engineering with computers, vol. 39, 2023 [DOI: 10.1007/s00366-023-01843-6][COBISS: 153678339]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Adaptive solution procedures are essential in problems where the accuracy of the numerical solution varies spatially and are currently subject of intensive studies. Two conceptually different adaptive approaches have been proposed, namely $p$-adaptivity or $h$-, $r$-adaptivity. In $p$-adaptivity, the accuracy of the numerical solution is varied by changing the order of approximation, while in $h$- and $r$-adaptivity the resolution of the spatial discretization is adjusted for the same purpose. In the $h$-adaptive approach, nodes are added or removed from the domain as needed, while in the $r$-adaptive approach, the total number of nodes remains constant - the nodes are only repositioned with respect to the desired accuracy. Ultimately, $h$- and $p$-adaptivities can be combined to form the so-called $hp$-adaptivity, where the accuracy of the solution is controlled with the order of the method and the resolution of the spatial discretization.&lt;br /&gt;
&lt;br /&gt;
__FORCETOC__&lt;br /&gt;
&lt;br /&gt;
==  Basic concept ==&lt;br /&gt;
&lt;br /&gt;
The proposed $hp$-adaptive solution procedure follows the well-established paradigm based on an iterative loop, where each iteration step consists of four modules:&lt;br /&gt;
* '''Solve''' - A numerical solution $\widehat{u}$ is obtained.&lt;br /&gt;
* '''Estimate''' - An estimate of the spatial accuracy of the numerical solution is calculated using error indicators.&lt;br /&gt;
* '''Mark''' - Depending on the error indicator values $\eta _i$, a marking strategy is used to mark the computational nodes for (de)refinement.&lt;br /&gt;
* '''Refine''' - Refinement strategy is employed to define the amount of the (de)refinement.&lt;br /&gt;
&lt;br /&gt;
Expected result is drafted in figure below.&lt;br /&gt;
&lt;br /&gt;
[[File:refinement_workflow.png|800px]]&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
The implementation of $hp$-adaptive solution procedure can be found [https://gitlab.com/e62Lab/public/2022_p_hp-adaptivity here].&lt;br /&gt;
&lt;br /&gt;
== Solution procedure ==&lt;br /&gt;
=== Solve ===&lt;br /&gt;
&lt;br /&gt;
First a numerical solution $\widehat{u}$ to the governing problem must be obtained. In general, the numerical treatment of a system of PDEs is done in several steps. First, the domain is discretized by positioning the nodes, then the linear differential operators in each computational node are approximated, and, finally, the system of PDEs is discretized and assembled into a large sparse linear system. To obtain a numerical solution $\widehat{u}$, the sparse system is solved.&lt;br /&gt;
&lt;br /&gt;
=== Estimate (IMEX error indicator) ===&lt;br /&gt;
In the estimation step, critical areas with high error of the numerical solution are identified. Identifying such areas is not a trivial task. In rare cases, where a closed form solution to the governing system of PDEs exists, we can not only indicate such areas but also estimate the accuracy of the numerical solution. However, for real-world problems, which are often subject of numerical simulations, closed form solutions do not exist. Therefore, other objective metrics are needed to indicate the computational nodes with high error of the numerical solution. Numerical tools used in such cases are commonly referred to as ''error indicators''.&lt;br /&gt;
&lt;br /&gt;
We have chosen to use our own error indication algorithm IMEX &amp;lt;ref name=&amp;quot;imex&amp;quot;&amp;gt; Jančič, Mitja, Filip Strniša, and Gregor Kosec. &amp;quot;Implicit-Explicit Error Indicator based on Approximation Order.&amp;quot; arXiv preprint arXiv:2204.01022 (2022).&amp;lt;/ref&amp;gt; for implementation-related convenience reasons. This error indicator makes use of the implicitly obtained numerical solution and explicit operators (approximated by higher-order basis) to reconstruct the right-hand side of the governing problem.&lt;br /&gt;
&lt;br /&gt;
To further explain basic idea of IMEX, let us define a PDE of type:&lt;br /&gt;
$$&lt;br /&gt;
    \mathcal L u = f_{RHS},&lt;br /&gt;
$$&lt;br /&gt;
where $\mathcal L$ is a differential operator applied to the scalar field $u$ and $f_{RHS}$ is a function. To obtain an error indicator field $\eta$, the problem is first solved implicitly by using a lower order approximation of operators $\mathcal L$, $\mathcal L^{(lo)}_{im}$, obtaining the solution $u^{(im)}$ in the process. The implicitly computed field $u^{(im)}$ is then used to explicitly reconstruct the right-hand side of the governing problem, but this time using a higher order approximation of $\mathcal L$, $\mathcal L^{(hi)}_{ex}$, obtaining $f_{RHS}^{(ex)}$ in the process.&lt;br /&gt;
Finally, $f_{RHS}^{(ex)}$ and $f_{RHS}$ are compared $\eta = \left | f_{RHS} - f_{RHS}^{(ex)} \right |$ to indicate the error of the numerical solution.&lt;br /&gt;
&lt;br /&gt;
=== Mark ===&lt;br /&gt;
&lt;br /&gt;
After the error indicator $\eta$ had been obtained for each computational point in $\Omega$, a marking strategy is employed. The main objective of this step is to flag the nodes with too high or too low error indicator values in order to achieve a uniformly distributed precision of the numerical solution and reduce computational costs - by avoiding fine local field descriptions and high order approximations where this is not required. Furthermore, the marking strategy not only decides whether or not (de)refinement should take place at a given computational node, but also defines the type of the refinement procedure in cases where there are multiple to choose from.&lt;br /&gt;
&lt;br /&gt;
In each adaptivity iteration, the marking strategy starts by checking the error indicator values $\eta _i$ for all computational nodes in the domain. If $\eta _i$ is greater than $\alpha \eta_{max}$ for a free model parameter $\alpha \in (0, 1)$, the node is marked for refinement. If $\eta _i$ is less than $\beta \eta_{max}$ for a free model parameter $\beta \in (0,1) \land \beta \leq \alpha$, the node is marked for derefinement. Otherwise, the node is left unmarked meaning no refinement should take place. The marking strategy can be summarized with a single equation&lt;br /&gt;
$$&lt;br /&gt;
    \begin{cases}&lt;br /&gt;
        \eta _i &amp;gt; \alpha \eta_{max},                          &amp;amp; \text{ refine}     \\&lt;br /&gt;
        \beta \eta_{max} \leq \eta _i \leq \alpha \eta_{max}, &amp;amp; \text{ do nothing} \\&lt;br /&gt;
        \eta _i &amp;lt; \beta \eta_{max},                           &amp;amp; \text{ derefine}&lt;br /&gt;
    \end{cases}.&lt;br /&gt;
$$&lt;br /&gt;
&lt;br /&gt;
In the context of mesh-based methods, it has already been observed, that this strategy is indeed simple to implement, however, far from optimal in terms of achieving good convergence rates. Our studies have shown that a slight modification to the originally proposed strategy can significantly improve the performance of an $hp$-adaptive solution procedure in the context of mesh-free methods, but at the cost of higher number of free parameters - making it more difficult to understand. Nevertheless, the strategy is modified by introducing parameters $\left \{ \alpha_h, \beta_h \right \}$ and $\left \{ \alpha_p, \beta_p \right \}$ for separate treatment of $h$- and $p$-refinements respectively. A schematic is shown in figure below.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot from 2022-09-20 08-25-34.png|800px]]&lt;br /&gt;
&lt;br /&gt;
=== Refine ===&lt;br /&gt;
&lt;br /&gt;
After obtaining the list of nodes marked for modification, the refinement module is initialized. In this module, the local field description and local approximation order for the unmarked nodes are left unchanged, while the rest are further processed to determine other refinement-type-specific details - such as the amount of the (de)refinement. &lt;br /&gt;
&lt;br /&gt;
We use the following $h$-refinement rule&lt;br /&gt;
$$&lt;br /&gt;
    \label{eq:refinement}&lt;br /&gt;
    h_i^{new}(\b p) = \frac{h_i^{old}}{\frac{\eta_i - \alpha \eta _{max}}{\eta_{max} - \alpha\eta_{max}}\big(\lambda - 1\big) + 1}&lt;br /&gt;
$$&lt;br /&gt;
for the dimensionless parameter $\lambda \in [1, \infty)$ allowing us to control the aggressiveness of the refinement - the larger the value, the greater the change. This refinement rule also conveniently refines the areas with higher error indicator values more than the ones that are closer to the upper refinement threshold $\alpha_h \eta_{max}$. Similarly, a derefinement rule is proposed&lt;br /&gt;
$$&lt;br /&gt;
    \label{eq:derefinement}&lt;br /&gt;
    h_i^{new}(\b p) = \frac{h_i^{old}}{\frac{\beta \eta _{max} - \eta_i}{\beta\eta_{max} - \eta_{min}}\big(\frac{1}{\vartheta} - 1\big) + 1},&lt;br /&gt;
$$&lt;br /&gt;
where parameter $\vartheta \in [1, \infty)$ allows us to control the aggressiveness of derefinement.&lt;br /&gt;
&lt;br /&gt;
The same refinement and derefinement strategies were applied to control the local approximation order, except this time the value is rounded to the nearest integer. Similarly and for the same reasons as we did with the marking strategy, we consider a separate treatment of $h$- and $p$-adaptive procedures, by introducing (de)refinement aggressiveness parameters $\left \{\lambda_h, \vartheta_h \right \}$ and $\left \{\lambda_p, \vartheta_p \right \}$ for $h$- and $p$-refinement types respectively.&lt;br /&gt;
&lt;br /&gt;
[[File:refinement_rules.png|800px]]&lt;br /&gt;
&lt;br /&gt;
=== Finalization step ===&lt;br /&gt;
&lt;br /&gt;
Before the 4 modules can be iteratively repeated, the domain is rediscretized taking into account the newly computed local internodal distances $h_i^{new}(\b p)$ and the local approximation orders $m_i^{new}(\b p)$. However, both are only known in the computational nodes, while global functions $\widehat{h}^{new}(\b p)$ and $\widehat{m}^{new}(\b p)$ over our entire domain space $\Omega$ are required. These are obtained by employing the Sheppard's inverse distance weighting interpolation.&lt;br /&gt;
&lt;br /&gt;
Figure below schematically demonstrates 3 examples of $hp$-refinements. For the sake of demonstration, the refinement parameters for $h$- and $p$-adaptivity are the same, i.e. $\left \{ \alpha, \beta, \lambda, \vartheta \right \} = \left \{ \alpha_h, \beta_h, \lambda_h, \vartheta_h \right \} = \left \{ \alpha_p, \beta_p, \lambda_p, \vartheta_p \right \}$. Additionally, the derefinement aggressiveness $\vartheta$ and the upper threshold $\beta$ are kept constant, so, effectively, only the upper bound of refinement $\alpha$ and refinement aggressiveness $\lambda$ are altered. We observe that the effect refinement parameters is somewhat intuitive. The larger the aggressiveness $\lambda$ the better the local field description and the larger the number of nodes with high approximation order. Similar effect is observed with manipulating the upper refinement threshold $\alpha$, except the effect comes at a smoother manner. Also observe that all refined states were able to increase the accuracy of the numerical solution from the initial state.&lt;br /&gt;
&lt;br /&gt;
[[File:refinement_demonstration.png|800px]]&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
=== Example peak problem ===&lt;br /&gt;
&lt;br /&gt;
The proposed $hp$-adaptive solution procedure is demonstrated on a synthetical example. We chose a 2-dimensional Poisson problem with exponentially strong source positioned at $\boldsymbol x_s = \Big (\frac{1}{2}, \frac{1}{3}\Big )$. This example is categorized as a difficult problem and is commonly used to test the performance of adaptive solution procedures. The problem has a tractable solution $u(\boldsymbol x)=e^{-a \left \| \boldsymbol x - \boldsymbol x_s \right \|^2}$, which allows us to evaluate the precision of the numerical solution $\widehat{u}$, e.g.\ in terms of the infinity norm.&lt;br /&gt;
&lt;br /&gt;
Governing equations are&lt;br /&gt;
$$&lt;br /&gt;
    \nabla^2 u (\boldsymbol x)   = 2a e^{-a \left \| \boldsymbol x - \boldsymbol x_s \right \|^2}(2a\left \| \boldsymbol x - \boldsymbol x_s \right \| - d) \quad \quad \text{in } \Omega,   \\&lt;br /&gt;
    u (\boldsymbol x)        = e^{-a \left \| \boldsymbol x - \boldsymbol x_s \right \|^2}                                       \quad \quad  \text{on } \Gamma_d, \\&lt;br /&gt;
    \nabla u (\boldsymbol x) = -2a(\boldsymbol x - \boldsymbol x_s)e^{-a \left \| \boldsymbol x - \boldsymbol x_s \right \|^2}                           \quad \quad\text{on } \Gamma_n,&lt;br /&gt;
$$&lt;br /&gt;
&lt;br /&gt;
Figure below shows example indicator fields for initial iteration, intermediate iteration and iteration that achieved the best accuracy of the numerical solution. The third column shows the IMEX error indicator. We can see that the IMEX successfully located the position of the strong source at $\boldsymbol x_s = \Big (\frac{1}{2}, \frac{1}{3}\Big )$ as the highest indicator values are seen in its neighborhood. Moreover, the second column shows that the accuracy of the numerical solution and uniformity of error distribution have both been significantly improved by the $hp$-adaptive solution procedure, further proving that the IMEX can be successfully employed as a reliable error indicator.&lt;br /&gt;
&lt;br /&gt;
[[File:refinement_demonstration_2d.png|800px]]&lt;br /&gt;
&lt;br /&gt;
The behavior of IMEX over 70 adaptivity iterations is further studied in figure below. We are pleased to see that the convergence limit of the indicator around iteration $N_{iter}=60$ agrees well with the convergence limit of the numerical solution. &lt;br /&gt;
&lt;br /&gt;
[[File:error_indicator_convergence.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Finally, the convergence behavior of the proposed $hp$-adaptive solution procedure is studied. In addition to the convergence of a single $hp$-adaptive run, the convergences obtained without the use of refinement procedures, i.e. solutions obtained with uniform internodal spacing and approximation orders over the entire domain, are shown in figure below. The figure evidently shows that a $hp$-adaptive solution procedure was able to notably improve the numerical solution in terms of accuracy and required computational points.&lt;br /&gt;
&lt;br /&gt;
[[File:convergence_of_h_hp.png|800px]]&lt;br /&gt;
&lt;br /&gt;
=== Application to linear elasticity problems: Fretting fatigue contact ===&lt;br /&gt;
&lt;br /&gt;
The application of the proposed $hp$-adaptive solution procedure is further expanded to study a linear elasticity problem. Specifically, we obtain a $hp$-refined solution to fretting fatigue contact problem &amp;lt;ref name=&amp;quot;fwo&amp;quot;&amp;gt;Pereira, Kyvia, et al. &amp;quot;On the convergence of stresses in fretting fatigue.&amp;quot; Materials 9.8 (2016): 639.&amp;lt;/ref&amp;gt;, for which the authors believe no closed form solution is known.&lt;br /&gt;
&lt;br /&gt;
The problem formulation is given here &amp;lt;ref name=&amp;quot;slak&amp;quot;&amp;gt;Slak, Jure, and Gregor Kosec. &amp;quot;Adaptive radial basis function–generated finite differences method for contact problems.&amp;quot; International Journal for Numerical Methods in Engineering 119.7 (2019): 661-686.&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Figure below shows an example of $hp$-refined solution to fretting fatigue problem at the last adaptivity iteration with $N=46\,626$ computational nodes. We see that the solution procedure successfully located the two critical points, i.e. the fixed top left corner with a stress singularity and the area in the middle of the top edge where the contact is simulated. Note that the highest stress values (approximately $2$ times higher) have been computed in the singularity in the top left corner, but those nodes are not shown since our focus is shifted towards the area under the contact.&lt;br /&gt;
&lt;br /&gt;
[[File:fwo_solution_hp.png|800px]]&lt;br /&gt;
&lt;br /&gt;
For a detailed analysis, we look at the surface traction $\sigma_{xx}$, as it is often used to determine the location of crack initiation. The surface traction is shown in figure below for $6$ selected adaptivity iterations. The mesh-free nodes are colored according to the local approximation order enforced by the $hp$-adaptive solution procedure. The message of this figure is twofold. Firstly, it is clear that the proposed IMEX error indicator can be successfully used in linear elasticity problems, and secondly, we observe that the $hp$-adaptive solution procedure successfully approximated the surface traction in the neighborhood of the contact. In the process, the local field description under the contact has been significantly improved and also the local approximation orders have taken a non-trivial distribution.&lt;br /&gt;
&lt;br /&gt;
[[File:fwo_abaqus.png|800px]]&lt;br /&gt;
&lt;br /&gt;
The surface traction is additionally accompanied with the FEM results on a much denser mesh with more than 100\,000 DOFs obtained with the commercial solver Abaqus\textsuperscript{\textregistered}. To compute the absolute difference between the two methods, the mesh-free solution has been interpolated to Abaqus's computational points using the Sheppard's inverse distance weighting interpolation with $2$ closest neighbors. We see that the absolute difference is decreasing with the number of adaptivity iterations, finally settling at approximately 2 % of the maximum value under the contact at initial iteration. The highest absolute difference is expectedly located at the edges of the contact, i.e. around $x=a$ and $x=-a$, while the difference in the rest of the contact is even smaller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>E6WikiAdmin</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=HP-adaptivity&amp;diff=3586</id>
		<title>HP-adaptivity</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=HP-adaptivity&amp;diff=3586"/>
				<updated>2024-01-22T17:00:23Z</updated>
		
		<summary type="html">&lt;p&gt;E6WikiAdmin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
{{Box-round|title= Related papers |&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/153678339.pdf M. Jančič, G. Kosec; Strong form mesh‑free hp‑adaptive solution of linear elasticity problem, Engineering with computers, vol. 39, 2023 [DOI: 10.1007/s00366-023-01843-6][COBISS: 153678339]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Adaptive solution procedures are essential in problems where the accuracy of the numerical solution varies spatially and are currently subject of intensive studies. Two conceptually different adaptive approaches have been proposed, namely $p$-adaptivity or $h$-, $r$-adaptivity. In $p$-adaptivity, the accuracy of the numerical solution is varied by changing the order of approximation, while in $h$- and $r$-adaptivity the resolution of the spatial discretization is adjusted for the same purpose. In the $h$-adaptive approach, nodes are added or removed from the domain as needed, while in the $r$-adaptive approach, the total number of nodes remains constant - the nodes are only repositioned with respect to the desired accuracy. Ultimately, $h$- and $p$-adaptivities can be combined to form the so-called $hp$-adaptivity, where the accuracy of the solution is controlled with the order of the method and the resolution of the spatial discretization.&lt;br /&gt;
&lt;br /&gt;
__FORCETOC__&lt;br /&gt;
&lt;br /&gt;
==  Basic concept ==&lt;br /&gt;
&lt;br /&gt;
The proposed $hp$-adaptive solution procedure follows the well-established paradigm based on an iterative loop, where each iteration step consists of four modules:&lt;br /&gt;
* '''Solve''' - A numerical solution $\widehat{u}$ is obtained.&lt;br /&gt;
* '''Estimate''' - An estimate of the spatial accuracy of the numerical solution is calculated using error indicators.&lt;br /&gt;
* '''Mark''' - Depending on the error indicator values $\eta _i$, a marking strategy is used to mark the computational nodes for (de)refinement.&lt;br /&gt;
* '''Refine''' - Refinement strategy is employed to define the amount of the (de)refinement.&lt;br /&gt;
&lt;br /&gt;
Expected result is drafted in figure below.&lt;br /&gt;
&lt;br /&gt;
[[File:refinement_workflow.png|800px]]&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
The implementation of $hp$-adaptive solution procedure can be found [https://gitlab.com/e62Lab/public/2022_p_hp-adaptivity here].&lt;br /&gt;
&lt;br /&gt;
== Solution procedure ==&lt;br /&gt;
=== Solve ===&lt;br /&gt;
&lt;br /&gt;
First a numerical solution $\widehat{u}$ to the governing problem must be obtained. In general, the numerical treatment of a system of PDEs is done in several steps. First, the domain is discretized by positioning the nodes, then the linear differential operators in each computational node are approximated, and, finally, the system of PDEs is discretized and assembled into a large sparse linear system. To obtain a numerical solution $\widehat{u}$, the sparse system is solved.&lt;br /&gt;
&lt;br /&gt;
=== Estimate (IMEX error indicator) ===&lt;br /&gt;
In the estimation step, critical areas with high error of the numerical solution are identified. Identifying such areas is not a trivial task. In rare cases, where a closed form solution to the governing system of PDEs exists, we can not only indicate such areas but also estimate the accuracy of the numerical solution. However, for real-world problems, which are often subject of numerical simulations, closed form solutions do not exist. Therefore, other objective metrics are needed to indicate the computational nodes with high error of the numerical solution. Numerical tools used in such cases are commonly referred to as ''error indicators''.&lt;br /&gt;
&lt;br /&gt;
We have chosen to use our own error indication algorithm IMEX &amp;lt;ref name=&amp;quot;imex&amp;quot;&amp;gt; Jančič, Mitja, Filip Strniša, and Gregor Kosec. &amp;quot;Implicit-Explicit Error Indicator based on Approximation Order.&amp;quot; arXiv preprint arXiv:2204.01022 (2022).&amp;lt;/ref&amp;gt; for implementation-related convenience reasons. This error indicator makes use of the implicitly obtained numerical solution and explicit operators (approximated by higher-order basis) to reconstruct the right-hand side of the governing problem.&lt;br /&gt;
&lt;br /&gt;
To further explain basic idea of IMEX, let us define a PDE of type:&lt;br /&gt;
$$&lt;br /&gt;
    \mathcal L u = f_{RHS},&lt;br /&gt;
$$&lt;br /&gt;
where $\mathcal L$ is a differential operator applied to the scalar field $u$ and $f_{RHS}$ is a function. To obtain an error indicator field $\eta$, the problem is first solved implicitly by using a lower order approximation of operators $\mathcal L$, $\mathcal L^{(lo)}_{im}$, obtaining the solution $u^{(im)}$ in the process. The implicitly computed field $u^{(im)}$ is then used to explicitly reconstruct the right-hand side of the governing problem, but this time using a higher order approximation of $\mathcal L$, $\mathcal L^{(hi)}_{ex}$, obtaining $f_{RHS}^{(ex)}$ in the process.&lt;br /&gt;
Finally, $f_{RHS}^{(ex)}$ and $f_{RHS}$ are compared $\eta = \left | f_{RHS} - f_{RHS}^{(ex)} \right |$ to indicate the error of the numerical solution.&lt;br /&gt;
&lt;br /&gt;
=== Mark ===&lt;br /&gt;
&lt;br /&gt;
After the error indicator $\eta$ had been obtained for each computational point in $\Omega$, a marking strategy is employed. The main objective of this step is to flag the nodes with too high or too low error indicator values in order to achieve a uniformly distributed precision of the numerical solution and reduce computational costs - by avoiding fine local field descriptions and high order approximations where this is not required. Furthermore, the marking strategy not only decides whether or not (de)refinement should take place at a given computational node, but also defines the type of the refinement procedure in cases where there are multiple to choose from.&lt;br /&gt;
&lt;br /&gt;
In each adaptivity iteration, the marking strategy starts by checking the error indicator values $\eta _i$ for all computational nodes in the domain. If $\eta _i$ is greater than $\alpha \eta_{max}$ for a free model parameter $\alpha \in (0, 1)$, the node is marked for refinement. If $\eta _i$ is less than $\beta \eta_{max}$ for a free model parameter $\beta \in (0,1) \land \beta \leq \alpha$, the node is marked for derefinement. Otherwise, the node is left unmarked meaning no refinement should take place. The marking strategy can be summarized with a single equation&lt;br /&gt;
$$&lt;br /&gt;
    \begin{cases}&lt;br /&gt;
        \eta _i &amp;gt; \alpha \eta_{max},                          &amp;amp; \text{ refine}     \\&lt;br /&gt;
        \beta \eta_{max} \leq \eta _i \leq \alpha \eta_{max}, &amp;amp; \text{ do nothing} \\&lt;br /&gt;
        \eta _i &amp;lt; \beta \eta_{max},                           &amp;amp; \text{ derefine}&lt;br /&gt;
    \end{cases}.&lt;br /&gt;
$$&lt;br /&gt;
&lt;br /&gt;
In the context of mesh-based methods, it has already been observed, that this strategy is indeed simple to implement, however, far from optimal in terms of achieving good convergence rates. Our studies have shown that a slight modification to the originally proposed strategy can significantly improve the performance of an $hp$-adaptive solution procedure in the context of mesh-free methods, but at the cost of higher number of free parameters - making it more difficult to understand. Nevertheless, the strategy is modified by introducing parameters $\left \{ \alpha_h, \beta_h \right \}$ and $\left \{ \alpha_p, \beta_p \right \}$ for separate treatment of $h$- and $p$-refinements respectively. A schematic is shown in figure below.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot from 2022-09-20 08-25-34.png|800px]]&lt;br /&gt;
&lt;br /&gt;
=== Refine ===&lt;br /&gt;
&lt;br /&gt;
After obtaining the list of nodes marked for modification, the refinement module is initialized. In this module, the local field description and local approximation order for the unmarked nodes are left unchanged, while the rest are further processed to determine other refinement-type-specific details - such as the amount of the (de)refinement. &lt;br /&gt;
&lt;br /&gt;
We use the following $h$-refinement rule&lt;br /&gt;
$$&lt;br /&gt;
    \label{eq:refinement}&lt;br /&gt;
    h_i^{new}(\b p) = \frac{h_i^{old}}{\frac{\eta_i - \alpha \eta _{max}}{\eta_{max} - \alpha\eta_{max}}\big(\lambda - 1\big) + 1}&lt;br /&gt;
$$&lt;br /&gt;
for the dimensionless parameter $\lambda \in [1, \infty)$ allowing us to control the aggressiveness of the refinement - the larger the value, the greater the change. This refinement rule also conveniently refines the areas with higher error indicator values more than the ones that are closer to the upper refinement threshold $\alpha_h \eta_{max}$. Similarly, a derefinement rule is proposed&lt;br /&gt;
$$&lt;br /&gt;
    \label{eq:derefinement}&lt;br /&gt;
    h_i^{new}(\b p) = \frac{h_i^{old}}{\frac{\beta \eta _{max} - \eta_i}{\beta\eta_{max} - \eta_{min}}\big(\frac{1}{\vartheta} - 1\big) + 1},&lt;br /&gt;
$$&lt;br /&gt;
where parameter $\vartheta \in [1, \infty)$ allows us to control the aggressiveness of derefinement.&lt;br /&gt;
&lt;br /&gt;
The same refinement and derefinement strategies were applied to control the local approximation order, except this time the value is rounded to the nearest integer. Similarly and for the same reasons as we did with the marking strategy, we consider a separate treatment of $h$- and $p$-adaptive procedures, by introducing (de)refinement aggressiveness parameters $\left \{\lambda_h, \vartheta_h \right \}$ and $\left \{\lambda_p, \vartheta_p \right \}$ for $h$- and $p$-refinement types respectively.&lt;br /&gt;
&lt;br /&gt;
[[File:refinement_rules.png|800px]]&lt;br /&gt;
&lt;br /&gt;
=== Finalization step ===&lt;br /&gt;
&lt;br /&gt;
Before the 4 modules can be iteratively repeated, the domain is rediscretized taking into account the newly computed local internodal distances $h_i^{new}(\b p)$ and the local approximation orders $m_i^{new}(\b p)$. However, both are only known in the computational nodes, while global functions $\widehat{h}^{new}(\b p)$ and $\widehat{m}^{new}(\b p)$ over our entire domain space $\Omega$ are required. These are obtained by employing the Sheppard's inverse distance weighting interpolation.&lt;br /&gt;
&lt;br /&gt;
Figure below schematically demonstrates 3 examples of $hp$-refinements. For the sake of demonstration, the refinement parameters for $h$- and $p$-adaptivity are the same, i.e. $\left \{ \alpha, \beta, \lambda, \vartheta \right \} = \left \{ \alpha_h, \beta_h, \lambda_h, \vartheta_h \right \} = \left \{ \alpha_p, \beta_p, \lambda_p, \vartheta_p \right \}$. Additionally, the derefinement aggressiveness $\vartheta$ and the upper threshold $\beta$ are kept constant, so, effectively, only the upper bound of refinement $\alpha$ and refinement aggressiveness $\lambda$ are altered. We observe that the effect refinement parameters is somewhat intuitive. The larger the aggressiveness $\lambda$ the better the local field description and the larger the number of nodes with high approximation order. Similar effect is observed with manipulating the upper refinement threshold $\alpha$, except the effect comes at a smoother manner. Also observe that all refined states were able to increase the accuracy of the numerical solution from the initial state.&lt;br /&gt;
&lt;br /&gt;
[[File:refinement_demonstration.png|800px]]&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
=== Example peak problem ===&lt;br /&gt;
&lt;br /&gt;
The proposed $hp$-adaptive solution procedure is demonstrated on a synthetical example. We chose a 2-dimensional Poisson problem with exponentially strong source positioned at $\boldsymbol x_s = \Big (\frac{1}{2}, \frac{1}{3}\Big )$. This example is categorized as a difficult problem and is commonly used to test the performance of adaptive solution procedures. The problem has a tractable solution $u(\boldsymbol x)=e^{-a \left \| \boldsymbol x - \boldsymbol x_s \right \|^2}$, which allows us to evaluate the precision of the numerical solution $\widehat{u}$, e.g.\ in terms of the infinity norm.&lt;br /&gt;
&lt;br /&gt;
Governing equations are&lt;br /&gt;
$$&lt;br /&gt;
    \nabla^2 u (\boldsymbol x)   = 2a e^{-a \left \| \boldsymbol x - \boldsymbol x_s \right \|^2}(2a\left \| \boldsymbol x - \boldsymbol x_s \right \| - d) \quad \quad \text{in } \Omega,   \\&lt;br /&gt;
    u (\boldsymbol x)        = e^{-a \left \| \boldsymbol x - \boldsymbol x_s \right \|^2}                                       \quad \quad  \text{on } \Gamma_d, \\&lt;br /&gt;
    \nabla u (\boldsymbol x) = -2a(\boldsymbol x - \boldsymbol x_s)e^{-a \left \| \boldsymbol x - \boldsymbol x_s \right \|^2}                           \quad \quad\text{on } \Gamma_n,&lt;br /&gt;
$$&lt;br /&gt;
&lt;br /&gt;
Figure below shows example indicator fields for initial iteration, intermediate iteration and iteration that achieved the best accuracy of the numerical solution. The third column shows the IMEX error indicator. We can see that the IMEX successfully located the position of the strong source at $\boldsymbol x_s = \Big (\frac{1}{2}, \frac{1}{3}\Big )$ as the highest indicator values are seen in its neighborhood. Moreover, the second column shows that the accuracy of the numerical solution and uniformity of error distribution have both been significantly improved by the $hp$-adaptive solution procedure, further proving that the IMEX can be successfully employed as a reliable error indicator.&lt;br /&gt;
&lt;br /&gt;
[[File:refinement_demonstration_2d.png|800px]]&lt;br /&gt;
&lt;br /&gt;
The behavior of IMEX over 70 adaptivity iterations is further studied in figure below. We are pleased to see that the convergence limit of the indicator around iteration $N_{iter}=60$ agrees well with the convergence limit of the numerical solution. &lt;br /&gt;
&lt;br /&gt;
[[File:error_indicator_convergence.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Finally, the convergence behavior of the proposed $hp$-adaptive solution procedure is studied. In addition to the convergence of a single $hp$-adaptive run, the convergences obtained without the use of refinement procedures, i.e. solutions obtained with uniform internodal spacing and approximation orders over the entire domain, are shown in figure below. The figure evidently shows that a $hp$-adaptive solution procedure was able to notably improve the numerical solution in terms of accuracy and required computational points.&lt;br /&gt;
&lt;br /&gt;
[[File:convergence_of_h_hp.png|800px]]&lt;br /&gt;
&lt;br /&gt;
=== Application to linear elasticity problems: Fretting fatigue contact ===&lt;br /&gt;
&lt;br /&gt;
The application of the proposed $hp$-adaptive solution procedure is further expanded to study a linear elasticity problem. Specifically, we obtain a $hp$-refined solution to fretting fatigue contact problem &amp;lt;ref name=&amp;quot;fwo&amp;quot;&amp;gt;Pereira, Kyvia, et al. &amp;quot;On the convergence of stresses in fretting fatigue.&amp;quot; Materials 9.8 (2016): 639.&amp;lt;/ref&amp;gt;, for which the authors believe no closed form solution is known.&lt;br /&gt;
&lt;br /&gt;
The problem formulation is given here &amp;lt;ref name=&amp;quot;slak&amp;quot;&amp;gt;Slak, Jure, and Gregor Kosec. &amp;quot;Adaptive radial basis function–generated finite differences method for contact problems.&amp;quot; International Journal for Numerical Methods in Engineering 119.7 (2019): 661-686.&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Figure below shows an example of $hp$-refined solution to fretting fatigue problem at the last adaptivity iteration with $N=46\,626$ computational nodes. We see that the solution procedure successfully located the two critical points, i.e. the fixed top left corner with a stress singularity and the area in the middle of the top edge where the contact is simulated. Note that the highest stress values (approximately $2$ times higher) have been computed in the singularity in the top left corner, but those nodes are not shown since our focus is shifted towards the area under the contact.&lt;br /&gt;
&lt;br /&gt;
[[File:fwo_solution_hp.png|800px]]&lt;br /&gt;
&lt;br /&gt;
For a detailed analysis, we look at the surface traction $\sigma_{xx}$, as it is often used to determine the location of crack initiation. The surface traction is shown in figure below for $6$ selected adaptivity iterations. The mesh-free nodes are colored according to the local approximation order enforced by the $hp$-adaptive solution procedure. The message of this figure is twofold. Firstly, it is clear that the proposed IMEX error indicator can be successfully used in linear elasticity problems, and secondly, we observe that the $hp$-adaptive solution procedure successfully approximated the surface traction in the neighborhood of the contact. In the process, the local field description under the contact has been significantly improved and also the local approximation orders have taken a non-trivial distribution.&lt;br /&gt;
&lt;br /&gt;
[[File:fwo_abaqus.png|800px]]&lt;br /&gt;
&lt;br /&gt;
The surface traction is additionally accompanied with the FEM results on a much denser mesh with more than 100\,000 DOFs obtained with the commercial solver Abaqus\textsuperscript{\textregistered}. To compute the absolute difference between the two methods, the mesh-free solution has been interpolated to Abaqus's computational points using the Sheppard's inverse distance weighting interpolation with $2$ closest neighbors. We see that the absolute difference is decreasing with the number of adaptivity iterations, finally settling at approximately 2 % of the maximum value under the contact at initial iteration. The highest absolute difference is expectedly located at the edges of the contact, i.e. around $x=a$ and $x=-a$, while the difference in the rest of the contact is even smaller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>E6WikiAdmin</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=HP-adaptivity&amp;diff=3585</id>
		<title>HP-adaptivity</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=HP-adaptivity&amp;diff=3585"/>
				<updated>2024-01-22T17:00:08Z</updated>
		
		<summary type="html">&lt;p&gt;E6WikiAdmin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Box-round|title= Related papers |&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/153678339.pdf M. Jančič, G. Kosec; Strong form mesh‑free hp‑adaptive solution of linear elasticity problem, Engineering with computers, vol. 39, 2023 [DOI: 10.1007/s00366-023-01843-6][COBISS: 153678339]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Adaptive solution procedures are essential in problems where the accuracy of the numerical solution varies spatially and are currently subject of intensive studies. Two conceptually different adaptive approaches have been proposed, namely $p$-adaptivity or $h$-, $r$-adaptivity. In $p$-adaptivity, the accuracy of the numerical solution is varied by changing the order of approximation, while in $h$- and $r$-adaptivity the resolution of the spatial discretization is adjusted for the same purpose. In the $h$-adaptive approach, nodes are added or removed from the domain as needed, while in the $r$-adaptive approach, the total number of nodes remains constant - the nodes are only repositioned with respect to the desired accuracy. Ultimately, $h$- and $p$-adaptivities can be combined to form the so-called $hp$-adaptivity, where the accuracy of the solution is controlled with the order of the method and the resolution of the spatial discretization.&lt;br /&gt;
&lt;br /&gt;
__FORCETOC__&lt;br /&gt;
&lt;br /&gt;
==  Basic concept ==&lt;br /&gt;
&lt;br /&gt;
The proposed $hp$-adaptive solution procedure follows the well-established paradigm based on an iterative loop, where each iteration step consists of four modules:&lt;br /&gt;
* '''Solve''' - A numerical solution $\widehat{u}$ is obtained.&lt;br /&gt;
* '''Estimate''' - An estimate of the spatial accuracy of the numerical solution is calculated using error indicators.&lt;br /&gt;
* '''Mark''' - Depending on the error indicator values $\eta _i$, a marking strategy is used to mark the computational nodes for (de)refinement.&lt;br /&gt;
* '''Refine''' - Refinement strategy is employed to define the amount of the (de)refinement.&lt;br /&gt;
&lt;br /&gt;
Expected result is drafted in figure below.&lt;br /&gt;
&lt;br /&gt;
[[File:refinement_workflow.png|800px]]&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
The implementation of $hp$-adaptive solution procedure can be found [https://gitlab.com/e62Lab/public/2022_p_hp-adaptivity here].&lt;br /&gt;
&lt;br /&gt;
== Solution procedure ==&lt;br /&gt;
=== Solve ===&lt;br /&gt;
&lt;br /&gt;
First a numerical solution $\widehat{u}$ to the governing problem must be obtained. In general, the numerical treatment of a system of PDEs is done in several steps. First, the domain is discretized by positioning the nodes, then the linear differential operators in each computational node are approximated, and, finally, the system of PDEs is discretized and assembled into a large sparse linear system. To obtain a numerical solution $\widehat{u}$, the sparse system is solved.&lt;br /&gt;
&lt;br /&gt;
=== Estimate (IMEX error indicator) ===&lt;br /&gt;
In the estimation step, critical areas with high error of the numerical solution are identified. Identifying such areas is not a trivial task. In rare cases, where a closed form solution to the governing system of PDEs exists, we can not only indicate such areas but also estimate the accuracy of the numerical solution. However, for real-world problems, which are often subject of numerical simulations, closed form solutions do not exist. Therefore, other objective metrics are needed to indicate the computational nodes with high error of the numerical solution. Numerical tools used in such cases are commonly referred to as ''error indicators''.&lt;br /&gt;
&lt;br /&gt;
We have chosen to use our own error indication algorithm IMEX &amp;lt;ref name=&amp;quot;imex&amp;quot;&amp;gt; Jančič, Mitja, Filip Strniša, and Gregor Kosec. &amp;quot;Implicit-Explicit Error Indicator based on Approximation Order.&amp;quot; arXiv preprint arXiv:2204.01022 (2022).&amp;lt;/ref&amp;gt; for implementation-related convenience reasons. This error indicator makes use of the implicitly obtained numerical solution and explicit operators (approximated by higher-order basis) to reconstruct the right-hand side of the governing problem.&lt;br /&gt;
&lt;br /&gt;
To further explain basic idea of IMEX, let us define a PDE of type:&lt;br /&gt;
$$&lt;br /&gt;
    \mathcal L u = f_{RHS},&lt;br /&gt;
$$&lt;br /&gt;
where $\mathcal L$ is a differential operator applied to the scalar field $u$ and $f_{RHS}$ is a function. To obtain an error indicator field $\eta$, the problem is first solved implicitly by using a lower order approximation of operators $\mathcal L$, $\mathcal L^{(lo)}_{im}$, obtaining the solution $u^{(im)}$ in the process. The implicitly computed field $u^{(im)}$ is then used to explicitly reconstruct the right-hand side of the governing problem, but this time using a higher order approximation of $\mathcal L$, $\mathcal L^{(hi)}_{ex}$, obtaining $f_{RHS}^{(ex)}$ in the process.&lt;br /&gt;
Finally, $f_{RHS}^{(ex)}$ and $f_{RHS}$ are compared $\eta = \left | f_{RHS} - f_{RHS}^{(ex)} \right |$ to indicate the error of the numerical solution.&lt;br /&gt;
&lt;br /&gt;
=== Mark ===&lt;br /&gt;
&lt;br /&gt;
After the error indicator $\eta$ had been obtained for each computational point in $\Omega$, a marking strategy is employed. The main objective of this step is to flag the nodes with too high or too low error indicator values in order to achieve a uniformly distributed precision of the numerical solution and reduce computational costs - by avoiding fine local field descriptions and high order approximations where this is not required. Furthermore, the marking strategy not only decides whether or not (de)refinement should take place at a given computational node, but also defines the type of the refinement procedure in cases where there are multiple to choose from.&lt;br /&gt;
&lt;br /&gt;
In each adaptivity iteration, the marking strategy starts by checking the error indicator values $\eta _i$ for all computational nodes in the domain. If $\eta _i$ is greater than $\alpha \eta_{max}$ for a free model parameter $\alpha \in (0, 1)$, the node is marked for refinement. If $\eta _i$ is less than $\beta \eta_{max}$ for a free model parameter $\beta \in (0,1) \land \beta \leq \alpha$, the node is marked for derefinement. Otherwise, the node is left unmarked meaning no refinement should take place. The marking strategy can be summarized with a single equation&lt;br /&gt;
$$&lt;br /&gt;
    \begin{cases}&lt;br /&gt;
        \eta _i &amp;gt; \alpha \eta_{max},                          &amp;amp; \text{ refine}     \\&lt;br /&gt;
        \beta \eta_{max} \leq \eta _i \leq \alpha \eta_{max}, &amp;amp; \text{ do nothing} \\&lt;br /&gt;
        \eta _i &amp;lt; \beta \eta_{max},                           &amp;amp; \text{ derefine}&lt;br /&gt;
    \end{cases}.&lt;br /&gt;
$$&lt;br /&gt;
&lt;br /&gt;
In the context of mesh-based methods, it has already been observed, that this strategy is indeed simple to implement, however, far from optimal in terms of achieving good convergence rates. Our studies have shown that a slight modification to the originally proposed strategy can significantly improve the performance of an $hp$-adaptive solution procedure in the context of mesh-free methods, but at the cost of higher number of free parameters - making it more difficult to understand. Nevertheless, the strategy is modified by introducing parameters $\left \{ \alpha_h, \beta_h \right \}$ and $\left \{ \alpha_p, \beta_p \right \}$ for separate treatment of $h$- and $p$-refinements respectively. A schematic is shown in figure below.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot from 2022-09-20 08-25-34.png|800px]]&lt;br /&gt;
&lt;br /&gt;
=== Refine ===&lt;br /&gt;
&lt;br /&gt;
After obtaining the list of nodes marked for modification, the refinement module is initialized. In this module, the local field description and local approximation order for the unmarked nodes are left unchanged, while the rest are further processed to determine other refinement-type-specific details - such as the amount of the (de)refinement. &lt;br /&gt;
&lt;br /&gt;
We use the following $h$-refinement rule&lt;br /&gt;
$$&lt;br /&gt;
    \label{eq:refinement}&lt;br /&gt;
    h_i^{new}(\b p) = \frac{h_i^{old}}{\frac{\eta_i - \alpha \eta _{max}}{\eta_{max} - \alpha\eta_{max}}\big(\lambda - 1\big) + 1}&lt;br /&gt;
$$&lt;br /&gt;
for the dimensionless parameter $\lambda \in [1, \infty)$ allowing us to control the aggressiveness of the refinement - the larger the value, the greater the change. This refinement rule also conveniently refines the areas with higher error indicator values more than the ones that are closer to the upper refinement threshold $\alpha_h \eta_{max}$. Similarly, a derefinement rule is proposed&lt;br /&gt;
$$&lt;br /&gt;
    \label{eq:derefinement}&lt;br /&gt;
    h_i^{new}(\b p) = \frac{h_i^{old}}{\frac{\beta \eta _{max} - \eta_i}{\beta\eta_{max} - \eta_{min}}\big(\frac{1}{\vartheta} - 1\big) + 1},&lt;br /&gt;
$$&lt;br /&gt;
where parameter $\vartheta \in [1, \infty)$ allows us to control the aggressiveness of derefinement.&lt;br /&gt;
&lt;br /&gt;
The same refinement and derefinement strategies were applied to control the local approximation order, except this time the value is rounded to the nearest integer. Similarly and for the same reasons as we did with the marking strategy, we consider a separate treatment of $h$- and $p$-adaptive procedures, by introducing (de)refinement aggressiveness parameters $\left \{\lambda_h, \vartheta_h \right \}$ and $\left \{\lambda_p, \vartheta_p \right \}$ for $h$- and $p$-refinement types respectively.&lt;br /&gt;
&lt;br /&gt;
[[File:refinement_rules.png|800px]]&lt;br /&gt;
&lt;br /&gt;
=== Finalization step ===&lt;br /&gt;
&lt;br /&gt;
Before the 4 modules can be iteratively repeated, the domain is rediscretized taking into account the newly computed local internodal distances $h_i^{new}(\b p)$ and the local approximation orders $m_i^{new}(\b p)$. However, both are only known in the computational nodes, while global functions $\widehat{h}^{new}(\b p)$ and $\widehat{m}^{new}(\b p)$ over our entire domain space $\Omega$ are required. These are obtained by employing the Sheppard's inverse distance weighting interpolation.&lt;br /&gt;
&lt;br /&gt;
Figure below schematically demonstrates 3 examples of $hp$-refinements. For the sake of demonstration, the refinement parameters for $h$- and $p$-adaptivity are the same, i.e. $\left \{ \alpha, \beta, \lambda, \vartheta \right \} = \left \{ \alpha_h, \beta_h, \lambda_h, \vartheta_h \right \} = \left \{ \alpha_p, \beta_p, \lambda_p, \vartheta_p \right \}$. Additionally, the derefinement aggressiveness $\vartheta$ and the upper threshold $\beta$ are kept constant, so, effectively, only the upper bound of refinement $\alpha$ and refinement aggressiveness $\lambda$ are altered. We observe that the effect refinement parameters is somewhat intuitive. The larger the aggressiveness $\lambda$ the better the local field description and the larger the number of nodes with high approximation order. Similar effect is observed with manipulating the upper refinement threshold $\alpha$, except the effect comes at a smoother manner. Also observe that all refined states were able to increase the accuracy of the numerical solution from the initial state.&lt;br /&gt;
&lt;br /&gt;
[[File:refinement_demonstration.png|800px]]&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
=== Example peak problem ===&lt;br /&gt;
&lt;br /&gt;
The proposed $hp$-adaptive solution procedure is demonstrated on a synthetical example. We chose a 2-dimensional Poisson problem with exponentially strong source positioned at $\boldsymbol x_s = \Big (\frac{1}{2}, \frac{1}{3}\Big )$. This example is categorized as a difficult problem and is commonly used to test the performance of adaptive solution procedures. The problem has a tractable solution $u(\boldsymbol x)=e^{-a \left \| \boldsymbol x - \boldsymbol x_s \right \|^2}$, which allows us to evaluate the precision of the numerical solution $\widehat{u}$, e.g.\ in terms of the infinity norm.&lt;br /&gt;
&lt;br /&gt;
Governing equations are&lt;br /&gt;
$$&lt;br /&gt;
    \nabla^2 u (\boldsymbol x)   = 2a e^{-a \left \| \boldsymbol x - \boldsymbol x_s \right \|^2}(2a\left \| \boldsymbol x - \boldsymbol x_s \right \| - d) \quad \quad \text{in } \Omega,   \\&lt;br /&gt;
    u (\boldsymbol x)        = e^{-a \left \| \boldsymbol x - \boldsymbol x_s \right \|^2}                                       \quad \quad  \text{on } \Gamma_d, \\&lt;br /&gt;
    \nabla u (\boldsymbol x) = -2a(\boldsymbol x - \boldsymbol x_s)e^{-a \left \| \boldsymbol x - \boldsymbol x_s \right \|^2}                           \quad \quad\text{on } \Gamma_n,&lt;br /&gt;
$$&lt;br /&gt;
&lt;br /&gt;
Figure below shows example indicator fields for initial iteration, intermediate iteration and iteration that achieved the best accuracy of the numerical solution. The third column shows the IMEX error indicator. We can see that the IMEX successfully located the position of the strong source at $\boldsymbol x_s = \Big (\frac{1}{2}, \frac{1}{3}\Big )$ as the highest indicator values are seen in its neighborhood. Moreover, the second column shows that the accuracy of the numerical solution and uniformity of error distribution have both been significantly improved by the $hp$-adaptive solution procedure, further proving that the IMEX can be successfully employed as a reliable error indicator.&lt;br /&gt;
&lt;br /&gt;
[[File:refinement_demonstration_2d.png|800px]]&lt;br /&gt;
&lt;br /&gt;
The behavior of IMEX over 70 adaptivity iterations is further studied in figure below. We are pleased to see that the convergence limit of the indicator around iteration $N_{iter}=60$ agrees well with the convergence limit of the numerical solution. &lt;br /&gt;
&lt;br /&gt;
[[File:error_indicator_convergence.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Finally, the convergence behavior of the proposed $hp$-adaptive solution procedure is studied. In addition to the convergence of a single $hp$-adaptive run, the convergences obtained without the use of refinement procedures, i.e. solutions obtained with uniform internodal spacing and approximation orders over the entire domain, are shown in figure below. The figure evidently shows that a $hp$-adaptive solution procedure was able to notably improve the numerical solution in terms of accuracy and required computational points.&lt;br /&gt;
&lt;br /&gt;
[[File:convergence_of_h_hp.png|800px]]&lt;br /&gt;
&lt;br /&gt;
=== Application to linear elasticity problems: Fretting fatigue contact ===&lt;br /&gt;
&lt;br /&gt;
The application of the proposed $hp$-adaptive solution procedure is further expanded to study a linear elasticity problem. Specifically, we obtain a $hp$-refined solution to fretting fatigue contact problem &amp;lt;ref name=&amp;quot;fwo&amp;quot;&amp;gt;Pereira, Kyvia, et al. &amp;quot;On the convergence of stresses in fretting fatigue.&amp;quot; Materials 9.8 (2016): 639.&amp;lt;/ref&amp;gt;, for which the authors believe no closed form solution is known.&lt;br /&gt;
&lt;br /&gt;
The problem formulation is given here &amp;lt;ref name=&amp;quot;slak&amp;quot;&amp;gt;Slak, Jure, and Gregor Kosec. &amp;quot;Adaptive radial basis function–generated finite differences method for contact problems.&amp;quot; International Journal for Numerical Methods in Engineering 119.7 (2019): 661-686.&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Figure below shows an example of $hp$-refined solution to fretting fatigue problem at the last adaptivity iteration with $N=46\,626$ computational nodes. We see that the solution procedure successfully located the two critical points, i.e. the fixed top left corner with a stress singularity and the area in the middle of the top edge where the contact is simulated. Note that the highest stress values (approximately $2$ times higher) have been computed in the singularity in the top left corner, but those nodes are not shown since our focus is shifted towards the area under the contact.&lt;br /&gt;
&lt;br /&gt;
[[File:fwo_solution_hp.png|800px]]&lt;br /&gt;
&lt;br /&gt;
For a detailed analysis, we look at the surface traction $\sigma_{xx}$, as it is often used to determine the location of crack initiation. The surface traction is shown in figure below for $6$ selected adaptivity iterations. The mesh-free nodes are colored according to the local approximation order enforced by the $hp$-adaptive solution procedure. The message of this figure is twofold. Firstly, it is clear that the proposed IMEX error indicator can be successfully used in linear elasticity problems, and secondly, we observe that the $hp$-adaptive solution procedure successfully approximated the surface traction in the neighborhood of the contact. In the process, the local field description under the contact has been significantly improved and also the local approximation orders have taken a non-trivial distribution.&lt;br /&gt;
&lt;br /&gt;
[[File:fwo_abaqus.png|800px]]&lt;br /&gt;
&lt;br /&gt;
The surface traction is additionally accompanied with the FEM results on a much denser mesh with more than 100\,000 DOFs obtained with the commercial solver Abaqus\textsuperscript{\textregistered}. To compute the absolute difference between the two methods, the mesh-free solution has been interpolated to Abaqus's computational points using the Sheppard's inverse distance weighting interpolation with $2$ closest neighbors. We see that the absolute difference is decreasing with the number of adaptivity iterations, finally settling at approximately 2 % of the maximum value under the contact at initial iteration. The highest absolute difference is expectedly located at the edges of the contact, i.e. around $x=a$ and $x=-a$, while the difference in the rest of the contact is even smaller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>E6WikiAdmin</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=Medusa&amp;diff=3551</id>
		<title>Medusa</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=Medusa&amp;diff=3551"/>
				<updated>2023-03-27T06:51:52Z</updated>
		
		<summary type="html">&lt;p&gt;E6WikiAdmin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!--__NOTITLE__--&amp;gt;&lt;br /&gt;
'''Welcome to the Medusa wiki. To visit the main website, go to [http://e6.ijs.si/medusa/ http://e6.ijs.si/medusa/].'''&lt;br /&gt;
&lt;br /&gt;
In [http://e6.ijs.si/ParallelAndDistributedSystems/ Parallel and Distributed Systems Laboratory] we are working on a C++ library that is first and foremost focused on tools for solving Partial Differential Equations by meshless methods. The basic idea is to create generic codes for tools that are needed for solving not only PDEs but many other problems, e.g. Moving Least Squares approximation, $k$-d tree, domain generation engines, etc.&lt;br /&gt;
We call this open source meshless project [http://e6.ijs.si/medusa/ Medusa: Coordinate Free Meshless Method implementation (MM)].&lt;br /&gt;
&lt;br /&gt;
Technical details about code and examples  can be found on our [http://e6.ijs.si/medusa/docs/ documentation page] and [https://gitlab.com/e62Lab/medusa Gitlab repository]. [[File:C.png|100px||link=https://gitlab.com/e62Lab/medusa|alt=Alt text|code]] [[File:doxygen.png|100px|link=http://e6.ijs.si/medusa/docs/|alt=Alt text|Documentation page]]&lt;br /&gt;
&lt;br /&gt;
This wiki site is meant for more relaxed discussions about general principles, possible and already implemented applications, preliminary analyses, etc.&lt;br /&gt;
Note, that there are many grammatical mistakes, typos, stupid sentences, etc. This wiki is meant for quick information exchange and therefore we do not invest a lot of energy into styling :).  &lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [https://gitlab.com/e62Lab/medusa Code on Gitlab]&lt;br /&gt;
* [[How to build | Installation and building]]&lt;br /&gt;
* [[Including this library in your project | Including this library in your project]]&lt;br /&gt;
* [[Testing | Running tests]]&lt;br /&gt;
* [http://e6.ijs.si/medusa/docs/ Technical documentation]&lt;br /&gt;
* [[Coding style | Coding style]]&lt;br /&gt;
* [[Wiki editing guide | Wiki editing and backup guide]]&lt;br /&gt;
&lt;br /&gt;
== Building blocks ==&lt;br /&gt;
Medusa is modular coordinate-free parallel implementation of a numerical framework designed, but not limited to, for solving PDEs. In this section we present main modules of the library that can be also used as a standalone tools. &lt;br /&gt;
* [[Positioning of computational nodes]] &lt;br /&gt;
* [[Relaxation of the nodal distribution]]&lt;br /&gt;
* [[Refinement of the nodal distribution]]&lt;br /&gt;
* [[k-d tree|''k''-d tree and other spatial search structures]] &lt;br /&gt;
* [[Solving system | Solving linear system - including over and underdetermined systems]]&lt;br /&gt;
* [[Weighted Least Squares (WLS)]]&lt;br /&gt;
* [[Computation of shape functions]]&lt;br /&gt;
* [[Radial basis function-generated finite differences (RBF-FD)]]&lt;br /&gt;
* [[Ghost nodes (theory)]]&lt;br /&gt;
* [[Integrators for time stepping]]&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
In this section we present exact examples. Each of the below solutions can be found also in in the repository under examples. More explanation about the physical background and solution procedure can be found in following sections.&lt;br /&gt;
* [[Philosophy of examples and how to run them]]&lt;br /&gt;
* [[Poisson's equation]]&lt;br /&gt;
* [[Heat equation]]&lt;br /&gt;
* [[Linear elasticity]]&lt;br /&gt;
* [[Complex-valued problems]]&lt;br /&gt;
* [[Coupled domains]]&lt;br /&gt;
* [[Parametric domains | Parametric domains &amp;amp;ndash; Curved surface with variable density]]&lt;br /&gt;
* [[NURBS domains | Domains modeled with non-uniform rational basis splines (NURBS)]]&lt;br /&gt;
* [[Determining the interior of the domain by oversampling the boundary]]&lt;br /&gt;
* [[Computer-aided design - Importing IGES and STEP files]]&lt;br /&gt;
* [[Realistic 3D models|Working with 3D surface mesh models ]]&lt;br /&gt;
* [[customization | Operator customization]]&lt;br /&gt;
* [[Ghost nodes]]&lt;br /&gt;
* [[Electromagnetic scattering]]&lt;br /&gt;
* [[Schrödinger equation]]&lt;br /&gt;
* [[Wave equation]]&lt;br /&gt;
* [[Cahn-Hilliard equation]]&lt;br /&gt;
* [[Fluid mechanics]]&lt;br /&gt;
* [[Solid Mechanics | Solid mechanics]]&lt;br /&gt;
&lt;br /&gt;
== Discussions / Applications ==&lt;br /&gt;
This section is meant for general discussion about the physical background of the examples, the solution procedures, various applications, etc. Note, that code snippets presented in discussion might not reflect the actual state of Medusa.  &lt;br /&gt;
* [[Convection Diffusion equation | Convection Diffusion equation]]&lt;br /&gt;
* [[Adaptivity|H-adaptivity]]&lt;br /&gt;
* [[Hp-adaptivity]]&lt;br /&gt;
* [[Solid Mechanics]]&lt;br /&gt;
** [[Point contact]]&lt;br /&gt;
** [[Hertzian contact]]&lt;br /&gt;
** [[Cantilever beam]]&lt;br /&gt;
** [[Fretting fatigue case]]&lt;br /&gt;
** [[Plasticity]]&lt;br /&gt;
* [[Fluid Mechanics]]&lt;br /&gt;
** [[Lid driven cavity]]&lt;br /&gt;
** [[de Vahl Davis natural convection test]]&lt;br /&gt;
** [[Natural convection in 3D irregular domain]]&lt;br /&gt;
** [[Natural convection from heated cylinder]]&lt;br /&gt;
** [[Natural convection between concentric cylinders]]&lt;br /&gt;
** [[Non-Newtonian fluid]]&lt;br /&gt;
* [[Computational electromagnetics]]&lt;br /&gt;
** [[Triple dielectric step in 1D]]&lt;br /&gt;
** [[Scattering from an infinite cylinder]]&lt;br /&gt;
** [[Point source near an anisotropic lens]]&lt;br /&gt;
* Other applications&lt;br /&gt;
** [[Attenuation due to liquid water content in the atmosphere|Attenuation of a satellite communication]]&lt;br /&gt;
** [[Heart rate variability detection]]&lt;br /&gt;
** [[Bioheat equation]]&lt;br /&gt;
&lt;br /&gt;
== Performance analyses ==&lt;br /&gt;
* [[Execution on Intel® Xeon Phi™ co-processor]]&lt;br /&gt;
* [[1D MLSM and FDM comparison]]&lt;br /&gt;
* [[:File:tech_report.pdf|Execution overheads due to clumsy types::technical report]] [[File:pdf-file.gif]]&lt;br /&gt;
* [[Solving sparse systems]]&lt;br /&gt;
* [[Eigen paralelization]]&lt;br /&gt;
&lt;br /&gt;
== Last changes ==&lt;br /&gt;
&amp;lt;news unique=1 limit = 5&amp;gt;&lt;br /&gt;
*{{{timeanddate}}} :: {{{title}}} &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/news&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Miscellaneous ==&lt;br /&gt;
* FAQ  - [[Frequently asked questions]]. &lt;br /&gt;
* [[List of wiki contributors]]&lt;br /&gt;
* List of library contributors: [http://e6.ijs.si/medusa/about#about-contributors See the official website]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
For all related papers including conference contributions, monographs and book chapters check https://e6.ijs.si/ParallelAndDistributedSystems/publications/&lt;br /&gt;
&lt;br /&gt;
{{Box-round|title= Selected papers |&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/98533123.pdf M. Depolli, J. Slak, G. Kosec; Parallel domain discretization algorithm for RBF-FD and other meshless numerical methods for solving PDEs, Computers &amp;amp; Structures, 2022 [DOI: 10.1016/j.compstruc.2022.106773]]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/69777155.pdf J. Slak, G. Kosec; Medusa : A C++ library for solving PDEs using strong form mesh-free methods, ACM transactions on mathematical software, vol. 47, 2021 [DOI: 10.1145/3450966]]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/56730115.pdf U. Duh, G. Kosec, J. Slak; Fast variable density node generation on parametric surfaces with application to mesh-free methods, SIAM journal on scientific computing, vol. 43, 2021 [DOI: 10.1137/20M1325642]]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/52715011.pdf M. Jančič, J. Slak, G. Kosec; Monomial augmentation guidelines for RBF-FD from accuracy versus computational time perspective, Journal of scientific computing, vol. 87, 2021 [DOI: 10.1007/s10915-020-01401-y]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/32782887.pdf J. Slak, G. Kosec; On generation of node distributions for meshless PDE discretizations, SIAM journal on scientific computing, vol. 41, 2019 [DOI: 10.1137/18M1231456]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/32424999.pdf G. Kosec, J. Slak, M. Depolli, R. Trobec, K. Pereira, S. Tomar, T. Jacquemin, S. Bordas, M. Wahab; Weak and strong from meshless methods for linear elastic problem under fretting contact conditions, Tribology international, vol. 138, 2019]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/32230439.pdf J. Slak, G. Kosec; Adaptive radial basis function-generated finite differences method for contact problems, International journal for numerical methods in engineering, vol. 119, 2019 [DOI: 10.1002/nme.6067]]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/32388135.pdf M. Maksić, V. Djurica, A. Souvent, J. Slak, M. Depolli, G. Kosec; Cooling of overhead power lines due to the natural convection, International journal of electrical power &amp;amp; energy systems, 2019]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/31107623.pdf J. Slak, G. Kosec; Refined meshless local strong form solution of Cauchy-Navier equation on an irregular domain, Engineering analysis with boundary elements, vol. 100, 2019]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/29639719.pdf M. Depolli, G. Kosec; Assessment of differential evolution for multi-objective optimization in a natural convection problem solved by a local meshless method, Engineering optimization, 2017, vol. 49, no. 4, pp. 675-692]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/29512743.pdf G. Kosec; A local numerical solution of a fluid-flow problem on an irregular domain, Advances in engineering software, vol. 120, 2018 [DOI: 10.1016/j.advengsoft.2016.05.010]]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/27912487.pdf G. Kosec, R. Trobec; Simulation of semiconductor devices with a local numerical approach, Engineering analysis with boundary elements, 2015 [DOI: 10.1016/j.enganabound.2014.07.013]]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/3218939.pdf G. Kosec, B. Šarler; Simulation of macrosegregation with mesosegregates in binary metallic casts by a meshless method, Engineering analysis with boundary elements]&lt;br /&gt;
&lt;br /&gt;
[http://comms.ijs.si/~gkosec/data/papers/27339815.pdf G. Kosec, M. Depolli, A. Rashkovska, R. Trobec; Super linear speedup in a local parallel meshless solution of thermo-fluid problem, Computers &amp;amp; Structures, vol. 133, 2014]&lt;br /&gt;
&lt;br /&gt;
[http://comms.ijs.si/~gkosec/data/papers/26785063.pdf G. Kosec, P. Zinterhof; Local strong form meshless method on multiple Graphics Processing Units, Computer modeling in engineering &amp;amp; sciences, vol. 91, 2013]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/2599419.pdf G. Kosec, B. Šarler; Solution of a low Prandtl number natural convection benchmark by a local meshless method, International journal of numerical methods for heat &amp;amp; fluid flow]&lt;br /&gt;
&lt;br /&gt;
[http://comms.ijs.si/~gkosec/data/papers/EABE2499.pdf R. Trobec, G. Kosec, M. Šterk, B. Šarler; Comparison of local weak and strong form meshless methods for 2-D diffusion equation, Engineering analysis with boundary elements, vol. 36, 2012]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/1905659.pdf G. Kosec, M. Založnik, B. Šarler, H. Combeau; A meshless approach towards solution of macrosegregation phenomena, Computers, materials &amp;amp; continua : CMC, vol. 22, 2011 ]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/992507.pdf G. Kosec, B. Šarler; Solution of thermo-fluid problems by collocation with local pressure correction, International journal of numerical methods for heat &amp;amp; fluid flow, vol.18, 2008]&lt;br /&gt;
&lt;br /&gt;
R. Trobec, G. Kosec; Parallel scientific computing : theory, algorithms, and applications of mesh based and meshless methods, 2015&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Related pages==&lt;br /&gt;
* http://e6.ijs.si/ParallelAndDistributedSystems/products/medusa/&lt;/div&gt;</summary>
		<author><name>E6WikiAdmin</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=Test&amp;diff=3550</id>
		<title>Test</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=Test&amp;diff=3550"/>
				<updated>2023-03-27T06:50:38Z</updated>
		
		<summary type="html">&lt;p&gt;E6WikiAdmin: Created page with &amp;quot;&amp;lt;div class=&amp;quot;frontmatter&amp;quot;&amp;gt;  &amp;lt;div class=&amp;quot;keyword&amp;quot;&amp;gt;  mesh-free ,plasticity ,non-linear ,isotropic hardening ,von Mises model ,RBF-FD ,plane stress   &amp;lt;/div&amp;gt;  &amp;lt;/div&amp;gt; &amp;lt;span id=&amp;quot;intr...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;frontmatter&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;keyword&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
mesh-free ,plasticity ,non-linear ,isotropic hardening ,von Mises model ,RBF-FD ,plane stress&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;introduction&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Speaking very broadly, a deformation of a solid body can be broken down into two main sub-categories: elastic and plastic deformation. It is said, that the deformation is elastic, if the body returns to its original shape after the applied load had been released, while plastic deformation occurs when any part of a solid body undergoes a non-reversible change of shape due to sufficiently large load applied ([[#ref-fung2001classical|Fung and Tong 2001]]). Generally, the material response beyond the elastic-plastic tipping point, commonly referred to as ''yielding criterion'', is non-linear ([[#ref-desouza2008|Souza Neto, Peric, and Owen 2008]]), thus numerical treatment of partial differential equations is required ([[#ref-desouza2008|Souza Neto, Peric, and Owen 2008]]).&lt;br /&gt;
&lt;br /&gt;
Traditionally, such problems are solved with the finite elements method (FEM) ([[#ref-Bartels2012QuasiStaticSP|Bartels, Mielke, and Roubíček 2012]]; [[#ref-Schrder2015SmallSP|Schröder and Kuhl 2015]]; [[#ref-Roostaei2018ACS|Roostaei and Jahed 2018]]; [[#ref-amouzou2021|Amouzou and Soulaïmani 2021]]). In this work, however, we employ meshless methods that have proven to be a good alternative as they can operate on nodes contrary to mesh-based methods that require meshes ([[#ref-belytschko1996meshless|Belytschko et al. 1996]]). An often used variant of the meshless methods is the radial basis function-generated finite differences (RBF-FD) ([[#ref-bayona2017role|Victor Bayona et al. 2017]]), which has already been employed to obtain solutions to elasticity ([[#ref-Depolli2019|Depolli and Trobec 2019]]; [[#ref-slak2019rbffd|Slak and Kosec 2019a]]) and plasticity ([[#ref-JANKOWSKA201812|Jankowska 2018]]; [[#ref-jiang2021nonlinear|Jiang et al. 2021]]) problems.&lt;br /&gt;
&lt;br /&gt;
We present our implementation of a von Mises plasticity model with non-linear isotropic hardening limited to small strains in a plane stress example. The implementation was done using our in-house developed MEDUSA C++ library ([[#ref-slak2021medusa|Slak and Kosec 2021]]) supporting all the required meshless procedures. The original FEM formulation of the solution procedure provided by the de Souza et al. ([[#ref-desouza2008|Souza Neto, Peric, and Owen 2008]]) is adapted to employ RBF-FD and used to solve a simple plane stress problem.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;sec:numerical_treatment&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Numerical treatment of partial differential equations in the context of mesh-free methods =&lt;br /&gt;
&lt;br /&gt;
Due to advanced mathematical modelling considering evermore details about the natural phenomena under consideration, most systems of PDEs are so complex that they cannot be analytically solved. This is particularly true for realistic problems, such as elastic-plastic deformation of a solid body. When a solution to such problems is still required, the systems is treated numerically in several steps obtaining a numerical solution in the process. In the first step, the domain is discretized. In the context of mesh-free methods, the domain is discretized by positioning the nodes on the domain boundary and its interior. In the second step, linear differential operators in each computational node are approximated before, in the third step, the system of PDEs is discretized and assembled into a large sparse linear system. Finally, the sparse system is solved and a numerical solution &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\widehat{u}&amp;lt;/math&amp;gt; is obtained.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;sec:domain_discretization&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Domain discretization ==&lt;br /&gt;
&lt;br /&gt;
Discretizing the domain for the purpose of numerical treatment with mesh-free methods is significantly simplified compared to using the mesh-based methods. While mesh-based methods require the computational nodes structured into polyhedrons covering the entire domain of interest, no internodal connectivity is required for operation of mesh-free methods. This seemingly small difference notably simplifies the discretization of complex 3D domains, where building mesh is often the most cumbersome and time-consuming step in the solution procedure.&lt;br /&gt;
&lt;br /&gt;
Several dedicated node positioning algorithms have been proposed in the mesh-free community. We choose a dimension-independent node generation algorithm proposed by our team ([[#ref-slak2019generation|Slak and Kosec 2019b]]), which was just recently parallelized for faster execution ([[#ref-depolli2022parallel|Depolli, Slak, and Kosec 2022]]) and generalised to discretise parametric surfaces ([[#ref-duh2021fast|Duh, Kosec, and Slak 2021]]). An example of domain discretization using scattered nodes is shown in Figure [[#fig:domain|1]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;fig:domain&amp;quot; class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:figures/domain_discretization_sample.png]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
Interested readers are referred to the original paper ([[#ref-slak2019generation|Slak and Kosec 2019b]]) for more details on the node generation algorithm or its stand-alone C++ implementation in the ''Medusa library'' ([[#ref-slak2021medusa|Slak and Kosec 2021]]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;sec:rbffd&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== RBF-FD approximation of differential operators ==&lt;br /&gt;
&lt;br /&gt;
After the computational nodes have been positioned, linear differential operators appearing in our governing system of PDEs are approximated. Any linear differential operator is approximated over a set of nearby nodes, commonly referred to as ''stencil nodes''. Despite different stencil node selection strategies proposed ([[#ref-davydov2011adaptive|Davydov and Oanh 2011]]; [[#ref-davydov2022improved|Davydov, Oanh, and Tuong 2022]]), researchers often choose a cloud of closest &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;n&amp;lt;/math&amp;gt; nodes according to the Eucledian distance. The latter approach is also used in this paper.&lt;br /&gt;
&lt;br /&gt;
To derive the approximation, assume a linear differential operator &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\mathcal{L}&amp;lt;/math&amp;gt; in central point &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\boldsymbol{x}_c \in \Omega&amp;lt;/math&amp;gt; and its stencil nodes &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\left \{ \boldsymbol{x}_i \right\}_{i=1}^n = \mathcal{N}&amp;lt;/math&amp;gt;. The approximation is then sough using an ansatz &amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt;\label{eq:ansatz}&lt;br /&gt;
    (\mathcal{L}u)(\boldsymbol{x}_c) \approx \sum_{i=1}^n w_iu(\boldsymbol{x}_i),&amp;lt;/math&amp;gt; for any function &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;u&amp;lt;/math&amp;gt; and unknown weights &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\boldsymbol{w}&amp;lt;/math&amp;gt;. Note that the form of the right hand side is very desireable, as the sum can be compactly written with a dot product between the vector of yet to be determined weights &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\boldsymbol{w}&amp;lt;/math&amp;gt; and field values &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\boldsymbol u&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The weights &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\boldsymbol{w}&amp;lt;/math&amp;gt; are obtained by enforcing the equality of approximation [[#eq:ansatz|[eq:ansatz]]] for a chosen set of basis functions. In this work, polyharmonic splines augmented with monomials are used, effectively resulting in a RBF-FD mesh-free variant, commonly used by the meshless community. Other common RBF choices include Hardy’s multiquadrics or Gaussians. However, these depend on a shape parameter which can have a notable effect on the accuracy of the numerical solution and on the stability of the solution procedure ([[#ref-bayona2017role|Victor Bayona et al. 2017]]; [[#ref-perko2007weight|Perko, Sarler, et al. 2007]]; [[#ref-wang2002optimal|Wang and Liu 2002]]). Therefore, by choosing PHS defined as &amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt;f(r) = \begin{cases}r^k,       &amp;amp; k \text{ odd}  \\&lt;br /&gt;
             r^k\log r, &amp;amp; k \text{ even}\end{cases}&amp;lt;/math&amp;gt; for Eucledian distance &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;r&amp;lt;/math&amp;gt;, the dependency on the shape parameter is eliminated and fine-tuning the results is also prevented.&lt;br /&gt;
&lt;br /&gt;
Generally speaking, the PHSs are generated by a function &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;f:[0, \infty)\rightarrow \mathbb{R}&amp;lt;/math&amp;gt; cantered at the stencil nodes &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\mathcal N&amp;lt;/math&amp;gt; of &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\boldsymbol{x}_c&amp;lt;/math&amp;gt;. Therefore, each basis function can be written as &amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt;f_j = f(\left \| \boldsymbol{x}- \boldsymbol{x}_j \right \|)=f(r_j),&amp;lt;/math&amp;gt; for stencil node index &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;j&amp;lt;/math&amp;gt;. Following the approximation [[#eq:ansatz|[eq:ansatz]]], each index &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;j&amp;lt;/math&amp;gt; corresponds to a linear equation &amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt;\sum_{i=1}^nw_if_j(\boldsymbol{x}_i)=(\mathcal{L}f_j)(\boldsymbol{x}_c).&amp;lt;/math&amp;gt; Gathering all &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;n&amp;lt;/math&amp;gt; equations for a given stencil, we write a compact matrix form &amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt;\label{eq:system_rbf}&lt;br /&gt;
    \boldsymbol F\boldsymbol{w}=\ell _f, \qquad&lt;br /&gt;
    \boldsymbol F = \begin{bmatrix}&lt;br /&gt;
        f(\left\| \boldsymbol{x}_1 - \boldsymbol{x}_1\right\|) &amp;amp; \cdots &amp;amp; f(\left\| \boldsymbol{x}_n - \boldsymbol{x}_1\right\|) \\&lt;br /&gt;
        \vdots                         &amp;amp; \ddots &amp;amp; \vdots                         \\&lt;br /&gt;
        f(\left\| \boldsymbol{x}_1 - \boldsymbol{x}_n\right\|) &amp;amp; \cdots &amp;amp; f(\left\| \boldsymbol{x}_n - \boldsymbol{x}_n\right\|) \\&lt;br /&gt;
    \end{bmatrix}&amp;lt;/math&amp;gt; for matrix &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\boldsymbol F&amp;lt;/math&amp;gt; of evaluated basis functions and vector &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\boldsymbol\ell_f&amp;lt;/math&amp;gt; vector of values assembled by applying the considered operator &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\mathcal{L}&amp;lt;/math&amp;gt; to the RBFs evaluated at &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\boldsymbol{x}_c&amp;lt;/math&amp;gt; &amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt;\ell_f^i = \Big(\mathcal{L}f_i(\boldsymbol{x})\Big)\Big|_{ \boldsymbol x = \boldsymbol x_c}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, it has already been observed that using only PHS as basis functions does not guarantee convergent behaviour or solvability ([[#ref-wendland2004scattered|Wendland 2004]]). Fortunately, assuring convergent behaviour and conditional positive definiteness can be assured if the approximation [[#eq:ansatz|[eq:ansatz]]] is expanded with monomials ([[#ref-bayona2019insight|Vı́ctor Bayona 2019]]; [[#ref-wendland2004scattered|Wendland 2004]]; [[#ref-flyer2016role|Flyer et al. 2016a]]). Therefore, the system [[#eq:system_rbf|[eq:system_rbf]]] is augmented with &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;N_p&amp;lt;/math&amp;gt; monomials &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;p&amp;lt;/math&amp;gt; with orders up to and including degree &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;m&amp;lt;/math&amp;gt;, yielding an overdetermined system of equations commonly treated as a constrained optimization problem ([[#ref-flyer2016|Flyer et al. 2016b]]). In practice, the optimal solution is expressed as a solution to &amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt;\label{eq:rbf-system-aug}&lt;br /&gt;
    \begin{bmatrix}&lt;br /&gt;
        \boldsymbol F    &amp;amp; \boldsymbol P \\&lt;br /&gt;
        \boldsymbol P^\mathsf{T}&amp;amp; \boldsymbol 0&lt;br /&gt;
    \end{bmatrix}&lt;br /&gt;
    \begin{bmatrix}&lt;br /&gt;
        \boldsymbol w \\&lt;br /&gt;
        \boldsymbol\lambda&lt;br /&gt;
    \end{bmatrix}&lt;br /&gt;
    =&lt;br /&gt;
    \begin{bmatrix}&lt;br /&gt;
        \boldsymbol\ell_f \\&lt;br /&gt;
        \boldsymbol\ell_p&lt;br /&gt;
    \end{bmatrix},&amp;lt;/math&amp;gt; with the matrix &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\boldsymbol P&amp;lt;/math&amp;gt; of the evaluated monomials and Lagrangian multipliers &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\boldsymbol\lambda&amp;lt;/math&amp;gt;. The weights are obtained by solving the system, while Lagrangian multipliers are discarded.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;sec:plasticity&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Theory of plastic deformation =&lt;br /&gt;
&lt;br /&gt;
In materials science, plastic deformation, also known as plasticity, is the ability of a solid material to undergo permanent changes in shape as a response to the applied forces. This type of deformation is non-reversible and occurs when the material’s internal structure is altered.&lt;br /&gt;
&lt;br /&gt;
The transition from elastic to plastic behaviour is known as ''yielding'', and is a crucial concept in the design and development of materials. The ability to predict and control plastic deformation is important for the engineering of structures and components that are subjected to various loads exposed to different conditions. The study of plastic deformation also plays a vital role in the understanding of the mechanical properties of materials, making it even more crucial to understand for the engineers and scientists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;sec:stress_strain&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Stress-strain relationship ==&lt;br /&gt;
&lt;br /&gt;
Typically, uniaxial tension test is performed to obtain knowledge about the material behaviour when exposed to load. This work is limited to study of rate-independent materials where the deformation of the material under consideration does not depend on the rate of applied loads. Such test with a ductile metal typically yields behaviour that is commonly referred to as a stress-strain curve as sketched in Figure [[#fig:stress_strain_sketch|2]] for example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;fig:stress_strain_sketch&amp;quot; class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:figures/stress-strain-sketch.pdf]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
In the first segment, the material undergoes elastic deformation. Since the stress-strain relation in that segment is linear, researchers often refer to it as linear elastic deformation, where the slope of the curve is the elastic Young’s modulus. If the applied load is released before the yield stress is achieved, the material returns to its original state without any permanent deformation. However, beyond the yielding point the total deformation has plastic and elastic contributions.&lt;br /&gt;
&lt;br /&gt;
The stress-strain relation beyond the yielding point is also known as the hardening curve. If the material under consideration is unloaded in that segment, the material no longer returns to its original, instead at least some parts of it stay (plastically) deformed. Generally speaking, different materials yield different hardening curves. For the simplification purposes, ideal plasticity, defined when the stress is independent of the strain and equals yield stress, is commonly used. Another common approach is to employ linear hardening. In practice, the hardening is represented as a curve fitted to experimental data as sketched in Figure [[#fig:stress_strain_sketch|2]] let that be a piecewise linear fit or something more complicated. Nevertheless, if the applied load is increased even further, the material at some point brakes and the uniaxial test is finished.&lt;br /&gt;
&lt;br /&gt;
Our research is limited to isotropic hardening, where the evolution of yield stress surface corresponds to a uniform (isotropic) expansion of the initial yield surface. Other types of hardening hve also been proposed. Description of other commonly used hardening types can be found in ([[#ref-desouza2008|Souza Neto, Peric, and Owen 2008]]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;sec:elastic_plastic&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Elastic-plastic problem formulation ==&lt;br /&gt;
&lt;br /&gt;
In the following subsections, the theoretical background of plastic deformation — largely based on the workings of de Souza ''et.al.'' ([[#ref-desouza2008|Souza Neto, Peric, and Owen 2008]]) — is presented.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;algorithm&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Input:''' The problem, nodal density, function &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;h&amp;lt;/math&amp;gt;, stencil size &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;n&amp;lt;/math&amp;gt;, linear differential operators &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\mathcal{L}&amp;lt;/math&amp;gt;, approximation basis &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\xi&amp;lt;/math&amp;gt;, material properties, storage &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\Pi&amp;lt;/math&amp;gt;, load steps &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;N_{\text{load}}&amp;lt;/math&amp;gt;, load &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\sigma_{\text{load}}&amp;lt;/math&amp;gt;.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Output:''' Deformation field.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;algorithmic&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\Omega \gets \Call{discretise}{\Omega, h}&amp;lt;/math&amp;gt; &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\Pi \gets \Call{aproximate}{\mathcal{L}, \xi}&amp;lt;/math&amp;gt; &amp;lt;span id=&amp;quot;alg:while&amp;quot; label=&amp;quot;alg:while&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\delta \boldsymbol u = 0&amp;lt;/math&amp;gt; &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\delta \boldsymbol F = 0&amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\delta \boldsymbol u \gets \Call{solve}{\text{problem}, \Pi, \delta \boldsymbol F}&amp;lt;/math&amp;gt; &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\boldsymbol u = \boldsymbol u + \delta \boldsymbol u&amp;lt;/math&amp;gt; &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\varepsilon, \sigma \gets \Call{process}{\boldsymbol u}&amp;lt;/math&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\sigma (\boldsymbol p), \varepsilon(\boldsymbol p) \gets \Call{return\_mapping}{I_{\text{max}}, \varepsilon_{\text{tol}}}&amp;lt;/math&amp;gt; &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\delta \boldsymbol F \gets \Call{compute\_residuum}{\sigma}&amp;lt;/math&amp;gt; &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\varepsilon, \sigma, \boldsymbol u&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;linear-elasticity&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Linear elasticity ==&lt;br /&gt;
&lt;br /&gt;
The assumption in linear elasticity is that, when subjected to external forces, bodies deform linearly, obeying Hooke’s law. Thus one can define the stress tensor &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\bm{\sigma}&amp;lt;/math&amp;gt; as the product of elasticity tensor &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\mathrm{D}^e&amp;lt;/math&amp;gt; and the strain tensor &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\bm{\varepsilon}&amp;lt;/math&amp;gt;: &amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt;\label{eq: stress}&lt;br /&gt;
    \bm{\sigma} = \mathrm{D}^e \bm{\varepsilon}.&amp;lt;/math&amp;gt; Here we are using the matrix-vector notation, so in three dimensions &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\bm{\sigma} = \left(\sigma_{xx}, \sigma_{yy}, \sigma_{zz}, \sigma_{xy}, \sigma_{yz}, \sigma_{xz}\right)^\intercal&amp;lt;/math&amp;gt;, and &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\bm{\varepsilon} = \left(\varepsilon_{xx}, \varepsilon_{yy}, \varepsilon_{zz}, \varepsilon_{xy}, \varepsilon_{yz}, \varepsilon_{xz}\right)^\intercal&amp;lt;/math&amp;gt;. Additionally, the elasticity tensor can be written as: &amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt;\label{eq: de}&lt;br /&gt;
    \mathrm{D}^e = 2\mu\mathrm{I}_S + \lambda\mathbf{i}\mathbf{i}^\intercal,&amp;lt;/math&amp;gt; where &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\mathrm{I}_S&amp;lt;/math&amp;gt; is the symmetric identity tensor, and &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\mathbf{i}&amp;lt;/math&amp;gt; is the array representation of the identity matrix. &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\lambda&amp;lt;/math&amp;gt;, and &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\mu&amp;lt;/math&amp;gt; are the first, and second Lamé parameters, respectively. In terms of Young’s modulus &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;E&amp;lt;/math&amp;gt;, and Poisson’s ratio &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\nu&amp;lt;/math&amp;gt;, these are defined as: &amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt;\label{eq: lame}&lt;br /&gt;
    \begin{aligned}&lt;br /&gt;
        \lambda &amp;amp; = \frac{E \nu}{\left(1 - 2\nu\right)\left(1 + \nu\right)} \\&lt;br /&gt;
        \mu     &amp;amp; = \frac{E}{2 \left(1 + \nu\right)}.&lt;br /&gt;
    \end{aligned}&amp;lt;/math&amp;gt; When considering problems with the small-strain constraint &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\varepsilon&amp;lt;/math&amp;gt; is linked with the displacement vector &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\mathbf{u}&amp;lt;/math&amp;gt; ''via'' the following expression: &amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt;\label{eq: strain}&lt;br /&gt;
    \bm{\varepsilon} = \frac{\nabla \mathbf{u} + (\nabla \mathbf{u})^{\intercal}}{2}.&amp;lt;/math&amp;gt; Finally, the internal force density &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\mathbf{f}^i&amp;lt;/math&amp;gt; can be computed as the divergence of the stress tensor: &amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt;\label{eq: frc den}&lt;br /&gt;
    \mathbf{f}^i = \nabla \cdot \bm{\sigma}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let us assume an external force acting on a body, and its force density being &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\mathbf{f}^e&amp;lt;/math&amp;gt;. At equilibrium the sum of internal and external forces is zero, therefore &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\mathbf{f}^e + \mathbf{f}^i = \mathbf{0}&amp;lt;/math&amp;gt;. Inserting, and combining [[#eq: stress|[eq: stress]]], [[#eq: de|[eq: de]]], [[#eq: strain|[eq: strain]]], and [[#eq: frc den|[eq: frc den]]] into this equilibrium expression, one arrives to the Navier-Cauchy equation: &amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt;\label{eq: navier-cauchy}&lt;br /&gt;
    \left(\lambda + \mu\right) \nabla (\nabla \cdot \mathbf{u}) + \mu \nabla^2 \mathbf{u} + \mathbf{f}^e = \mathbf{0}.&amp;lt;/math&amp;gt; The Navier-Cauchy equation needs to be solved in linear-elasticity problems to find the stress, strain, and displacement distributions in solid bodies.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;elasto-plasticity&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Elasto-plasticity ==&lt;br /&gt;
&lt;br /&gt;
Materials can also deform elasto-plastically, i.e. when subjected to an external force they deform linearly, following the equations described in the previous section, but once a threshold stress (yield stress &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\sigma_y&amp;lt;/math&amp;gt;) is reached in the material, they start deforming plastically. Plastic deformation is, unlike elastic, irreversible. Therefore part of the deformation in the material is due to the elastic strain &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\bm{\varepsilon}^e&amp;lt;/math&amp;gt;, and another due plastic strain &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\bm{\varepsilon}^p&amp;lt;/math&amp;gt;. The sum of the two gives the total strain &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\bm{\varepsilon}&amp;lt;/math&amp;gt;: &amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt;\label{eq: tot strain}&lt;br /&gt;
    \bm{\varepsilon} = \bm{\varepsilon}^e + \bm{\varepsilon}^p.&amp;lt;/math&amp;gt; Consequently the model for solving elasto-plastic deformations needs to be modified. One approach to solving such problems is by applying partial loads to the modeled body ([[#ref-desouza2008|Souza Neto, Peric, and Owen 2008]]; [[#ref-yarushina2010|Yarushina, Dabrowski, and Podladchikov 2010]]). These partial loads should add-up to the total applied load. Each time a partial load is applied to the body, the solution is first predicted by solving [[#eq: navier-cauchy|[eq: navier-cauchy]]], which yields a vector field of displacement increments &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\Delta\mathbf{u}&amp;lt;/math&amp;gt;. At load step &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;n&amp;lt;/math&amp;gt; one thus obtains the following set of predictions: &amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt;\label{eq: pred}&lt;br /&gt;
    \begin{aligned}&lt;br /&gt;
        \mathbf{u}_{n}         &amp;amp; = \mathbf{u}_{n - 1} + \Delta\mathbf{u}                                                               \\&lt;br /&gt;
        \Delta\bm{\varepsilon} &amp;amp; = \frac{\nabla \left(\Delta\mathbf{u}\right) + (\nabla \left(\Delta\mathbf{u}\right))^{\intercal}}{2} \\&lt;br /&gt;
        \bm{\varepsilon}^e_{n} &amp;amp; = \bm{\varepsilon}^e_{n - 1} + \Delta\bm{\varepsilon}                                                 \\&lt;br /&gt;
        \bm{\varepsilon}^p_{n} &amp;amp; = \bm{\varepsilon}^p_{n - 1}                                                                          \\&lt;br /&gt;
        \varepsilon^p_n        &amp;amp; = \varepsilon^p_{n - 1}                                                                               \\&lt;br /&gt;
        \bm{\sigma}_n          &amp;amp; = \mathrm{D}^e \bm{\varepsilon}^e_n.&lt;br /&gt;
    \end{aligned}&amp;lt;/math&amp;gt; Note that the stress tensor is calculated only from the elastic strain. As [[#eq: navier-cauchy|[eq: navier-cauchy]]] is only valid in the elastic region of the body, its validity needs to be assessed. This can be done in several ways, in this paper, however, we focus on the von Mises yield criterion, and von Mises plastic flow rule. First step in validity assessment is to compute the scalar von Mises stress &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\sigma_{VM}&amp;lt;/math&amp;gt;: &amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt;\label{eq: vms}&lt;br /&gt;
    \sigma_{VM} = \sqrt{\frac{\left(\sigma_{xx} - \sigma_{yy}\right)^2 + \left(\sigma_{yy} - \sigma_{zz}\right)^2 + \left(\sigma_{zz} - \sigma_{xx}\right)^2 + 6 \left(\sigma_{xy}^2 + \sigma_{yz}^2 + \sigma_{xz}^2\right)}{2}}.&amp;lt;/math&amp;gt; Assuming that the yield stress is a function of the scalar equivalent plastic strain &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\varepsilon^p&amp;lt;/math&amp;gt;, &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\sigma_{VM}&amp;lt;/math&amp;gt; is then compared to &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\sigma_y(\varepsilon^p)&amp;lt;/math&amp;gt; by computing the yield function &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\Phi&amp;lt;/math&amp;gt;: &amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt;\label{eq: y funct}&lt;br /&gt;
    \Phi = \sigma_{VMn} - \sigma_y(\varepsilon^p_n).&amp;lt;/math&amp;gt; If &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\Phi \leq 0&amp;lt;/math&amp;gt;, the solution is valid, otherwise the prediction needs to be adjusted according to a return mapping procedure. In this work we use the single-equation return mapping scheme, as it is described in ([[#ref-desouza2008|Souza Neto, Peric, and Owen 2008]]). For this purpose we introduce the incremental plastic multiplier &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\Delta\gamma&amp;lt;/math&amp;gt;. The target of the return mapping procedure is: &amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt;\label{eq: rm goal}&lt;br /&gt;
    \Phi = \sigma_{VMn} - 3 \mu \Delta\gamma - \sigma_y(\varepsilon^p_n + \Delta\gamma) = 0.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;sec:yield_criteria&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Yield criteria ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;sec:examples&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Numerical examples =&lt;br /&gt;
&lt;br /&gt;
In this section we present three scenarios of a pressurized thick-walled cylinder expansion: linear-elastic case, perfectly plastic elasto-plastic case, and elasto-plastic case with linear hardening. The cylinder dimensions, and material properties were inspired by ([[#ref-desouza2008|Souza Neto, Peric, and Owen 2008]]). Fig. [[#fig: sketch 2|4]] ...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;fig: sketch&amp;quot; class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:sketch]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;fig: sketch 2&amp;quot; class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:sketch_raw]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;sec:first_example&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Linear-elastic case ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt;\label{eq: analytical l-elastic}&lt;br /&gt;
    \begin{aligned}&lt;br /&gt;
        \sigma_r        &amp;amp; = -p \left(\frac{\frac{b^2}{r^2} - 1}{\frac{b^2}{a^2} - 1}\right)                                                           \\&lt;br /&gt;
        \sigma_{\theta} &amp;amp; = p \left(\frac{\frac{b^2}{r^2} + 1}{\frac{b^2}{a^2} - 1}\right)                                                            \\&lt;br /&gt;
        \sigma_z        &amp;amp; = \frac{2 \nu p}{\frac{b^2}{a^2} - 1}                                                                                       \\&lt;br /&gt;
        u_r             &amp;amp; = \frac{p}{E} \frac{\left(1 + \nu\right)\left(1 - 2\nu\right) r + \left(1 + \nu\right) \frac{b^2}{r}}{\frac{b^2}{a^2} - 1}.&lt;br /&gt;
    \end{aligned}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;fig: elastic convergence&amp;quot; class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:elastic_cylinder_conv]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;fig: u vs an elastic&amp;quot; class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:u_le]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;fig: sr vs an elastic&amp;quot; class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:sR_le]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;fig: sh vs an elastic&amp;quot; class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:sH_le]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;fig: sz vs an elastic&amp;quot; class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:sZ_le]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;sec:second_example&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Perfectly-plastic yielding of an internally pressurized thick-walled cylinder ==&lt;br /&gt;
&lt;br /&gt;
Analytical solutions for the principal stresses and the displacement are given in ([[#ref-hill1998|Hill 1998]]; [[#ref-chakrabarty1987|Chakrabarty 1987]]). Hill in their derivation of the analytical solution assumes the Tresca yielding criterion, but argues that by modifying it slightly it can make a fair approximation for a case using the von Mises yielding criterion ([[#ref-hill1998|Hill 1998]]). Provided that the cylinder has started yielding, and the position of the plastic-elastic interface within the cylinder is &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;c&amp;lt;/math&amp;gt;, these analytical approximations read as follows: &amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt;\label{eq: analytical tresca}&lt;br /&gt;
    \begin{aligned}[c]&lt;br /&gt;
        \left.&lt;br /&gt;
        \begin{aligned}&lt;br /&gt;
            \sigma_r        &amp;amp; = -\frac{2 \sigma_y c^2}{\sqrt{3} b^2} \left(\frac{b^2}{r^2} - 1\right) \\&lt;br /&gt;
            \sigma_{\theta} &amp;amp; = \frac{2 \sigma_y c^2}{\sqrt{3} b^2} \left(\frac{b^2}{r^2} + 1\right)  \\&lt;br /&gt;
            \sigma_z        &amp;amp; = \frac{4 \nu \sigma_y c^2}{\sqrt{3} b^2}&lt;br /&gt;
        \end{aligned}&lt;br /&gt;
        \right\}&lt;br /&gt;
        c \leq r \leq b, \\&lt;br /&gt;
        \left.&lt;br /&gt;
        \begin{aligned}&lt;br /&gt;
            \sigma_r        &amp;amp; = -\frac{2 \sigma_y}{\sqrt{3}} \left(1 - \frac{c^2}{b^2} + \ln \frac{c^2}{r^2}\right)    \\&lt;br /&gt;
            \sigma_{\theta} &amp;amp; = \frac{2 \sigma_y}{\sqrt{3}} \left(1 + \frac{c^2}{b^2} + \ln \frac{c^2}{r^2}\right)     \\&lt;br /&gt;
            \sigma_z        &amp;amp; = \frac{4 \nu \sigma_y c^2}{\sqrt{3}} \left(\frac{c^2}{b^2} - \ln \frac{c^2}{r^2}\right)&lt;br /&gt;
        \end{aligned}&lt;br /&gt;
        \right\}&lt;br /&gt;
        a \leq r \leq c, \\&lt;br /&gt;
        \left.&lt;br /&gt;
        u_r = \left(1 - \nu\right) \frac{2 \sigma_y c^2}{\sqrt{3} G r} + \left(1 - 2 \nu\right) \frac{\sigma_r r}{2 G},&lt;br /&gt;
        \right. \ a \leq r \leq b.&lt;br /&gt;
    \end{aligned}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;c&amp;lt;/math&amp;gt; is determined from its relation to the cylinder’s internal pressure &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;p&amp;lt;/math&amp;gt;: &amp;lt;math display=&amp;quot;block&amp;quot;&amp;gt;\label{eq: c determine}&lt;br /&gt;
    p = \frac{2 \sigma_y}{\sqrt{3}} \left(1 - \frac{c^2}{b^2} + \ln \frac{c^2}{a^2}\right).&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;fig: load steps comparison&amp;quot; class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:load_stp_comparison]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;fig: eg result&amp;quot; class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:sR_all|image]] [[File:sH_all|image]]&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:sZ_all|image]] [[File:sVM_all|image]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;fig: u vs fem&amp;quot; class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:u]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;fig: sr vs fem&amp;quot; class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:sR]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;fig: sh vs fem&amp;quot; class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:sH]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;fig: sz vs fem&amp;quot; class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:sZ]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;fig: vms vs fem&amp;quot; class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:sVM]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;fig: c determine&amp;quot; class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:cDet]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;tb: res perfect&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Results of the perfect plastic case - von Mises stress, and displacement magnitude at inner and outer surfaces, and position of the elastic-plastic interface. Under “current” results we present the highest density discretization with 25 load steps vs FEM vs analytical approximation. *Average for all nodes on the edge. **Determined by fitting lines through points that are in the plastic zone (&amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\varepsilon^p &amp;gt; 0&amp;lt;/math&amp;gt;), and points that are outside it (&amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\varepsilon^p = 0&amp;lt;/math&amp;gt;), and finding the intersection between the two fits. ***Presumed von Mises stress in an ideal solution.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;text-align: left;&amp;quot;|&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;text-align: center;&amp;quot;| &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\sigma_{VM}&amp;lt;/math&amp;gt; [GPa]&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;text-align: center;&amp;quot;| &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;|\mathbf{u}|&amp;lt;/math&amp;gt; [mm]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;c&amp;lt;/math&amp;gt; [mm]&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;text-align: left;&amp;quot;|&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;r = a&amp;lt;/math&amp;gt;&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;r = b&amp;lt;/math&amp;gt;&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;r = a&amp;lt;/math&amp;gt;&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;r = b&amp;lt;/math&amp;gt;&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;text-align: left;&amp;quot;| Current&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 0.24000*&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 0.14380*&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 0.23660*&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 0.14021*&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 153.49**&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;text-align: left;&amp;quot;| FEM&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 0.24000&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 0.14380&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 0.23677&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 0.14022&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 153.48**&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;text-align: left;&amp;quot;| Analytical&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 0.24000***&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 0.14334&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 0.23620&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 0.13976&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 152.57&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;linearly-hardening-plastic-yielding-of-an-internally-pressurized-thick-walled-cylinder&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Linearly-hardening-plastic yielding of an internally pressurized thick-walled cylinder ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;fig: eg result lin&amp;quot; class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:sR_all_lin|image]] [[File:sH_all_lin|image]]&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:sZ_all_lin|image]] [[File:sVM_all_lin|image]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;fig: u vs fem lin&amp;quot; class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:u_lin]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;fig: sr vs fem lin&amp;quot; class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:sR_lin]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;fig: sh vs fem lin&amp;quot; class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:sH_lin]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;fig: sz vs fem lin&amp;quot; class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:sZ_lin]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;fig: vms vs fem lin&amp;quot; class=&amp;quot;figure&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:sVM_lin]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;tb: res linear&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Results of the linear-hardening plastic case - von Mises stress, and displacement magnitude at inner and outer surfaces, and position of the elastic-plastic interface. Under “current” results we present the highest density discretization with 25 load steps vs FEM. *Average for all nodes on the edge. **Determined by fitting lines through points that are in the plastic zone (&amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\varepsilon^p &amp;gt; 0&amp;lt;/math&amp;gt;), and points that are outside it (&amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\varepsilon^p = 0&amp;lt;/math&amp;gt;), and finding the intersection between the two fits.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;text-align: left;&amp;quot;|&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;text-align: center;&amp;quot;| &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;\sigma_{VM}&amp;lt;/math&amp;gt; [GPa]&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; style=&amp;quot;text-align: center;&amp;quot;| &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;|\mathbf{u}|&amp;lt;/math&amp;gt; [mm]&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;c&amp;lt;/math&amp;gt; [mm]&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;text-align: left;&amp;quot;|&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;r = a&amp;lt;/math&amp;gt;&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;r = b&amp;lt;/math&amp;gt;&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;r = a&amp;lt;/math&amp;gt;&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| &amp;lt;math display=&amp;quot;inline&amp;quot;&amp;gt;r = b&amp;lt;/math&amp;gt;&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;text-align: left;&amp;quot;| Current&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 0.25589*&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 0.13635*&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 0.22212*&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 0.13295*&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 149.42**&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;text-align: left;&amp;quot;| FEM&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 0.25592&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 0.13634&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 0.22224&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 0.13294&lt;br /&gt;
| style=&amp;quot;text-align: center;&amp;quot;| 149.40**&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;sec:benchmark&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Benchmark problem =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;conclusions&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
= Conclusions =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;refs&amp;quot; class=&amp;quot;references csl-bib-body hanging-indent&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;ref-amouzou2021&amp;quot; class=&amp;quot;csl-entry&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Amouzou, Gildas Yaovi, and Azzeddine Soulaïmani. 2021. &amp;lt;span&amp;gt;“Numerical Algorithms for Elastoplacity: Finite Elements Code Development and Implementation of the Mohr–Coulomb Law.”&amp;lt;/span&amp;gt; ''Applied Sciences'' 11 (10). https://doi.org/10.3390/app11104637.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;ref-Bartels2012QuasiStaticSP&amp;quot; class=&amp;quot;csl-entry&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bartels, Sören, Alexander Mielke, and Tomáš Roubíček. 2012. &amp;lt;span&amp;gt;“Quasi-Static Small-Strain Plasticity in the Limit of Vanishing Hardening and Its Numerical Approximation.”&amp;lt;/span&amp;gt; ''SIAM J. Numer. Anal.'' 50: 951–76.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;ref-bayona2017role&amp;quot; class=&amp;quot;csl-entry&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bayona, Victor, Natasha Flyer, Bengt Fornberg, and Gregory A Barnett. 2017. &amp;lt;span&amp;gt;“On the Role of Polynomials in RBF-FD Approximations: II. Numerical Solution of Elliptic PDEs.”&amp;lt;/span&amp;gt; ''Journal of Computational Physics'' 332: 257–73.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;ref-bayona2019insight&amp;quot; class=&amp;quot;csl-entry&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bayona, Vı́ctor. 2019. &amp;lt;span&amp;gt;“An Insight into RBF-FD Approximations Augmented with Polynomials.”&amp;lt;/span&amp;gt; ''Computers &amp;amp;amp; Mathematics with Applications'' 77 (9): 2337–53.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;ref-belytschko1996meshless&amp;quot; class=&amp;quot;csl-entry&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Belytschko, Ted, Yury Krongauz, Daniel Organ, Mark Fleming, and Petr Krysl. 1996. &amp;lt;span&amp;gt;“Meshless Methods: An Overview and Recent Developments.”&amp;lt;/span&amp;gt; ''Computer Methods in Applied Mechanics and Engineering'' 139 (1-4): 3–47.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;ref-chakrabarty1987&amp;quot; class=&amp;quot;csl-entry&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Chakrabarty, J. 1987. ''Theory of Plasticity''. McGraw-Hill International Editions. Engineering Mechanics Series. McGraw-Hill.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;ref-davydov2011adaptive&amp;quot; class=&amp;quot;csl-entry&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Davydov, Oleg, and Dang Thi Oanh. 2011. &amp;lt;span&amp;gt;“Adaptive Meshless Centres and RBF Stencils for Poisson Equation.”&amp;lt;/span&amp;gt; ''Journal of Computational Physics'' 230 (2): 287–304.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;ref-davydov2022improved&amp;quot; class=&amp;quot;csl-entry&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Davydov, Oleg, Dang Thi Oanh, and Ngo Manh Tuong. 2022. &amp;lt;span&amp;gt;“Improved Stencil Selection for Meshless Finite Difference Methods in 3d.”&amp;lt;/span&amp;gt; ''arXiv Preprint arXiv:2202.06426''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;ref-depolli2022parallel&amp;quot; class=&amp;quot;csl-entry&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Depolli, Matjaž, Jure Slak, and Gregor Kosec. 2022. &amp;lt;span&amp;gt;“Parallel Domain Discretization Algorithm for RBF-FD and Other Meshless Numerical Methods for Solving PDEs.”&amp;lt;/span&amp;gt; ''Computers &amp;amp;amp; Structures'' 264: 106773.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;ref-Depolli2019&amp;quot; class=&amp;quot;csl-entry&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Depolli, Matjaž, and Roman Trobec. 2019. &amp;lt;span&amp;gt;“Computational Efficiency of Linear System Construction for MLPG Method on a Multicore Computer.”&amp;lt;/span&amp;gt; In ''2019 42nd International Convention on Information and Communication Technology, Electronics and Microelectronics (MIPRO)'', 200–205. https://doi.org/10.23919/MIPRO.2019.8757104.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;ref-duh2021fast&amp;quot; class=&amp;quot;csl-entry&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Duh, Urban, Gregor Kosec, and Jure Slak. 2021. &amp;lt;span&amp;gt;“Fast Variable Density Node Generation on Parametric Surfaces with Application to Mesh-Free Methods.”&amp;lt;/span&amp;gt; ''SIAM Journal on Scientific Computing'' 43 (2): A980–1000.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;ref-flyer2016role&amp;quot; class=&amp;quot;csl-entry&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Flyer, Natasha, Bengt Fornberg, Victor Bayona, and Gregory A Barnett. 2016a. &amp;lt;span&amp;gt;“On the Role of Polynomials in RBF-FD Approximations: I. Interpolation and Accuracy.”&amp;lt;/span&amp;gt; ''Journal of Computational Physics'' 321: 21–38.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;ref-flyer2016&amp;quot; class=&amp;quot;csl-entry&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Flyer, Natasha, Bengt Fornberg, Victor Bayona, and Gregory A. Barnett. 2016b. &amp;lt;span&amp;gt;“On the Role of Polynomials in RBF-FD Approximations: I. Interpolation and Accuracy.”&amp;lt;/span&amp;gt; ''Journal of Computational Physics'' 321: 21–38. https://doi.org/https://doi.org/10.1016/j.jcp.2016.05.026.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;ref-fung2001classical&amp;quot; class=&amp;quot;csl-entry&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fung, Y., and P. Tong. 2001. ''Classical and Computational Solid Mechanics''. Advanced Series in Engineering Science. World Scientific. https://books.google.si/books?id=hmyiIiiv4FUC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;ref-hill1998&amp;quot; class=&amp;quot;csl-entry&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hill, R. 1998. ''The Mathematical Theory of Plasticity''. Oxford Classic Texts in the Physical Sciences. Clarendon Press.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;ref-JANKOWSKA201812&amp;quot; class=&amp;quot;csl-entry&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Jankowska, Malgorzata A. 2018. &amp;lt;span&amp;gt;“On Elastoplastic Analysis of Some Plane Stress Problems with Meshless Methods and Successive Approximations Method.”&amp;lt;/span&amp;gt; ''Engineering Analysis with Boundary Elements'' 95: 12–24. https://doi.org/https://doi.org/10.1016/j.enganabound.2018.06.013.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;ref-jiang2021nonlinear&amp;quot; class=&amp;quot;csl-entry&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Jiang, Pengfei, Hui Zheng, Jingang Xiong, and Pihua Wen. 2021. &amp;lt;span&amp;gt;“Nonlinear Elastic-Plastic Analysis of Reinforced Concrete Column-Steel Beam Connection by RBF-FD Method.”&amp;lt;/span&amp;gt; ''Engineering Analysis with Boundary Elements'' 128: 188–94.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;ref-perko2007weight&amp;quot; class=&amp;quot;csl-entry&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perko, Janez, B Sarler, et al. 2007. &amp;lt;span&amp;gt;“Weight Function Shape Parameter Optimization in Meshless Methods for Non-Uniform Grids.”&amp;lt;/span&amp;gt; ''Computer Modeling in Engineering and Sciences'' 19 (1): 55.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;ref-Roostaei2018ACS&amp;quot; class=&amp;quot;csl-entry&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Roostaei, Ali A., and Hamid Jahed. 2018. &amp;lt;span&amp;gt;“A Cyclic Small-Strain Plasticity Model for Wrought Mg Alloys Under Multiaxial Loading: Numerical Implementation and Validation.”&amp;lt;/span&amp;gt; ''International Journal of Mechanical Sciences''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;ref-Schrder2015SmallSP&amp;quot; class=&amp;quot;csl-entry&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Schröder, Bettina, and Detlef Kuhl. 2015. &amp;lt;span&amp;gt;“Small Strain Plasticity: Classical Versus Multifield Formulation.”&amp;lt;/span&amp;gt; ''Archive of Applied Mechanics'' 85: 1127–45.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;ref-slak2019rbffd&amp;quot; class=&amp;quot;csl-entry&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Slak, Jure, and Gregor Kosec. 2019a. &amp;lt;span&amp;gt;“Adaptive Radial Basis Function-Generated Finite Differences Method for Contact Problems.”&amp;lt;/span&amp;gt; ''International Journal for Numerical Methods in Engineering'' 119 (7): 661–86. https://doi.org/https://doi.org/10.1002/nme.6067.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;ref-slak2019generation&amp;quot; class=&amp;quot;csl-entry&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
———. 2019b. &amp;lt;span&amp;gt;“On Generation of Node Distributions for Meshless PDE Discretizations.”&amp;lt;/span&amp;gt; ''SIAM Journal on Scientific Computing'' 41 (5): A3202–29. https://doi.org/10.1137/18M1231456.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;ref-slak2021medusa&amp;quot; class=&amp;quot;csl-entry&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
———. 2021. &amp;lt;span&amp;gt;“Medusa: A c++ Library for Solving Pdes Using Strong Form Mesh-Free Methods.”&amp;lt;/span&amp;gt; ''ACM Transactions on Mathematical Software (TOMS)'' 47 (3): 1–25.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;ref-desouza2008&amp;quot; class=&amp;quot;csl-entry&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Souza Neto, E. A. de, D. Peric, and D. R. J. Owen. 2008. ''Computational Methods for Plasticity: Theory and Applications''. Wiley.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;ref-wang2002optimal&amp;quot; class=&amp;quot;csl-entry&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Wang, JG, and GRs Liu. 2002. &amp;lt;span&amp;gt;“On the Optimal Shape Parameters of Radial Basis Functions Used for 2-d Meshless Methods.”&amp;lt;/span&amp;gt; ''Computer Methods in Applied Mechanics and Engineering'' 191 (23-24): 2611–30.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;ref-wendland2004scattered&amp;quot; class=&amp;quot;csl-entry&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Wendland, Holger. 2004. ''Scattered Data Approximation''. Vol. 17. Cambridge university press.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;ref-yarushina2010&amp;quot; class=&amp;quot;csl-entry&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Yarushina, V. M., M. Dabrowski, and Y. Y. Podladchikov. 2010. &amp;lt;span&amp;gt;“An Analytical Benchmark with Combined Pressure and Shear Loading for Elastoplastic Numerical Models.”&amp;lt;/span&amp;gt; ''Geochemistry, Geophysics, Geosystems'' 11 (8). https://doi.org/https://doi.org/10.1029/2010GC003130.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>E6WikiAdmin</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=Medusa&amp;diff=3549</id>
		<title>Medusa</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=Medusa&amp;diff=3549"/>
				<updated>2023-03-27T06:50:32Z</updated>
		
		<summary type="html">&lt;p&gt;E6WikiAdmin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!--__NOTITLE__--&amp;gt;&lt;br /&gt;
'''Welcome to the Medusa wiki. To visit the main website, go to [http://e6.ijs.si/medusa/ http://e6.ijs.si/medusa/].'''&lt;br /&gt;
&lt;br /&gt;
In [http://e6.ijs.si/ParallelAndDistributedSystems/ Parallel and Distributed Systems Laboratory] we are working on a C++ library that is first and foremost focused on tools for solving Partial Differential Equations by meshless methods. The basic idea is to create generic codes for tools that are needed for solving not only PDEs but many other problems, e.g. Moving Least Squares approximation, $k$-d tree, domain generation engines, etc.&lt;br /&gt;
We call this open source meshless project [http://e6.ijs.si/medusa/ Medusa: Coordinate Free Meshless Method implementation (MM)].&lt;br /&gt;
&lt;br /&gt;
Technical details about code and examples  can be found on our [http://e6.ijs.si/medusa/docs/ documentation page] and [https://gitlab.com/e62Lab/medusa Gitlab repository]. [[File:C.png|100px||link=https://gitlab.com/e62Lab/medusa|alt=Alt text|code]] [[File:doxygen.png|100px|link=http://e6.ijs.si/medusa/docs/|alt=Alt text|Documentation page]]&lt;br /&gt;
&lt;br /&gt;
This wiki site is meant for more relaxed discussions about general principles, possible and already implemented applications, preliminary analyses, etc.&lt;br /&gt;
Note, that there are many grammatical mistakes, typos, stupid sentences, etc. This wiki is meant for quick information exchange and therefore we do not invest a lot of energy into styling :).  &lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [https://gitlab.com/e62Lab/medusa Code on Gitlab]&lt;br /&gt;
* [[How to build | Installation and building]]&lt;br /&gt;
* [[Including this library in your project | Including this library in your project]]&lt;br /&gt;
* [[Testing | Running tests]]&lt;br /&gt;
* [http://e6.ijs.si/medusa/docs/ Technical documentation]&lt;br /&gt;
* [[Coding style | Coding style]]&lt;br /&gt;
* [[Wiki editing guide | Wiki editing and backup guide]]&lt;br /&gt;
&lt;br /&gt;
== Building blocks ==&lt;br /&gt;
Medusa is modular coordinate-free parallel implementation of a numerical framework designed, but not limited to, for solving PDEs. In this section we present main modules of the library that can be also used as a standalone tools. &lt;br /&gt;
* [[Positioning of computational nodes]] &lt;br /&gt;
* [[Relaxation of the nodal distribution]]&lt;br /&gt;
* [[Refinement of the nodal distribution]]&lt;br /&gt;
* [[k-d tree|''k''-d tree and other spatial search structures]] &lt;br /&gt;
* [[Solving system | Solving linear system - including over and underdetermined systems]]&lt;br /&gt;
* [[Weighted Least Squares (WLS)]]&lt;br /&gt;
* [[Computation of shape functions]]&lt;br /&gt;
* [[Radial basis function-generated finite differences (RBF-FD)]]&lt;br /&gt;
* [[Ghost nodes (theory)]]&lt;br /&gt;
* [[Integrators for time stepping]]&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
In this section we present exact examples. Each of the below solutions can be found also in in the repository under examples. More explanation about the physical background and solution procedure can be found in following sections.&lt;br /&gt;
* [[Philosophy of examples and how to run them]]&lt;br /&gt;
* [[Poisson's equation]]&lt;br /&gt;
* [[Heat equation]]&lt;br /&gt;
* [[Linear elasticity]]&lt;br /&gt;
* [[Complex-valued problems]]&lt;br /&gt;
* [[Coupled domains]]&lt;br /&gt;
* [[Parametric domains | Parametric domains &amp;amp;ndash; Curved surface with variable density]]&lt;br /&gt;
* [[NURBS domains | Domains modeled with non-uniform rational basis splines (NURBS)]]&lt;br /&gt;
* [[Determining the interior of the domain by oversampling the boundary]]&lt;br /&gt;
* [[Computer-aided design - Importing IGES and STEP files]]&lt;br /&gt;
* [[Realistic 3D models|Working with 3D surface mesh models ]]&lt;br /&gt;
* [[customization | Operator customization]]&lt;br /&gt;
* [[Ghost nodes]]&lt;br /&gt;
* [[Electromagnetic scattering]]&lt;br /&gt;
* [[Schrödinger equation]]&lt;br /&gt;
* [[Wave equation]]&lt;br /&gt;
* [[Cahn-Hilliard equation]]&lt;br /&gt;
* [[Fluid mechanics]]&lt;br /&gt;
* [[Solid Mechanics | Solid mechanics]]&lt;br /&gt;
&lt;br /&gt;
== Discussions / Applications ==&lt;br /&gt;
This section is meant for general discussion about the physical background of the examples, the solution procedures, various applications, etc. Note, that code snippets presented in discussion might not reflect the actual state of Medusa.  &lt;br /&gt;
* [[Convection Diffusion equation | Convection Diffusion equation]]&lt;br /&gt;
* [[Adaptivity|H-adaptivity]]&lt;br /&gt;
* [[Hp-adaptivity]]&lt;br /&gt;
* [[Solid Mechanics]]&lt;br /&gt;
** [[Point contact]]&lt;br /&gt;
** [[Hertzian contact]]&lt;br /&gt;
** [[Cantilever beam]]&lt;br /&gt;
** [[Fretting fatigue case]]&lt;br /&gt;
** [[Plasticity]]&lt;br /&gt;
* [[Fluid Mechanics]]&lt;br /&gt;
** [[Lid driven cavity]]&lt;br /&gt;
** [[de Vahl Davis natural convection test]]&lt;br /&gt;
** [[Natural convection in 3D irregular domain]]&lt;br /&gt;
** [[Natural convection from heated cylinder]]&lt;br /&gt;
** [[Natural convection between concentric cylinders]]&lt;br /&gt;
** [[Non-Newtonian fluid]]&lt;br /&gt;
* [[Computational electromagnetics]]&lt;br /&gt;
** [[Triple dielectric step in 1D]]&lt;br /&gt;
** [[Scattering from an infinite cylinder]]&lt;br /&gt;
** [[Point source near an anisotropic lens]]&lt;br /&gt;
* Other applications&lt;br /&gt;
** [[Attenuation due to liquid water content in the atmosphere|Attenuation of a satellite communication]]&lt;br /&gt;
** [[Heart rate variability detection]]&lt;br /&gt;
** [[Bioheat equation]]&lt;br /&gt;
&lt;br /&gt;
== Performance analyses ==&lt;br /&gt;
* [[Execution on Intel® Xeon Phi™ co-processor]]&lt;br /&gt;
* [[1D MLSM and FDM comparison]]&lt;br /&gt;
* [[:File:tech_report.pdf|Execution overheads due to clumsy types::technical report]] [[File:pdf-file.gif]]&lt;br /&gt;
* [[Solving sparse systems]]&lt;br /&gt;
* [[Eigen paralelization]]&lt;br /&gt;
&lt;br /&gt;
== Last changes ==&lt;br /&gt;
&amp;lt;news unique=1 limit = 5&amp;gt;&lt;br /&gt;
*{{{timeanddate}}} :: {{{title}}} &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/news&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Miscellaneous ==&lt;br /&gt;
* FAQ  - [[Frequently asked questions]]. &lt;br /&gt;
* [[List of wiki contributors]]&lt;br /&gt;
* List of library contributors: [http://e6.ijs.si/medusa/about#about-contributors See the official website]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
For all related papers including conference contributions, monographs and book chapters check https://e6.ijs.si/ParallelAndDistributedSystems/publications/&lt;br /&gt;
&lt;br /&gt;
{{Box-round|title= Selected papers |&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/98533123.pdf M. Depolli, J. Slak, G. Kosec; Parallel domain discretization algorithm for RBF-FD and other meshless numerical methods for solving PDEs, Computers &amp;amp; Structures, 2022 [DOI: 10.1016/j.compstruc.2022.106773]]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/69777155.pdf J. Slak, G. Kosec; Medusa : A C++ library for solving PDEs using strong form mesh-free methods, ACM transactions on mathematical software, vol. 47, 2021 [DOI: 10.1145/3450966]]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/56730115.pdf U. Duh, G. Kosec, J. Slak; Fast variable density node generation on parametric surfaces with application to mesh-free methods, SIAM journal on scientific computing, vol. 43, 2021 [DOI: 10.1137/20M1325642]]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/52715011.pdf M. Jančič, J. Slak, G. Kosec; Monomial augmentation guidelines for RBF-FD from accuracy versus computational time perspective, Journal of scientific computing, vol. 87, 2021 [DOI: 10.1007/s10915-020-01401-y]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/32782887.pdf J. Slak, G. Kosec; On generation of node distributions for meshless PDE discretizations, SIAM journal on scientific computing, vol. 41, 2019 [DOI: 10.1137/18M1231456]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/32424999.pdf G. Kosec, J. Slak, M. Depolli, R. Trobec, K. Pereira, S. Tomar, T. Jacquemin, S. Bordas, M. Wahab; Weak and strong from meshless methods for linear elastic problem under fretting contact conditions, Tribology international, vol. 138, 2019]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/32230439.pdf J. Slak, G. Kosec; Adaptive radial basis function-generated finite differences method for contact problems, International journal for numerical methods in engineering, vol. 119, 2019 [DOI: 10.1002/nme.6067]]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/32388135.pdf M. Maksić, V. Djurica, A. Souvent, J. Slak, M. Depolli, G. Kosec; Cooling of overhead power lines due to the natural convection, International journal of electrical power &amp;amp; energy systems, 2019]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/31107623.pdf J. Slak, G. Kosec; Refined meshless local strong form solution of Cauchy-Navier equation on an irregular domain, Engineering analysis with boundary elements, vol. 100, 2019]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/29639719.pdf M. Depolli, G. Kosec; Assessment of differential evolution for multi-objective optimization in a natural convection problem solved by a local meshless method, Engineering optimization, 2017, vol. 49, no. 4, pp. 675-692]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/29512743.pdf G. Kosec; A local numerical solution of a fluid-flow problem on an irregular domain, Advances in engineering software, vol. 120, 2018 [DOI: 10.1016/j.advengsoft.2016.05.010]]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/27912487.pdf G. Kosec, R. Trobec; Simulation of semiconductor devices with a local numerical approach, Engineering analysis with boundary elements, 2015 [DOI: 10.1016/j.enganabound.2014.07.013]]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/3218939.pdf G. Kosec, B. Šarler; Simulation of macrosegregation with mesosegregates in binary metallic casts by a meshless method, Engineering analysis with boundary elements]&lt;br /&gt;
&lt;br /&gt;
[http://comms.ijs.si/~gkosec/data/papers/27339815.pdf G. Kosec, M. Depolli, A. Rashkovska, R. Trobec; Super linear speedup in a local parallel meshless solution of thermo-fluid problem, Computers &amp;amp; Structures, vol. 133, 2014]&lt;br /&gt;
&lt;br /&gt;
[http://comms.ijs.si/~gkosec/data/papers/26785063.pdf G. Kosec, P. Zinterhof; Local strong form meshless method on multiple Graphics Processing Units, Computer modeling in engineering &amp;amp; sciences, vol. 91, 2013]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/2599419.pdf G. Kosec, B. Šarler; Solution of a low Prandtl number natural convection benchmark by a local meshless method, International journal of numerical methods for heat &amp;amp; fluid flow]&lt;br /&gt;
&lt;br /&gt;
[http://comms.ijs.si/~gkosec/data/papers/EABE2499.pdf R. Trobec, G. Kosec, M. Šterk, B. Šarler; Comparison of local weak and strong form meshless methods for 2-D diffusion equation, Engineering analysis with boundary elements, vol. 36, 2012]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/1905659.pdf G. Kosec, M. Založnik, B. Šarler, H. Combeau; A meshless approach towards solution of macrosegregation phenomena, Computers, materials &amp;amp; continua : CMC, vol. 22, 2011 ]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/992507.pdf G. Kosec, B. Šarler; Solution of thermo-fluid problems by collocation with local pressure correction, International journal of numerical methods for heat &amp;amp; fluid flow, vol.18, 2008]&lt;br /&gt;
&lt;br /&gt;
R. Trobec, G. Kosec; Parallel scientific computing : theory, algorithms, and applications of mesh based and meshless methods, 2015&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Related pages==&lt;br /&gt;
* http://e6.ijs.si/ParallelAndDistributedSystems/products/medusa/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[test]]&lt;/div&gt;</summary>
		<author><name>E6WikiAdmin</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=Medusa&amp;diff=3548</id>
		<title>Medusa</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=Medusa&amp;diff=3548"/>
				<updated>2023-03-27T06:50:13Z</updated>
		
		<summary type="html">&lt;p&gt;E6WikiAdmin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!--__NOTITLE__--&amp;gt;&lt;br /&gt;
'''Welcome to the Medusa wiki. To visit the main website, go to [http://e6.ijs.si/medusa/ http://e6.ijs.si/medusa/].'''&lt;br /&gt;
&lt;br /&gt;
In [http://e6.ijs.si/ParallelAndDistributedSystems/ Parallel and Distributed Systems Laboratory] we are working on a C++ library that is first and foremost focused on tools for solving Partial Differential Equations by meshless methods. The basic idea is to create generic codes for tools that are needed for solving not only PDEs but many other problems, e.g. Moving Least Squares approximation, $k$-d tree, domain generation engines, etc.&lt;br /&gt;
We call this open source meshless project [http://e6.ijs.si/medusa/ Medusa: Coordinate Free Meshless Method implementation (MM)].&lt;br /&gt;
&lt;br /&gt;
Technical details about code and examples  can be found on our [http://e6.ijs.si/medusa/docs/ documentation page] and [https://gitlab.com/e62Lab/medusa Gitlab repository]. [[File:C.png|100px||link=https://gitlab.com/e62Lab/medusa|alt=Alt text|code]] [[File:doxygen.png|100px|link=http://e6.ijs.si/medusa/docs/|alt=Alt text|Documentation page]]&lt;br /&gt;
&lt;br /&gt;
This wiki site is meant for more relaxed discussions about general principles, possible and already implemented applications, preliminary analyses, etc.&lt;br /&gt;
Note, that there are many grammatical mistakes, typos, stupid sentences, etc. This wiki is meant for quick information exchange and therefore we do not invest a lot of energy into styling :).  &lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [https://gitlab.com/e62Lab/medusa Code on Gitlab]&lt;br /&gt;
* [[How to build | Installation and building]]&lt;br /&gt;
* [[Including this library in your project | Including this library in your project]]&lt;br /&gt;
* [[Testing | Running tests]]&lt;br /&gt;
* [http://e6.ijs.si/medusa/docs/ Technical documentation]&lt;br /&gt;
* [[Coding style | Coding style]]&lt;br /&gt;
* [[Wiki editing guide | Wiki editing and backup guide]]&lt;br /&gt;
&lt;br /&gt;
== Building blocks ==&lt;br /&gt;
Medusa is modular coordinate-free parallel implementation of a numerical framework designed, but not limited to, for solving PDEs. In this section we present main modules of the library that can be also used as a standalone tools. &lt;br /&gt;
* [[Positioning of computational nodes]] &lt;br /&gt;
* [[Relaxation of the nodal distribution]]&lt;br /&gt;
* [[Refinement of the nodal distribution]]&lt;br /&gt;
* [[k-d tree|''k''-d tree and other spatial search structures]] &lt;br /&gt;
* [[Solving system | Solving linear system - including over and underdetermined systems]]&lt;br /&gt;
* [[Weighted Least Squares (WLS)]]&lt;br /&gt;
* [[Computation of shape functions]]&lt;br /&gt;
* [[Radial basis function-generated finite differences (RBF-FD)]]&lt;br /&gt;
* [[Ghost nodes (theory)]]&lt;br /&gt;
* [[Integrators for time stepping]]&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
In this section we present exact examples. Each of the below solutions can be found also in in the repository under examples. More explanation about the physical background and solution procedure can be found in following sections.&lt;br /&gt;
* [[Philosophy of examples and how to run them]]&lt;br /&gt;
* [[Poisson's equation]]&lt;br /&gt;
* [[Heat equation]]&lt;br /&gt;
* [[Linear elasticity]]&lt;br /&gt;
* [[Complex-valued problems]]&lt;br /&gt;
* [[Coupled domains]]&lt;br /&gt;
* [[Parametric domains | Parametric domains &amp;amp;ndash; Curved surface with variable density]]&lt;br /&gt;
* [[NURBS domains | Domains modeled with non-uniform rational basis splines (NURBS)]]&lt;br /&gt;
* [[Determining the interior of the domain by oversampling the boundary]]&lt;br /&gt;
* [[Computer-aided design - Importing IGES and STEP files]]&lt;br /&gt;
* [[Realistic 3D models|Working with 3D surface mesh models ]]&lt;br /&gt;
* [[customization | Operator customization]]&lt;br /&gt;
* [[Ghost nodes]]&lt;br /&gt;
* [[Electromagnetic scattering]]&lt;br /&gt;
* [[Schrödinger equation]]&lt;br /&gt;
* [[Wave equation]]&lt;br /&gt;
* [[Cahn-Hilliard equation]]&lt;br /&gt;
* [[Fluid mechanics]]&lt;br /&gt;
* [[Solid Mechanics | Solid mechanics]]&lt;br /&gt;
&lt;br /&gt;
== Discussions / Applications ==&lt;br /&gt;
This section is meant for general discussion about the physical background of the examples, the solution procedures, various applications, etc. Note, that code snippets presented in discussion might not reflect the actual state of Medusa.  &lt;br /&gt;
* [[Convection Diffusion equation | Convection Diffusion equation]]&lt;br /&gt;
* [[Adaptivity|H-adaptivity]]&lt;br /&gt;
* [[Hp-adaptivity]]&lt;br /&gt;
* [[Solid Mechanics]]&lt;br /&gt;
** [[Point contact]]&lt;br /&gt;
** [[Hertzian contact]]&lt;br /&gt;
** [[Cantilever beam]]&lt;br /&gt;
** [[Fretting fatigue case]]&lt;br /&gt;
** [[Plasticity]]&lt;br /&gt;
* [[Fluid Mechanics]]&lt;br /&gt;
** [[Lid driven cavity]]&lt;br /&gt;
** [[de Vahl Davis natural convection test]]&lt;br /&gt;
** [[Natural convection in 3D irregular domain]]&lt;br /&gt;
** [[Natural convection from heated cylinder]]&lt;br /&gt;
** [[Natural convection between concentric cylinders]]&lt;br /&gt;
** [[Non-Newtonian fluid]]&lt;br /&gt;
* [[Computational electromagnetics]]&lt;br /&gt;
** [[Triple dielectric step in 1D]]&lt;br /&gt;
** [[Scattering from an infinite cylinder]]&lt;br /&gt;
** [[Point source near an anisotropic lens]]&lt;br /&gt;
* Other applications&lt;br /&gt;
** [[Attenuation due to liquid water content in the atmosphere|Attenuation of a satellite communication]]&lt;br /&gt;
** [[Heart rate variability detection]]&lt;br /&gt;
** [[Bioheat equation]]&lt;br /&gt;
&lt;br /&gt;
== Performance analyses ==&lt;br /&gt;
* [[Execution on Intel® Xeon Phi™ co-processor]]&lt;br /&gt;
* [[1D MLSM and FDM comparison]]&lt;br /&gt;
* [[:File:tech_report.pdf|Execution overheads due to clumsy types::technical report]] [[File:pdf-file.gif]]&lt;br /&gt;
* [[Solving sparse systems]]&lt;br /&gt;
* [[Eigen paralelization]]&lt;br /&gt;
&lt;br /&gt;
== Last changes ==&lt;br /&gt;
&amp;lt;news unique=1 limit = 5&amp;gt;&lt;br /&gt;
*{{{timeanddate}}} :: {{{title}}} &lt;br /&gt;
&lt;br /&gt;
&amp;lt;/news&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Miscellaneous ==&lt;br /&gt;
* FAQ  - [[Frequently asked questions]]. &lt;br /&gt;
* [[List of wiki contributors]]&lt;br /&gt;
* List of library contributors: [http://e6.ijs.si/medusa/about#about-contributors See the official website]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
For all related papers including conference contributions, monographs and book chapters check https://e6.ijs.si/ParallelAndDistributedSystems/publications/&lt;br /&gt;
&lt;br /&gt;
{{Box-round|title= Selected papers |&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/98533123.pdf M. Depolli, J. Slak, G. Kosec; Parallel domain discretization algorithm for RBF-FD and other meshless numerical methods for solving PDEs, Computers &amp;amp; Structures, 2022 [DOI: 10.1016/j.compstruc.2022.106773]]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/69777155.pdf J. Slak, G. Kosec; Medusa : A C++ library for solving PDEs using strong form mesh-free methods, ACM transactions on mathematical software, vol. 47, 2021 [DOI: 10.1145/3450966]]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/56730115.pdf U. Duh, G. Kosec, J. Slak; Fast variable density node generation on parametric surfaces with application to mesh-free methods, SIAM journal on scientific computing, vol. 43, 2021 [DOI: 10.1137/20M1325642]]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/52715011.pdf M. Jančič, J. Slak, G. Kosec; Monomial augmentation guidelines for RBF-FD from accuracy versus computational time perspective, Journal of scientific computing, vol. 87, 2021 [DOI: 10.1007/s10915-020-01401-y]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/32782887.pdf J. Slak, G. Kosec; On generation of node distributions for meshless PDE discretizations, SIAM journal on scientific computing, vol. 41, 2019 [DOI: 10.1137/18M1231456]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/32424999.pdf G. Kosec, J. Slak, M. Depolli, R. Trobec, K. Pereira, S. Tomar, T. Jacquemin, S. Bordas, M. Wahab; Weak and strong from meshless methods for linear elastic problem under fretting contact conditions, Tribology international, vol. 138, 2019]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/32230439.pdf J. Slak, G. Kosec; Adaptive radial basis function-generated finite differences method for contact problems, International journal for numerical methods in engineering, vol. 119, 2019 [DOI: 10.1002/nme.6067]]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/32388135.pdf M. Maksić, V. Djurica, A. Souvent, J. Slak, M. Depolli, G. Kosec; Cooling of overhead power lines due to the natural convection, International journal of electrical power &amp;amp; energy systems, 2019]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/31107623.pdf J. Slak, G. Kosec; Refined meshless local strong form solution of Cauchy-Navier equation on an irregular domain, Engineering analysis with boundary elements, vol. 100, 2019]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/29639719.pdf M. Depolli, G. Kosec; Assessment of differential evolution for multi-objective optimization in a natural convection problem solved by a local meshless method, Engineering optimization, 2017, vol. 49, no. 4, pp. 675-692]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/29512743.pdf G. Kosec; A local numerical solution of a fluid-flow problem on an irregular domain, Advances in engineering software, vol. 120, 2018 [DOI: 10.1016/j.advengsoft.2016.05.010]]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/27912487.pdf G. Kosec, R. Trobec; Simulation of semiconductor devices with a local numerical approach, Engineering analysis with boundary elements, 2015 [DOI: 10.1016/j.enganabound.2014.07.013]]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/3218939.pdf G. Kosec, B. Šarler; Simulation of macrosegregation with mesosegregates in binary metallic casts by a meshless method, Engineering analysis with boundary elements]&lt;br /&gt;
&lt;br /&gt;
[http://comms.ijs.si/~gkosec/data/papers/27339815.pdf G. Kosec, M. Depolli, A. Rashkovska, R. Trobec; Super linear speedup in a local parallel meshless solution of thermo-fluid problem, Computers &amp;amp; Structures, vol. 133, 2014]&lt;br /&gt;
&lt;br /&gt;
[http://comms.ijs.si/~gkosec/data/papers/26785063.pdf G. Kosec, P. Zinterhof; Local strong form meshless method on multiple Graphics Processing Units, Computer modeling in engineering &amp;amp; sciences, vol. 91, 2013]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/2599419.pdf G. Kosec, B. Šarler; Solution of a low Prandtl number natural convection benchmark by a local meshless method, International journal of numerical methods for heat &amp;amp; fluid flow]&lt;br /&gt;
&lt;br /&gt;
[http://comms.ijs.si/~gkosec/data/papers/EABE2499.pdf R. Trobec, G. Kosec, M. Šterk, B. Šarler; Comparison of local weak and strong form meshless methods for 2-D diffusion equation, Engineering analysis with boundary elements, vol. 36, 2012]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/1905659.pdf G. Kosec, M. Založnik, B. Šarler, H. Combeau; A meshless approach towards solution of macrosegregation phenomena, Computers, materials &amp;amp; continua : CMC, vol. 22, 2011 ]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/992507.pdf G. Kosec, B. Šarler; Solution of thermo-fluid problems by collocation with local pressure correction, International journal of numerical methods for heat &amp;amp; fluid flow, vol.18, 2008]&lt;br /&gt;
&lt;br /&gt;
R. Trobec, G. Kosec; Parallel scientific computing : theory, algorithms, and applications of mesh based and meshless methods, 2015&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Related pages==&lt;br /&gt;
* http://e6.ijs.si/ParallelAndDistributedSystems/products/medusa/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[test]&lt;/div&gt;</summary>
		<author><name>E6WikiAdmin</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=Fretting_fatigue_case&amp;diff=3534</id>
		<title>Fretting fatigue case</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=Fretting_fatigue_case&amp;diff=3534"/>
				<updated>2022-12-05T16:36:08Z</updated>
		
		<summary type="html">&lt;p&gt;E6WikiAdmin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Box-round|title= Related papers |&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/32424999.pdf G. Kosec, J. Slak, M. Depolli, R. Trobec, K. Pereira, S. Tomar, T. Jacquemin, S. Bordas, M. Wahab; Weak and strong from meshless methods for linear elastic problem under fretting contact conditions, Tribology international, vol. 138, 2019]&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/32230439.pdf J. Slak, G. Kosec; Adaptive radial basis function-generated finite differences method for contact problems, International journal for numerical methods in engineering, vol. 119, 2019 [DOI: 10.1002/nme.6067]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Click on [[Solid Mechanics]] to go back.&lt;br /&gt;
&lt;br /&gt;
= Theoretical introdution =&lt;br /&gt;
This case is an extension of the classical Hertzian contact, as defined in Pereira et al. (2016) &amp;lt;ref name=Pereira&amp;gt; K. Pereira et al., On the convergence of stresses in fretting fatigue, Materials&lt;br /&gt;
9(8) (2016), doi:10.3390/ma9080639&amp;lt;/ref&amp;gt; and described in detail in Hojjati-Talemi et al. (2014) &amp;lt;ref&amp;gt;R. Hojjati-Talemi, M. A. Wahab in dr., Prediction of fretting fatigue crack&lt;br /&gt;
initiation and propagation lifetime for cylindrical contact configuration, Tribol. Int. 76 (2014) 73–91, doi:10.1016/j.triboint.2014.02.017. &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is considered within the [http://e6.ijs.si/ParallelAndDistributedSystems/FWO/#home ''' Multi-analysis of fretting fatigue using physical and virtual experiments '''] project&lt;br /&gt;
== Contact of cylinders under partial slip ==&lt;br /&gt;
&lt;br /&gt;
This extends the classical theory of [[Hertzian contact]] with a tangential force $Q$. When the tangential force is less than the limiting force of friction, i.e., \[|Q| &amp;lt; \mu P,\] where $\mu$ is the coefficent of friction, sliding motion will not occur but the contact will be divided into regions of slip and stick zones that are unknown ''a priori''. For the case of cylinders the analysis is given in Hills &amp;amp; Nowell (1994), p. 44.&lt;br /&gt;
&lt;br /&gt;
Besides the normal traction $p(x)$ we know have an additional shear traction given by&lt;br /&gt;
\begin{equation}&lt;br /&gt;
q(x) = \begin{cases}&lt;br /&gt;
-\mu p_0 \sqrt{1 - \frac{x^2}{b^2}}, &amp;amp; c \leq |x| \leq b \\&lt;br /&gt;
-\mu p_0 \left(\sqrt{1 - \frac{x^2}{b^2}} - \frac{c}{b}\sqrt{1 - \frac{x^2}{c^2}}\right), &amp;amp; |x| &amp;lt; c&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{equation}&lt;br /&gt;
where $b$ is the half-width of the whole contact, and $c$ the half-width of the central sticking region. The width of the central zone, i.e. the value of dimension $c$ is dependent on the applied tangential force $Q$:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
\frac{c}{b} = \sqrt{1 - \frac{Q}{\mu P}}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
The distributions $q(x)$ and $p(x)$ as well as the widths of the stick and slip zones can be seen in the image below.&lt;br /&gt;
[[File:Screenshot_2016-11-17_10-43-18.png|400px]]&lt;br /&gt;
&lt;br /&gt;
== The effect of bulk stress ==&lt;br /&gt;
&lt;br /&gt;
Additionally we might be interested in the addition of bulk stress $\sigma_{\textrm{ax}}$. This type of stress occurs in fretting fatique experiments like the one shown below &amp;lt;ref name=Pereira&amp;gt;&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot_20171003_082633.png|800px]]&lt;br /&gt;
&lt;br /&gt;
The previous solution for contact of cylinders under partial slip can be adjusted for the presence of bulk stresses $\sigma_\mathrm{ax}$. These cause an eccentricity $e$ to the solution given above. The shear traction $q(x)$ can be written as:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
q(x) = \begin{cases}&lt;br /&gt;
-\mu p_0 \sqrt{1 - \frac{x^2}{b^2}}, \quad c \leq | x - e | \text{ and } |x| \leq b \\&lt;br /&gt;
-\mu p_0 \left[\sqrt{1 - \frac{x^2}{b^2}} - \frac{c}{b}\sqrt{1 - \frac{(x-e)^2}{c^2}}\right], \quad |x-e| &amp;lt; c&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{equation}&lt;br /&gt;
where once again \[ \frac{c}{b} = \sqrt{1 - \frac{Q}{\mu F}}\] and&lt;br /&gt;
\begin{equation}&lt;br /&gt;
e = \frac{b \sigma_\mathrm{ax}}{4 \mu p_0}.&lt;br /&gt;
\end{equation}&lt;br /&gt;
If larger values of $\sigma_\mathrm{ax}$ are applied, one edge of the stick zone will approach the edge of the contact ($e$ becomes larger). The solution for the shear stress traction is therefore only valid if $e + c \leq b$, i. e.&lt;br /&gt;
\[\frac{\sigma_\mathrm{ax}}{\mu p_0} \leq 4\left(1 - \sqrt{1 - \frac{Q}{\mu F}}\right).\]&lt;br /&gt;
&lt;br /&gt;
= MLSM numerical solution for FWO case =&lt;br /&gt;
&lt;br /&gt;
We replicate the numerical solution described in Pereira et al. (2016) &amp;lt;ref name=&amp;quot;Pereira&amp;quot;&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Case definition ==&lt;br /&gt;
&lt;br /&gt;
We are solving the equation $$(\lambda + \mu) \nabla (\nabla \cdot \b{u}) + \mu \nabla^2 \b{u} = 0$$&lt;br /&gt;
on the domain $D = [-L/2, L/2] \times [-W/2, 0]$. Componentwise $\b{u} = [u; v]$.&lt;br /&gt;
The boundary conditions are:&lt;br /&gt;
* top: $\vec{t}(x) = (q(x), -p(x))$ or componentwise $\mu \frac{\partial u}{\partial y}(x, 0) + \mu \frac{\partial v}{\partial x}(x, 0) = q(x)$ and $(2 \mu+\lambda) \frac{\partial u}{\partial x}(x, 0) + \lambda \frac{\partial v}{\partial y}(x, 0) = -p(x)$ .&lt;br /&gt;
* left: $\b{u} = 0$ or componentwise $u(-L/2, y) = v(-L/2, y) = 0$.&lt;br /&gt;
* bottom: up-down symmetry conditions: componentwise $\frac{\partial u}{\partial y}(x, -W/2) = 0, v(x, -W/2) = 0$.&lt;br /&gt;
* right: this part has traction $\sigma_{ax}$, ie. $\vec{t}(y) = \sigma_{ax}\vec{\imath}$ or componentwise $(2 \mu+\lambda) \frac{\partial v}{\partial y}(L/2, y) + \lambda \frac{\partial u}{\partial x}(L/2, y) = 0$ and $\mu \frac{\partial u}{\partial y}(L/2, y) + \mu \frac{\partial v}{\partial x}(L/2, y) = \sigma_{ax}$.&lt;br /&gt;
&lt;br /&gt;
Illustration of the computational domain is presented below.&lt;br /&gt;
&lt;br /&gt;
[[File:fwo_bc.png|800px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- [[File:Screenshot_20171003_083231.png|800px]] --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Phsyical parameters ==&lt;br /&gt;
Basic parameters are:&lt;br /&gt;
* $E = \unit{72.1}{GPa}$, Youngs modulus&lt;br /&gt;
* $\nu = 0.33$, Poissons ratio&lt;br /&gt;
* $L = \unit{40}{mm}$, length of the pad&lt;br /&gt;
* $W = \unit{10}{mm}$, width of the pad&lt;br /&gt;
* $t = \unit{4}{mm}$, thickness of the pad&lt;br /&gt;
* $\sigma_{ax} = \unit{100}{MPa}$, axial pressure&lt;br /&gt;
* $F = \unit{543}{N}$, normal force&lt;br /&gt;
* $Q = \unit{155}{N}$, tangential force&lt;br /&gt;
* $R = \unit{10}{mm}$ or $\unit{50}{mm}$, raduis of curvature of the cylindrical pad&lt;br /&gt;
* $COF = \mu = 0.3$ or $0.85$ or $2$, coefficient of friction&lt;br /&gt;
&lt;br /&gt;
Derived parameters are, for choice of $R = \unit{10}{mm}$ and $\mu = 0.3$:&lt;br /&gt;
* $E^\ast = \frac{E}{2(1-\nu^2)} = \unit{40.4}{GPa}$, combined Young's modulus&lt;br /&gt;
* $p_{max} = p_0 = \sqrt{\frac{FE^\ast}{t R \pi}} = \unit{418.10407}{MPa}$, maximal normal pressure&lt;br /&gt;
* $a = 2 \sqrt{\frac{FR}{t E^\ast \pi}} = \unit{0.2067}{mm}$, semi contact width, contact region is $[-a, a] \times \{0\}$&lt;br /&gt;
* $c = a \sqrt{1 - \frac{Q}{\mu F}} = \unit{0.04504}{mm}$, stick zone semi width&lt;br /&gt;
* $e = \frac{a \sigma_{ax}}{4 \mu p_{max}} = \unit{0.041197}{mm}$, eccentricity due to axial load&lt;br /&gt;
&lt;br /&gt;
== Numerical solution ==&lt;br /&gt;
&lt;br /&gt;
Comparison of this solution against FEM solution published in Pereira et al. (2016) is presented below.&lt;br /&gt;
&lt;br /&gt;
[[File:fwo_cases1.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Meshes for this plot: [[:File:fwo_meshes.zip]]&lt;br /&gt;
&lt;br /&gt;
Data for this plot: [[:File:fwo_cases_plotdata.mat]]&lt;br /&gt;
&lt;br /&gt;
Script for this plot: [[:File:plot_fwo_cases.m]]&lt;br /&gt;
&lt;br /&gt;
For faster testing, smaller meshes and corresponding solutions are presented below:&lt;br /&gt;
&lt;br /&gt;
[[File:fwo_cases_small_mesh.png|800px]]&lt;br /&gt;
&lt;br /&gt;
Meshes for this plot: [[:File:fwo_small_meshes.zip]]&lt;br /&gt;
&lt;br /&gt;
Data for this plot: [[:File:fwo_cases_small_mesh_plodata.mat]]&lt;br /&gt;
&lt;br /&gt;
Script is the same as above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A contour plot of von Mises stress in the specimen for the case $\mu = 0.65, R = 50$ is presented below. Countour plots for all cases look similar.&lt;br /&gt;
&lt;br /&gt;
[[File:fwo_solution.png|600px]]&lt;br /&gt;
&lt;br /&gt;
Note that contour of stress are similar to the ones in Hertzian contact above, but a significant concentracion of stresses under the contact area is present.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;/div&gt;</summary>
		<author><name>E6WikiAdmin</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=Wave_equation&amp;diff=3533</id>
		<title>Wave equation</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=Wave_equation&amp;diff=3533"/>
				<updated>2022-12-04T19:50:55Z</updated>
		
		<summary type="html">&lt;p&gt;E6WikiAdmin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Box-round|title= Related papers |&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/62417923.pdf J. Močnik Berljavac, P. Mishra, J. Slak, G. Kosec; RBF-FD analysis of 2D time-domain acoustic wave propagation in heterogeneous media, Computers &amp;amp; Geosciences, 2021 [DOI: 10.1016/j.cageo.2021.104796]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== 2D wave equation with Dirichlet boundary conditions ==&lt;br /&gt;
We are solving a problem analogous to a clamped circular membrane being forced to oscillate by fixing its centre to a rigid oscillating rod.  The domain of calculation is for this reason an annulus bounded by the point of contact with the circular source in the centre and the clamped edge of the circular membrane.&lt;br /&gt;
&lt;br /&gt;
[[File:wave_2d_domain_geo.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
Consider the time dependent solution to 2D wave equation on annulus shaped domain&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
    	\frac{ \partial^2 u}{\partial t^2} &amp;amp;= c^2 \nabla^2 u  &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
         u(r,t=0)&amp;amp;=0 &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
    	  u &amp;amp;= 0           &amp;amp;&amp;amp;\text{on } \partial \Omega_O,\\&lt;br /&gt;
          u &amp;amp;= f(t)           &amp;amp;&amp;amp;\text{on } \partial \Omega_I,&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where $\partial\Omega_I$ denotes the inner and $\partial\Omega_O$ the outer boundary of the domain. Through the  boundary condition on the inner boundary the source is introduced to the problem as a function of time&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
f(t)= u_o \sin \omega_o t.&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First the domain is constructed by subtracting a smaller circle domain from a larger one. Boundaries of the domain are populated in the same step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// // identifier to be added to nodes on the inner boundary&lt;br /&gt;
int CENTRE = -10;&lt;br /&gt;
&lt;br /&gt;
 // build circle domain&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; domain({0, 0}, outer_radius);&lt;br /&gt;
auto discretization = domain.discretizeBoundaryWithStep(dx);&lt;br /&gt;
&lt;br /&gt;
// build source domain&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; empty({0, 0}, inner_radius);&lt;br /&gt;
auto discretization_empty = empty.discretizeBoundaryWithStep(dx, CENTRE);  &lt;br /&gt;
    &lt;br /&gt;
// substract the source domain&lt;br /&gt;
discretization -= discretization_empty;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next the domain is populated with nodes in accordance with the desired density function. Once the domain is constructed and discretized, the support (neighborhood) of $n$ nodes is found  for each node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GeneralFill&amp;lt;Vec2d&amp;gt; fill;&lt;br /&gt;
fill.seed(fill_seed);&lt;br /&gt;
discretization.fill(fill, fill_density);&lt;br /&gt;
&lt;br /&gt;
 // find support&lt;br /&gt;
FindClosest find_support(n);&lt;br /&gt;
discretization.findSupport(find_support);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The density function &amp;quot;fill_density&amp;quot; takes as argument the coordinates inside the domain and returns the desired distance between neighboring nodes for that location.&lt;br /&gt;
Now the domain preparation is complete, as domain is constructed and populated with nodes with support relations established. We continue by constructing the approximation engine.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
WLS&amp;lt;Monomials&amp;lt;Vec2d&amp;gt;, GaussianWeight&amp;lt;Vec2d&amp;gt;, ScaleToClosest&amp;gt; approx(m - 1 , sigma);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we are solving a time propagation problem implicitly, we will have to solve a system of equations for every time step. This is equivalent to solving a matrix equation. For this reason a space matrix is constructed. Next the wave equation is turned into code. Medusa encodes this information inside the just constructed matrix $M$. $E1$ and $E0$ represent the known solutions on previous two time steps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
SparseMatrix&amp;lt;double&amp;gt; M(domain_size, domain_size);&lt;br /&gt;
// Set equation on interior&lt;br /&gt;
for (int i : interior) {&lt;br /&gt;
    -(v*v*dt*dt) * op.lap(i) + op.value(i)= 2*E1(i)-E0(i);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Same is done also for the boundary nodes. Since dirichlet boundary conditions are employed the values of the Right Hand Side ($rhs$) of matrix equation are just set to prescribed values ($0$ on the outer boundary and $f(t)$ on inner boundary).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// Set boundary conditions&lt;br /&gt;
for (int i : boundary) {&lt;br /&gt;
    if (discretization.types()[i] == CENTRE) {&lt;br /&gt;
        op.value(i) = A * std::sin(omega*dt*2);  // step&lt;br /&gt;
    } else {&lt;br /&gt;
        op.value(i) = 0.0;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
At each time step the matrix equation is solved  using an Eigen linear equation solver, in this case, the BiCGStab algorithm. $E0$ and $E1$ are updated and the source is set to new value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
 // Solve matrix system&lt;br /&gt;
VectorXd E2 = solver.solve(rhs);&lt;br /&gt;
&lt;br /&gt;
// Update previous states&lt;br /&gt;
E0 = E1;&lt;br /&gt;
E1 = E2;&lt;br /&gt;
&lt;br /&gt;
 // Update rhs on interior&lt;br /&gt;
for (int i : interior) {&lt;br /&gt;
    rhs(i) = 2*E1(i)-E0(i);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Update rhs on boundary&lt;br /&gt;
for (int i : (discretization.types() == CENTRE)) {&lt;br /&gt;
    rhs(i) = A * std::sin(omega*dt*tt);  // step&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The animation of solution is presented below. The complete exampe is avalible at  [https://gitlab.com/e62Lab/medusa/tree/dev/examples/wave_equation wave_equation_2D.cpp]. &lt;br /&gt;
&lt;br /&gt;
[[File:EM_wave_2d_dt_e-6_dens40_omega128_v8 2X speed.mp4|400px]]&lt;br /&gt;
&lt;br /&gt;
== 2D time-domain acoustic wave propagation in heterogeneous media ==&lt;br /&gt;
We also solved wave equation in context of acoustic wave propagation in seismic modeling in the Earth’s subsurface (see related paper [https://e6.ijs.si/ParallelAndDistributedSystems/publications/62417923.pdf J. Močnik Berljavac, P. Mishra, J. Slak, G. Kosec; RBF-FD analysis of 2D time-domain acoustic wave propagation in heterogeneous media, Computers &amp;amp; Geosciences, 2021 [DOI: 10.1016/j.cageo.2021.104796]]. Some highlights from the paper&lt;br /&gt;
&lt;br /&gt;
[[File:wave_mormosi.png|600px]]&lt;br /&gt;
&lt;br /&gt;
[[File:wave_canadian.png|600px]]&lt;/div&gt;</summary>
		<author><name>E6WikiAdmin</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=Wave_equation&amp;diff=3532</id>
		<title>Wave equation</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=Wave_equation&amp;diff=3532"/>
				<updated>2022-12-04T19:50:30Z</updated>
		
		<summary type="html">&lt;p&gt;E6WikiAdmin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Box-round|title= Related papers |&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/62417923.pdf J. Močnik Berljavac, P. Mishra, J. Slak, G. Kosec; RBF-FD analysis of 2D time-domain acoustic wave propagation in heterogeneous media, Computers &amp;amp; Geosciences, 2021 [DOI: 10.1016/j.cageo.2021.104796]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== 2D wave equation with Dirichlet boundary conditions ==&lt;br /&gt;
We are solving a problem analogous to a clamped circular membrane being forced to oscillate by fixing its centre to a rigid oscillating rod.  The domain of calculation is for this reason an annulus bounded by the point of contact with the circular source in the centre and the clamped edge of the circular membrane.&lt;br /&gt;
&lt;br /&gt;
[[File:wave_2d_domain_geo.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
Consider the time dependent solution to 2D wave equation on annulus shaped domain&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
    	\frac{ \partial^2 u}{\partial t^2} &amp;amp;= c^2 \nabla^2 u  &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
         u(r,t=0)&amp;amp;=0 &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
    	  u &amp;amp;= 0           &amp;amp;&amp;amp;\text{on } \partial \Omega_O,\\&lt;br /&gt;
          u &amp;amp;= f(t)           &amp;amp;&amp;amp;\text{on } \partial \Omega_I,&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where $\partial\Omega_I$ denotes the inner and $\partial\Omega_O$ the outer boundary of the domain. Through the  boundary condition on the inner boundary the source is introduced to the problem as a function of time&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
f(t)= u_o \sin \omega_o t.&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First the domain is constructed by subtracting a smaller circle domain from a larger one. Boundaries of the domain are populated in the same step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// // identifier to be added to nodes on the inner boundary&lt;br /&gt;
int CENTRE = -10;&lt;br /&gt;
&lt;br /&gt;
 // build circle domain&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; domain({0, 0}, outer_radius);&lt;br /&gt;
auto discretization = domain.discretizeBoundaryWithStep(dx);&lt;br /&gt;
&lt;br /&gt;
// build source domain&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; empty({0, 0}, inner_radius);&lt;br /&gt;
auto discretization_empty = empty.discretizeBoundaryWithStep(dx, CENTRE);  &lt;br /&gt;
    &lt;br /&gt;
// substract the source domain&lt;br /&gt;
discretization -= discretization_empty;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next the domain is populated with nodes in accordance with the desired density function. Once the domain is constructed and discretized, the support (neighborhood) of $n$ nodes is found  for each node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GeneralFill&amp;lt;Vec2d&amp;gt; fill;&lt;br /&gt;
fill.seed(fill_seed);&lt;br /&gt;
discretization.fill(fill, fill_density);&lt;br /&gt;
&lt;br /&gt;
 // find support&lt;br /&gt;
FindClosest find_support(n);&lt;br /&gt;
discretization.findSupport(find_support);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The density function &amp;quot;fill_density&amp;quot; takes as argument the coordinates inside the domain and returns the desired distance between neighboring nodes for that location.&lt;br /&gt;
Now the domain preparation is complete, as domain is constructed and populated with nodes with support relations established. We continue by constructing the approximation engine.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
WLS&amp;lt;Monomials&amp;lt;Vec2d&amp;gt;, GaussianWeight&amp;lt;Vec2d&amp;gt;, ScaleToClosest&amp;gt; approx(m - 1 , sigma);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we are solving a time propagation problem implicitly, we will have to solve a system of equations for every time step. This is equivalent to solving a matrix equation. For this reason a space matrix is constructed. Next the wave equation is turned into code. Medusa encodes this information inside the just constructed matrix $M$. $E1$ and $E0$ represent the known solutions on previous two time steps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
SparseMatrix&amp;lt;double&amp;gt; M(domain_size, domain_size);&lt;br /&gt;
// Set equation on interior&lt;br /&gt;
for (int i : interior) {&lt;br /&gt;
    -(v*v*dt*dt) * op.lap(i) + op.value(i)= 2*E1(i)-E0(i);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Same is done also for the boundary nodes. Since dirichlet boundary conditions are employed the values of the Right Hand Side ($rhs$) of matrix equation are just set to prescribed values ($0$ on the outer boundary and $f(t)$ on inner boundary).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// Set boundary conditions&lt;br /&gt;
for (int i : boundary) {&lt;br /&gt;
    if (discretization.types()[i] == CENTRE) {&lt;br /&gt;
        op.value(i) = A * std::sin(omega*dt*2);  // step&lt;br /&gt;
    } else {&lt;br /&gt;
        op.value(i) = 0.0;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
At each time step the matrix equation is solved  using an Eigen linear equation solver, in this case, the BiCGStab algorithm. $E0$ and $E1$ are updated and the source is set to new value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
 // Solve matrix system&lt;br /&gt;
VectorXd E2 = solver.solve(rhs);&lt;br /&gt;
&lt;br /&gt;
// Update previous states&lt;br /&gt;
E0 = E1;&lt;br /&gt;
E1 = E2;&lt;br /&gt;
&lt;br /&gt;
 // Update rhs on interior&lt;br /&gt;
for (int i : interior) {&lt;br /&gt;
    rhs(i) = 2*E1(i)-E0(i);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Update rhs on boundary&lt;br /&gt;
for (int i : (discretization.types() == CENTRE)) {&lt;br /&gt;
    rhs(i) = A * std::sin(omega*dt*tt);  // step&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The animation of solution is presented below. The complete exampe is avalible at  [https://gitlab.com/e62Lab/medusa/tree/dev/examples/wave_equation wave_equation_2D.cpp]. &lt;br /&gt;
&lt;br /&gt;
[[File:EM_wave_2d_dt_e-6_dens40_omega128_v8 2X speed.mp4|400px]]&lt;br /&gt;
&lt;br /&gt;
== 2D time-domain acoustic wave propagation in heterogeneous media ==&lt;br /&gt;
We also solved wave equation in context of acoustic wave propagation in seismic modeling in the Earth’s subsurface (see related paper [https://e6.ijs.si/ParallelAndDistributedSystems/publications/62417923.pdf J. Močnik Berljavac, P. Mishra, J. Slak, G. Kosec; RBF-FD analysis of 2D time-domain acoustic wave propagation in heterogeneous media, Computers &amp;amp; Geosciences, 2021 [DOI: 10.1016/j.cageo.2021.104796]]. And some highlights from the paper&lt;br /&gt;
&lt;br /&gt;
[[File:wave_mormosi.png|800px]]&lt;br /&gt;
&lt;br /&gt;
[[File:wave_canadian.png|800px]]&lt;/div&gt;</summary>
		<author><name>E6WikiAdmin</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=Wave_equation&amp;diff=3531</id>
		<title>Wave equation</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=Wave_equation&amp;diff=3531"/>
				<updated>2022-12-04T19:48:31Z</updated>
		
		<summary type="html">&lt;p&gt;E6WikiAdmin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Box-round|title= Related papers |&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/62417923.pdf J. Močnik Berljavac, P. Mishra, J. Slak, G. Kosec; RBF-FD analysis of 2D time-domain acoustic wave propagation in heterogeneous media, Computers &amp;amp; Geosciences, 2021 [DOI: 10.1016/j.cageo.2021.104796]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== 2D wave equation with Dirichlet boundary conditions ==&lt;br /&gt;
We are solving a problem analogous to a clamped circular membrane being forced to oscillate by fixing its centre to a rigid oscillating rod.  The domain of calculation is for this reason an annulus bounded by the point of contact with the circular source in the centre and the clamped edge of the circular membrane.&lt;br /&gt;
&lt;br /&gt;
[[File:wave_2d_domain_geo.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
Consider the time dependent solution to 2D wave equation on annulus shaped domain&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
    	\frac{ \partial^2 u}{\partial t^2} &amp;amp;= c^2 \nabla^2 u  &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
         u(r,t=0)&amp;amp;=0 &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
    	  u &amp;amp;= 0           &amp;amp;&amp;amp;\text{on } \partial \Omega_O,\\&lt;br /&gt;
          u &amp;amp;= f(t)           &amp;amp;&amp;amp;\text{on } \partial \Omega_I,&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where $\partial\Omega_I$ denotes the inner and $\partial\Omega_O$ the outer boundary of the domain. Through the  boundary condition on the inner boundary the source is introduced to the problem as a function of time&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
f(t)= u_o \sin \omega_o t.&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First the domain is constructed by subtracting a smaller circle domain from a larger one. Boundaries of the domain are populated in the same step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// // identifier to be added to nodes on the inner boundary&lt;br /&gt;
int CENTRE = -10;&lt;br /&gt;
&lt;br /&gt;
 // build circle domain&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; domain({0, 0}, outer_radius);&lt;br /&gt;
auto discretization = domain.discretizeBoundaryWithStep(dx);&lt;br /&gt;
&lt;br /&gt;
// build source domain&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; empty({0, 0}, inner_radius);&lt;br /&gt;
auto discretization_empty = empty.discretizeBoundaryWithStep(dx, CENTRE);  &lt;br /&gt;
    &lt;br /&gt;
// substract the source domain&lt;br /&gt;
discretization -= discretization_empty;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next the domain is populated with nodes in accordance with the desired density function. Once the domain is constructed and discretized, the support (neighborhood) of $n$ nodes is found  for each node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GeneralFill&amp;lt;Vec2d&amp;gt; fill;&lt;br /&gt;
fill.seed(fill_seed);&lt;br /&gt;
discretization.fill(fill, fill_density);&lt;br /&gt;
&lt;br /&gt;
 // find support&lt;br /&gt;
FindClosest find_support(n);&lt;br /&gt;
discretization.findSupport(find_support);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The density function &amp;quot;fill_density&amp;quot; takes as argument the coordinates inside the domain and returns the desired distance between neighboring nodes for that location.&lt;br /&gt;
Now the domain preparation is complete, as domain is constructed and populated with nodes with support relations established. We continue by constructing the approximation engine.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
WLS&amp;lt;Monomials&amp;lt;Vec2d&amp;gt;, GaussianWeight&amp;lt;Vec2d&amp;gt;, ScaleToClosest&amp;gt; approx(m - 1 , sigma);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we are solving a time propagation problem implicitly, we will have to solve a system of equations for every time step. This is equivalent to solving a matrix equation. For this reason a space matrix is constructed. Next the wave equation is turned into code. Medusa encodes this information inside the just constructed matrix $M$. $E1$ and $E0$ represent the known solutions on previous two time steps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
SparseMatrix&amp;lt;double&amp;gt; M(domain_size, domain_size);&lt;br /&gt;
// Set equation on interior&lt;br /&gt;
for (int i : interior) {&lt;br /&gt;
    -(v*v*dt*dt) * op.lap(i) + op.value(i)= 2*E1(i)-E0(i);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Same is done also for the boundary nodes. Since dirichlet boundary conditions are employed the values of the Right Hand Side ($rhs$) of matrix equation are just set to prescribed values ($0$ on the outer boundary and $f(t)$ on inner boundary).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// Set boundary conditions&lt;br /&gt;
for (int i : boundary) {&lt;br /&gt;
    if (discretization.types()[i] == CENTRE) {&lt;br /&gt;
        op.value(i) = A * std::sin(omega*dt*2);  // step&lt;br /&gt;
    } else {&lt;br /&gt;
        op.value(i) = 0.0;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
At each time step the matrix equation is solved  using an Eigen linear equation solver, in this case, the BiCGStab algorithm. $E0$ and $E1$ are updated and the source is set to new value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
 // Solve matrix system&lt;br /&gt;
VectorXd E2 = solver.solve(rhs);&lt;br /&gt;
&lt;br /&gt;
// Update previous states&lt;br /&gt;
E0 = E1;&lt;br /&gt;
E1 = E2;&lt;br /&gt;
&lt;br /&gt;
 // Update rhs on interior&lt;br /&gt;
for (int i : interior) {&lt;br /&gt;
    rhs(i) = 2*E1(i)-E0(i);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Update rhs on boundary&lt;br /&gt;
for (int i : (discretization.types() == CENTRE)) {&lt;br /&gt;
    rhs(i) = A * std::sin(omega*dt*tt);  // step&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The animation of solution is presented below. The complete exampe is avalible at  [https://gitlab.com/e62Lab/medusa/tree/dev/examples/wave_equation wave_equation_2D.cpp]. &lt;br /&gt;
&lt;br /&gt;
[[File:EM_wave_2d_dt_e-6_dens40_omega128_v8 2X speed.mp4|400px]]&lt;br /&gt;
&lt;br /&gt;
== 2D time-domain acoustic wave propagation in heterogeneous media ==&lt;br /&gt;
We also solved wave equation in context of acoustic wave propagation in seismic modeling in the Earth’s subsurface (see related paper [https://e6.ijs.si/ParallelAndDistributedSystems/publications/62417923.pdf J. Močnik Berljavac, P. Mishra, J. Slak, G. Kosec; RBF-FD analysis of 2D time-domain acoustic wave propagation in heterogeneous media, Computers &amp;amp; Geosciences, 2021 [DOI: 10.1016/j.cageo.2021.104796]]. And some highlights from the paper&lt;br /&gt;
&lt;br /&gt;
[[File:wave_mormosi.png|600px]]&lt;br /&gt;
&lt;br /&gt;
[[File:wave_canadian.png|600px]]&lt;/div&gt;</summary>
		<author><name>E6WikiAdmin</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=File:Wave_canadian.png&amp;diff=3530</id>
		<title>File:Wave canadian.png</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=File:Wave_canadian.png&amp;diff=3530"/>
				<updated>2022-12-04T19:47:41Z</updated>
		
		<summary type="html">&lt;p&gt;E6WikiAdmin: File uploaded with MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>E6WikiAdmin</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=Wave_equation&amp;diff=3529</id>
		<title>Wave equation</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=Wave_equation&amp;diff=3529"/>
				<updated>2022-12-04T19:45:54Z</updated>
		
		<summary type="html">&lt;p&gt;E6WikiAdmin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Box-round|title= Related papers |&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/62417923.pdf J. Močnik Berljavac, P. Mishra, J. Slak, G. Kosec; RBF-FD analysis of 2D time-domain acoustic wave propagation in heterogeneous media, Computers &amp;amp; Geosciences, 2021 [DOI: 10.1016/j.cageo.2021.104796]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== 2D wave equation with Dirichlet boundary conditions ==&lt;br /&gt;
We are solving a problem analogous to a clamped circular membrane being forced to oscillate by fixing its centre to a rigid oscillating rod.  The domain of calculation is for this reason an annulus bounded by the point of contact with the circular source in the centre and the clamped edge of the circular membrane.&lt;br /&gt;
&lt;br /&gt;
[[File:wave_2d_domain_geo.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
Consider the time dependent solution to 2D wave equation on annulus shaped domain&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
    	\frac{ \partial^2 u}{\partial t^2} &amp;amp;= c^2 \nabla^2 u  &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
         u(r,t=0)&amp;amp;=0 &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
    	  u &amp;amp;= 0           &amp;amp;&amp;amp;\text{on } \partial \Omega_O,\\&lt;br /&gt;
          u &amp;amp;= f(t)           &amp;amp;&amp;amp;\text{on } \partial \Omega_I,&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where $\partial\Omega_I$ denotes the inner and $\partial\Omega_O$ the outer boundary of the domain. Through the  boundary condition on the inner boundary the source is introduced to the problem as a function of time&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
f(t)= u_o \sin \omega_o t.&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First the domain is constructed by subtracting a smaller circle domain from a larger one. Boundaries of the domain are populated in the same step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// // identifier to be added to nodes on the inner boundary&lt;br /&gt;
int CENTRE = -10;&lt;br /&gt;
&lt;br /&gt;
 // build circle domain&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; domain({0, 0}, outer_radius);&lt;br /&gt;
auto discretization = domain.discretizeBoundaryWithStep(dx);&lt;br /&gt;
&lt;br /&gt;
// build source domain&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; empty({0, 0}, inner_radius);&lt;br /&gt;
auto discretization_empty = empty.discretizeBoundaryWithStep(dx, CENTRE);  &lt;br /&gt;
    &lt;br /&gt;
// substract the source domain&lt;br /&gt;
discretization -= discretization_empty;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next the domain is populated with nodes in accordance with the desired density function. Once the domain is constructed and discretized, the support (neighborhood) of $n$ nodes is found  for each node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GeneralFill&amp;lt;Vec2d&amp;gt; fill;&lt;br /&gt;
fill.seed(fill_seed);&lt;br /&gt;
discretization.fill(fill, fill_density);&lt;br /&gt;
&lt;br /&gt;
 // find support&lt;br /&gt;
FindClosest find_support(n);&lt;br /&gt;
discretization.findSupport(find_support);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The density function &amp;quot;fill_density&amp;quot; takes as argument the coordinates inside the domain and returns the desired distance between neighboring nodes for that location.&lt;br /&gt;
Now the domain preparation is complete, as domain is constructed and populated with nodes with support relations established. We continue by constructing the approximation engine.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
WLS&amp;lt;Monomials&amp;lt;Vec2d&amp;gt;, GaussianWeight&amp;lt;Vec2d&amp;gt;, ScaleToClosest&amp;gt; approx(m - 1 , sigma);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we are solving a time propagation problem implicitly, we will have to solve a system of equations for every time step. This is equivalent to solving a matrix equation. For this reason a space matrix is constructed. Next the wave equation is turned into code. Medusa encodes this information inside the just constructed matrix $M$. $E1$ and $E0$ represent the known solutions on previous two time steps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
SparseMatrix&amp;lt;double&amp;gt; M(domain_size, domain_size);&lt;br /&gt;
// Set equation on interior&lt;br /&gt;
for (int i : interior) {&lt;br /&gt;
    -(v*v*dt*dt) * op.lap(i) + op.value(i)= 2*E1(i)-E0(i);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Same is done also for the boundary nodes. Since dirichlet boundary conditions are employed the values of the Right Hand Side ($rhs$) of matrix equation are just set to prescribed values ($0$ on the outer boundary and $f(t)$ on inner boundary).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// Set boundary conditions&lt;br /&gt;
for (int i : boundary) {&lt;br /&gt;
    if (discretization.types()[i] == CENTRE) {&lt;br /&gt;
        op.value(i) = A * std::sin(omega*dt*2);  // step&lt;br /&gt;
    } else {&lt;br /&gt;
        op.value(i) = 0.0;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
At each time step the matrix equation is solved  using an Eigen linear equation solver, in this case, the BiCGStab algorithm. $E0$ and $E1$ are updated and the source is set to new value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
 // Solve matrix system&lt;br /&gt;
VectorXd E2 = solver.solve(rhs);&lt;br /&gt;
&lt;br /&gt;
// Update previous states&lt;br /&gt;
E0 = E1;&lt;br /&gt;
E1 = E2;&lt;br /&gt;
&lt;br /&gt;
 // Update rhs on interior&lt;br /&gt;
for (int i : interior) {&lt;br /&gt;
    rhs(i) = 2*E1(i)-E0(i);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Update rhs on boundary&lt;br /&gt;
for (int i : (discretization.types() == CENTRE)) {&lt;br /&gt;
    rhs(i) = A * std::sin(omega*dt*tt);  // step&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The animation of solution is presented below. The complete exampe is avalible at  [https://gitlab.com/e62Lab/medusa/tree/dev/examples/wave_equation wave_equation_2D.cpp]. &lt;br /&gt;
&lt;br /&gt;
[[File:EM_wave_2d_dt_e-6_dens40_omega128_v8 2X speed.mp4|400px]]&lt;br /&gt;
&lt;br /&gt;
== 2D time-domain acoustic wave propagation in heterogeneous media ==&lt;br /&gt;
We also solved wave equation in context of acoustic wave propagation in seismic modeling in the Earth’s subsurface (see related paper [https://e6.ijs.si/ParallelAndDistributedSystems/publications/62417923.pdf J. Močnik Berljavac, P. Mishra, J. Slak, G. Kosec; RBF-FD analysis of 2D time-domain acoustic wave propagation in heterogeneous media, Computers &amp;amp; Geosciences, 2021 [DOI: 10.1016/j.cageo.2021.104796]]. And some highlights from the paper&lt;br /&gt;
&lt;br /&gt;
[[File:wave_mormosi.png|600px]]&lt;br /&gt;
[[File:wave_canadian.png|600px]]&lt;/div&gt;</summary>
		<author><name>E6WikiAdmin</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=Wave_equation&amp;diff=3528</id>
		<title>Wave equation</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=Wave_equation&amp;diff=3528"/>
				<updated>2022-12-04T19:45:36Z</updated>
		
		<summary type="html">&lt;p&gt;E6WikiAdmin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Box-round|title= Related papers |&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/62417923.pdf J. Močnik Berljavac, P. Mishra, J. Slak, G. Kosec; RBF-FD analysis of 2D time-domain acoustic wave propagation in heterogeneous media, Computers &amp;amp; Geosciences, 2021 [DOI: 10.1016/j.cageo.2021.104796]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== 2D wave equation with Dirichlet boundary conditions ==&lt;br /&gt;
We are solving a problem analogous to a clamped circular membrane being forced to oscillate by fixing its centre to a rigid oscillating rod.  The domain of calculation is for this reason an annulus bounded by the point of contact with the circular source in the centre and the clamped edge of the circular membrane.&lt;br /&gt;
&lt;br /&gt;
[[File:wave_2d_domain_geo.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
Consider the time dependent solution to 2D wave equation on annulus shaped domain&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
    	\frac{ \partial^2 u}{\partial t^2} &amp;amp;= c^2 \nabla^2 u  &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
         u(r,t=0)&amp;amp;=0 &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
    	  u &amp;amp;= 0           &amp;amp;&amp;amp;\text{on } \partial \Omega_O,\\&lt;br /&gt;
          u &amp;amp;= f(t)           &amp;amp;&amp;amp;\text{on } \partial \Omega_I,&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where $\partial\Omega_I$ denotes the inner and $\partial\Omega_O$ the outer boundary of the domain. Through the  boundary condition on the inner boundary the source is introduced to the problem as a function of time&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
f(t)= u_o \sin \omega_o t.&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First the domain is constructed by subtracting a smaller circle domain from a larger one. Boundaries of the domain are populated in the same step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// // identifier to be added to nodes on the inner boundary&lt;br /&gt;
int CENTRE = -10;&lt;br /&gt;
&lt;br /&gt;
 // build circle domain&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; domain({0, 0}, outer_radius);&lt;br /&gt;
auto discretization = domain.discretizeBoundaryWithStep(dx);&lt;br /&gt;
&lt;br /&gt;
// build source domain&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; empty({0, 0}, inner_radius);&lt;br /&gt;
auto discretization_empty = empty.discretizeBoundaryWithStep(dx, CENTRE);  &lt;br /&gt;
    &lt;br /&gt;
// substract the source domain&lt;br /&gt;
discretization -= discretization_empty;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next the domain is populated with nodes in accordance with the desired density function. Once the domain is constructed and discretized, the support (neighborhood) of $n$ nodes is found  for each node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GeneralFill&amp;lt;Vec2d&amp;gt; fill;&lt;br /&gt;
fill.seed(fill_seed);&lt;br /&gt;
discretization.fill(fill, fill_density);&lt;br /&gt;
&lt;br /&gt;
 // find support&lt;br /&gt;
FindClosest find_support(n);&lt;br /&gt;
discretization.findSupport(find_support);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The density function &amp;quot;fill_density&amp;quot; takes as argument the coordinates inside the domain and returns the desired distance between neighboring nodes for that location.&lt;br /&gt;
Now the domain preparation is complete, as domain is constructed and populated with nodes with support relations established. We continue by constructing the approximation engine.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
WLS&amp;lt;Monomials&amp;lt;Vec2d&amp;gt;, GaussianWeight&amp;lt;Vec2d&amp;gt;, ScaleToClosest&amp;gt; approx(m - 1 , sigma);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we are solving a time propagation problem implicitly, we will have to solve a system of equations for every time step. This is equivalent to solving a matrix equation. For this reason a space matrix is constructed. Next the wave equation is turned into code. Medusa encodes this information inside the just constructed matrix $M$. $E1$ and $E0$ represent the known solutions on previous two time steps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
SparseMatrix&amp;lt;double&amp;gt; M(domain_size, domain_size);&lt;br /&gt;
// Set equation on interior&lt;br /&gt;
for (int i : interior) {&lt;br /&gt;
    -(v*v*dt*dt) * op.lap(i) + op.value(i)= 2*E1(i)-E0(i);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Same is done also for the boundary nodes. Since dirichlet boundary conditions are employed the values of the Right Hand Side ($rhs$) of matrix equation are just set to prescribed values ($0$ on the outer boundary and $f(t)$ on inner boundary).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// Set boundary conditions&lt;br /&gt;
for (int i : boundary) {&lt;br /&gt;
    if (discretization.types()[i] == CENTRE) {&lt;br /&gt;
        op.value(i) = A * std::sin(omega*dt*2);  // step&lt;br /&gt;
    } else {&lt;br /&gt;
        op.value(i) = 0.0;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
At each time step the matrix equation is solved  using an Eigen linear equation solver, in this case, the BiCGStab algorithm. $E0$ and $E1$ are updated and the source is set to new value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
 // Solve matrix system&lt;br /&gt;
VectorXd E2 = solver.solve(rhs);&lt;br /&gt;
&lt;br /&gt;
// Update previous states&lt;br /&gt;
E0 = E1;&lt;br /&gt;
E1 = E2;&lt;br /&gt;
&lt;br /&gt;
 // Update rhs on interior&lt;br /&gt;
for (int i : interior) {&lt;br /&gt;
    rhs(i) = 2*E1(i)-E0(i);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Update rhs on boundary&lt;br /&gt;
for (int i : (discretization.types() == CENTRE)) {&lt;br /&gt;
    rhs(i) = A * std::sin(omega*dt*tt);  // step&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The animation of solution is presented below. The complete exampe is avalible at  [https://gitlab.com/e62Lab/medusa/tree/dev/examples/wave_equation wave_equation_2D.cpp]. &lt;br /&gt;
&lt;br /&gt;
[[File:EM_wave_2d_dt_e-6_dens40_omega128_v8 2X speed.mp4|400px]]&lt;br /&gt;
&lt;br /&gt;
== 2D time-domain acoustic wave propagation in heterogeneous media ==&lt;br /&gt;
We also solved wave equation in context of acoustic wave propagation in seismic modeling in the Earth’s subsurface (see related paper [https://e6.ijs.si/ParallelAndDistributedSystems/publications/62417923.pdf J. Močnik Berljavac, P. Mishra, J. Slak, G. Kosec; RBF-FD analysis of 2D time-domain acoustic wave propagation in heterogeneous media, Computers &amp;amp; Geosciences, 2021 [DOI: 10.1016/j.cageo.2021.104796]]. And some highlights from the paper&lt;br /&gt;
&lt;br /&gt;
[[File:wave_mormosi.png|600px]]&lt;br /&gt;
[[File:wave_canadia.png|600px]]&lt;/div&gt;</summary>
		<author><name>E6WikiAdmin</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=Wave_equation&amp;diff=3527</id>
		<title>Wave equation</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=Wave_equation&amp;diff=3527"/>
				<updated>2022-12-04T19:44:47Z</updated>
		
		<summary type="html">&lt;p&gt;E6WikiAdmin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Box-round|title= Related papers |&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/62417923.pdf J. Močnik Berljavac, P. Mishra, J. Slak, G. Kosec; RBF-FD analysis of 2D time-domain acoustic wave propagation in heterogeneous media, Computers &amp;amp; Geosciences, 2021 [DOI: 10.1016/j.cageo.2021.104796]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== 2D wave equation with Dirichlet boundary conditions ==&lt;br /&gt;
We are solving a problem analogous to a clamped circular membrane being forced to oscillate by fixing its centre to a rigid oscillating rod.  The domain of calculation is for this reason an annulus bounded by the point of contact with the circular source in the centre and the clamped edge of the circular membrane.&lt;br /&gt;
&lt;br /&gt;
[[File:wave_2d_domain_geo.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
Consider the time dependent solution to 2D wave equation on annulus shaped domain&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
    	\frac{ \partial^2 u}{\partial t^2} &amp;amp;= c^2 \nabla^2 u  &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
         u(r,t=0)&amp;amp;=0 &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
    	  u &amp;amp;= 0           &amp;amp;&amp;amp;\text{on } \partial \Omega_O,\\&lt;br /&gt;
          u &amp;amp;= f(t)           &amp;amp;&amp;amp;\text{on } \partial \Omega_I,&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where $\partial\Omega_I$ denotes the inner and $\partial\Omega_O$ the outer boundary of the domain. Through the  boundary condition on the inner boundary the source is introduced to the problem as a function of time&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
f(t)= u_o \sin \omega_o t.&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First the domain is constructed by subtracting a smaller circle domain from a larger one. Boundaries of the domain are populated in the same step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// // identifier to be added to nodes on the inner boundary&lt;br /&gt;
int CENTRE = -10;&lt;br /&gt;
&lt;br /&gt;
 // build circle domain&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; domain({0, 0}, outer_radius);&lt;br /&gt;
auto discretization = domain.discretizeBoundaryWithStep(dx);&lt;br /&gt;
&lt;br /&gt;
// build source domain&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; empty({0, 0}, inner_radius);&lt;br /&gt;
auto discretization_empty = empty.discretizeBoundaryWithStep(dx, CENTRE);  &lt;br /&gt;
    &lt;br /&gt;
// substract the source domain&lt;br /&gt;
discretization -= discretization_empty;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next the domain is populated with nodes in accordance with the desired density function. Once the domain is constructed and discretized, the support (neighborhood) of $n$ nodes is found  for each node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GeneralFill&amp;lt;Vec2d&amp;gt; fill;&lt;br /&gt;
fill.seed(fill_seed);&lt;br /&gt;
discretization.fill(fill, fill_density);&lt;br /&gt;
&lt;br /&gt;
 // find support&lt;br /&gt;
FindClosest find_support(n);&lt;br /&gt;
discretization.findSupport(find_support);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The density function &amp;quot;fill_density&amp;quot; takes as argument the coordinates inside the domain and returns the desired distance between neighboring nodes for that location.&lt;br /&gt;
Now the domain preparation is complete, as domain is constructed and populated with nodes with support relations established. We continue by constructing the approximation engine.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
WLS&amp;lt;Monomials&amp;lt;Vec2d&amp;gt;, GaussianWeight&amp;lt;Vec2d&amp;gt;, ScaleToClosest&amp;gt; approx(m - 1 , sigma);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we are solving a time propagation problem implicitly, we will have to solve a system of equations for every time step. This is equivalent to solving a matrix equation. For this reason a space matrix is constructed. Next the wave equation is turned into code. Medusa encodes this information inside the just constructed matrix $M$. $E1$ and $E0$ represent the known solutions on previous two time steps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
SparseMatrix&amp;lt;double&amp;gt; M(domain_size, domain_size);&lt;br /&gt;
// Set equation on interior&lt;br /&gt;
for (int i : interior) {&lt;br /&gt;
    -(v*v*dt*dt) * op.lap(i) + op.value(i)= 2*E1(i)-E0(i);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Same is done also for the boundary nodes. Since dirichlet boundary conditions are employed the values of the Right Hand Side ($rhs$) of matrix equation are just set to prescribed values ($0$ on the outer boundary and $f(t)$ on inner boundary).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// Set boundary conditions&lt;br /&gt;
for (int i : boundary) {&lt;br /&gt;
    if (discretization.types()[i] == CENTRE) {&lt;br /&gt;
        op.value(i) = A * std::sin(omega*dt*2);  // step&lt;br /&gt;
    } else {&lt;br /&gt;
        op.value(i) = 0.0;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
At each time step the matrix equation is solved  using an Eigen linear equation solver, in this case, the BiCGStab algorithm. $E0$ and $E1$ are updated and the source is set to new value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
 // Solve matrix system&lt;br /&gt;
VectorXd E2 = solver.solve(rhs);&lt;br /&gt;
&lt;br /&gt;
// Update previous states&lt;br /&gt;
E0 = E1;&lt;br /&gt;
E1 = E2;&lt;br /&gt;
&lt;br /&gt;
 // Update rhs on interior&lt;br /&gt;
for (int i : interior) {&lt;br /&gt;
    rhs(i) = 2*E1(i)-E0(i);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Update rhs on boundary&lt;br /&gt;
for (int i : (discretization.types() == CENTRE)) {&lt;br /&gt;
    rhs(i) = A * std::sin(omega*dt*tt);  // step&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The animation of solution is presented below. The complete exampe is avalible at  [https://gitlab.com/e62Lab/medusa/tree/dev/examples/wave_equation wave_equation_2D.cpp]. &lt;br /&gt;
&lt;br /&gt;
[[File:EM_wave_2d_dt_e-6_dens40_omega128_v8 2X speed.mp4|400px]]&lt;br /&gt;
&lt;br /&gt;
== 2D time-domain acoustic wave propagation in heterogeneous media ==&lt;br /&gt;
We also solved wave equation in context of acoustic wave propagation in seismic modeling in the Earth’s subsurface (see related paper [https://e6.ijs.si/ParallelAndDistributedSystems/publications/62417923.pdf J. Močnik Berljavac, P. Mishra, J. Slak, G. Kosec; RBF-FD analysis of 2D time-domain acoustic wave propagation in heterogeneous media, Computers &amp;amp; Geosciences, 2021 [DOI: 10.1016/j.cageo.2021.104796]]. And some highlights from the paper&lt;br /&gt;
&lt;br /&gt;
[[File:wave_mormosi.png|600px]]&lt;/div&gt;</summary>
		<author><name>E6WikiAdmin</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=Wave_equation&amp;diff=3526</id>
		<title>Wave equation</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=Wave_equation&amp;diff=3526"/>
				<updated>2022-12-04T19:42:54Z</updated>
		
		<summary type="html">&lt;p&gt;E6WikiAdmin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Box-round|title= Related papers |&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/62417923.pdf J. Močnik Berljavac, P. Mishra, J. Slak, G. Kosec; RBF-FD analysis of 2D time-domain acoustic wave propagation in heterogeneous media, Computers &amp;amp; Geosciences, 2021 [DOI: 10.1016/j.cageo.2021.104796]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== 2D wave equation with Dirichlet boundary conditions ==&lt;br /&gt;
We are solving a problem analogous to a clamped circular membrane being forced to oscillate by fixing its centre to a rigid oscillating rod.  The domain of calculation is for this reason an annulus bounded by the point of contact with the circular source in the centre and the clamped edge of the circular membrane.&lt;br /&gt;
&lt;br /&gt;
[[File:wave_2d_domain_geo.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
Consider the time dependent solution to 2D wave equation on annulus shaped domain&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
    	\frac{ \partial^2 u}{\partial t^2} &amp;amp;= c^2 \nabla^2 u  &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
         u(r,t=0)&amp;amp;=0 &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
    	  u &amp;amp;= 0           &amp;amp;&amp;amp;\text{on } \partial \Omega_O,\\&lt;br /&gt;
          u &amp;amp;= f(t)           &amp;amp;&amp;amp;\text{on } \partial \Omega_I,&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where $\partial\Omega_I$ denotes the inner and $\partial\Omega_O$ the outer boundary of the domain. Through the  boundary condition on the inner boundary the source is introduced to the problem as a function of time&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
f(t)= u_o \sin \omega_o t.&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First the domain is constructed by subtracting a smaller circle domain from a larger one. Boundaries of the domain are populated in the same step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// // identifier to be added to nodes on the inner boundary&lt;br /&gt;
int CENTRE = -10;&lt;br /&gt;
&lt;br /&gt;
 // build circle domain&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; domain({0, 0}, outer_radius);&lt;br /&gt;
auto discretization = domain.discretizeBoundaryWithStep(dx);&lt;br /&gt;
&lt;br /&gt;
// build source domain&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; empty({0, 0}, inner_radius);&lt;br /&gt;
auto discretization_empty = empty.discretizeBoundaryWithStep(dx, CENTRE);  &lt;br /&gt;
    &lt;br /&gt;
// substract the source domain&lt;br /&gt;
discretization -= discretization_empty;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next the domain is populated with nodes in accordance with the desired density function. Once the domain is constructed and discretized, the support (neighborhood) of $n$ nodes is found  for each node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GeneralFill&amp;lt;Vec2d&amp;gt; fill;&lt;br /&gt;
fill.seed(fill_seed);&lt;br /&gt;
discretization.fill(fill, fill_density);&lt;br /&gt;
&lt;br /&gt;
 // find support&lt;br /&gt;
FindClosest find_support(n);&lt;br /&gt;
discretization.findSupport(find_support);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The density function &amp;quot;fill_density&amp;quot; takes as argument the coordinates inside the domain and returns the desired distance between neighboring nodes for that location.&lt;br /&gt;
Now the domain preparation is complete, as domain is constructed and populated with nodes with support relations established. We continue by constructing the approximation engine.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
WLS&amp;lt;Monomials&amp;lt;Vec2d&amp;gt;, GaussianWeight&amp;lt;Vec2d&amp;gt;, ScaleToClosest&amp;gt; approx(m - 1 , sigma);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we are solving a time propagation problem implicitly, we will have to solve a system of equations for every time step. This is equivalent to solving a matrix equation. For this reason a space matrix is constructed. Next the wave equation is turned into code. Medusa encodes this information inside the just constructed matrix $M$. $E1$ and $E0$ represent the known solutions on previous two time steps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
SparseMatrix&amp;lt;double&amp;gt; M(domain_size, domain_size);&lt;br /&gt;
// Set equation on interior&lt;br /&gt;
for (int i : interior) {&lt;br /&gt;
    -(v*v*dt*dt) * op.lap(i) + op.value(i)= 2*E1(i)-E0(i);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Same is done also for the boundary nodes. Since dirichlet boundary conditions are employed the values of the Right Hand Side ($rhs$) of matrix equation are just set to prescribed values ($0$ on the outer boundary and $f(t)$ on inner boundary).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// Set boundary conditions&lt;br /&gt;
for (int i : boundary) {&lt;br /&gt;
    if (discretization.types()[i] == CENTRE) {&lt;br /&gt;
        op.value(i) = A * std::sin(omega*dt*2);  // step&lt;br /&gt;
    } else {&lt;br /&gt;
        op.value(i) = 0.0;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
At each time step the matrix equation is solved  using an Eigen linear equation solver, in this case, the BiCGStab algorithm. $E0$ and $E1$ are updated and the source is set to new value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
 // Solve matrix system&lt;br /&gt;
VectorXd E2 = solver.solve(rhs);&lt;br /&gt;
&lt;br /&gt;
// Update previous states&lt;br /&gt;
E0 = E1;&lt;br /&gt;
E1 = E2;&lt;br /&gt;
&lt;br /&gt;
 // Update rhs on interior&lt;br /&gt;
for (int i : interior) {&lt;br /&gt;
    rhs(i) = 2*E1(i)-E0(i);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Update rhs on boundary&lt;br /&gt;
for (int i : (discretization.types() == CENTRE)) {&lt;br /&gt;
    rhs(i) = A * std::sin(omega*dt*tt);  // step&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The animation of solution is presented below. The complete exampe is avalible at  [https://gitlab.com/e62Lab/medusa/tree/dev/examples/wave_equation wave_equation_2D.cpp]. &lt;br /&gt;
&lt;br /&gt;
[[File:EM_wave_2d_dt_e-6_dens40_omega128_v8 2X speed.mp4|400px]]&lt;br /&gt;
&lt;br /&gt;
== 2D time-domain acoustic wave propagation in heterogeneous media ==&lt;br /&gt;
We also solved wave equation in context of acoustic wave propagation in seismic modeling in the Earth’s subsurface (see related paper [https://e6.ijs.si/ParallelAndDistributedSystems/publications/62417923.pdf J. Močnik Berljavac, P. Mishra, J. Slak, G. Kosec; RBF-FD analysis of 2D time-domain acoustic wave propagation in heterogeneous media, Computers &amp;amp; Geosciences, 2021 [DOI: 10.1016/j.cageo.2021.104796]]. And some highlights from the paper&lt;br /&gt;
&lt;br /&gt;
[[File:wave_mormosi.png|500px]]&lt;/div&gt;</summary>
		<author><name>E6WikiAdmin</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=Wave_equation&amp;diff=3525</id>
		<title>Wave equation</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=Wave_equation&amp;diff=3525"/>
				<updated>2022-12-04T19:42:08Z</updated>
		
		<summary type="html">&lt;p&gt;E6WikiAdmin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Box-round|title= Related papers |&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/62417923.pdf J. Močnik Berljavac, P. Mishra, J. Slak, G. Kosec; RBF-FD analysis of 2D time-domain acoustic wave propagation in heterogeneous media, Computers &amp;amp; Geosciences, 2021 [DOI: 10.1016/j.cageo.2021.104796]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
== 2D wave equation with Dirichlet boundary conditions ==&lt;br /&gt;
We are solving a problem analogous to a clamped circular membrane being forced to oscillate by fixing its centre to a rigid oscillating rod.  The domain of calculation is for this reason an annulus bounded by the point of contact with the circular source in the centre and the clamped edge of the circular membrane.&lt;br /&gt;
&lt;br /&gt;
[[File:wave_2d_domain_geo.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
Consider the time dependent solution to 2D wave equation on annulus shaped domain&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
    	\frac{ \partial^2 u}{\partial t^2} &amp;amp;= c^2 \nabla^2 u  &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
         u(r,t=0)&amp;amp;=0 &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
    	  u &amp;amp;= 0           &amp;amp;&amp;amp;\text{on } \partial \Omega_O,\\&lt;br /&gt;
          u &amp;amp;= f(t)           &amp;amp;&amp;amp;\text{on } \partial \Omega_I,&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where $\partial\Omega_I$ denotes the inner and $\partial\Omega_O$ the outer boundary of the domain. Through the  boundary condition on the inner boundary the source is introduced to the problem as a function of time&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
f(t)= u_o \sin \omega_o t.&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First the domain is constructed by subtracting a smaller circle domain from a larger one. Boundaries of the domain are populated in the same step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// // identifier to be added to nodes on the inner boundary&lt;br /&gt;
int CENTRE = -10;&lt;br /&gt;
&lt;br /&gt;
 // build circle domain&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; domain({0, 0}, outer_radius);&lt;br /&gt;
auto discretization = domain.discretizeBoundaryWithStep(dx);&lt;br /&gt;
&lt;br /&gt;
// build source domain&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; empty({0, 0}, inner_radius);&lt;br /&gt;
auto discretization_empty = empty.discretizeBoundaryWithStep(dx, CENTRE);  &lt;br /&gt;
    &lt;br /&gt;
// substract the source domain&lt;br /&gt;
discretization -= discretization_empty;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next the domain is populated with nodes in accordance with the desired density function. Once the domain is constructed and discretized, the support (neighborhood) of $n$ nodes is found  for each node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GeneralFill&amp;lt;Vec2d&amp;gt; fill;&lt;br /&gt;
fill.seed(fill_seed);&lt;br /&gt;
discretization.fill(fill, fill_density);&lt;br /&gt;
&lt;br /&gt;
 // find support&lt;br /&gt;
FindClosest find_support(n);&lt;br /&gt;
discretization.findSupport(find_support);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The density function &amp;quot;fill_density&amp;quot; takes as argument the coordinates inside the domain and returns the desired distance between neighboring nodes for that location.&lt;br /&gt;
Now the domain preparation is complete, as domain is constructed and populated with nodes with support relations established. We continue by constructing the approximation engine.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
WLS&amp;lt;Monomials&amp;lt;Vec2d&amp;gt;, GaussianWeight&amp;lt;Vec2d&amp;gt;, ScaleToClosest&amp;gt; approx(m - 1 , sigma);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we are solving a time propagation problem implicitly, we will have to solve a system of equations for every time step. This is equivalent to solving a matrix equation. For this reason a space matrix is constructed. Next the wave equation is turned into code. Medusa encodes this information inside the just constructed matrix $M$. $E1$ and $E0$ represent the known solutions on previous two time steps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
SparseMatrix&amp;lt;double&amp;gt; M(domain_size, domain_size);&lt;br /&gt;
// Set equation on interior&lt;br /&gt;
for (int i : interior) {&lt;br /&gt;
    -(v*v*dt*dt) * op.lap(i) + op.value(i)= 2*E1(i)-E0(i);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Same is done also for the boundary nodes. Since dirichlet boundary conditions are employed the values of the Right Hand Side ($rhs$) of matrix equation are just set to prescribed values ($0$ on the outer boundary and $f(t)$ on inner boundary).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// Set boundary conditions&lt;br /&gt;
for (int i : boundary) {&lt;br /&gt;
    if (discretization.types()[i] == CENTRE) {&lt;br /&gt;
        op.value(i) = A * std::sin(omega*dt*2);  // step&lt;br /&gt;
    } else {&lt;br /&gt;
        op.value(i) = 0.0;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
At each time step the matrix equation is solved  using an Eigen linear equation solver, in this case, the BiCGStab algorithm. $E0$ and $E1$ are updated and the source is set to new value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
 // Solve matrix system&lt;br /&gt;
VectorXd E2 = solver.solve(rhs);&lt;br /&gt;
&lt;br /&gt;
// Update previous states&lt;br /&gt;
E0 = E1;&lt;br /&gt;
E1 = E2;&lt;br /&gt;
&lt;br /&gt;
 // Update rhs on interior&lt;br /&gt;
for (int i : interior) {&lt;br /&gt;
    rhs(i) = 2*E1(i)-E0(i);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Update rhs on boundary&lt;br /&gt;
for (int i : (discretization.types() == CENTRE)) {&lt;br /&gt;
    rhs(i) = A * std::sin(omega*dt*tt);  // step&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The animation of solution is presented below. The complete exampe is avalible at  [https://gitlab.com/e62Lab/medusa/tree/dev/examples/wave_equation wave_equation_2D.cpp]. &lt;br /&gt;
&lt;br /&gt;
[[File:EM_wave_2d_dt_e-6_dens40_omega128_v8 2X speed.mp4|400px]]&lt;br /&gt;
&lt;br /&gt;
== 2D time-domain acoustic wave propagation in heterogeneous media ==&lt;br /&gt;
We also solved wave equation in context of acoustic wave propagation in seismic modeling in the Earth’s subsurface (see related paper [https://e6.ijs.si/ParallelAndDistributedSystems/publications/62417923.pdf J. Močnik Berljavac, P. Mishra, J. Slak, G. Kosec; RBF-FD analysis of 2D time-domain acoustic wave propagation in heterogeneous media, Computers &amp;amp; Geosciences, 2021 [DOI: 10.1016/j.cageo.2021.104796]]. And some highlights from the paper&lt;br /&gt;
&lt;br /&gt;
[[File:wave_mormosi.png]]&lt;/div&gt;</summary>
		<author><name>E6WikiAdmin</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=File:Wave_mormosi.png&amp;diff=3524</id>
		<title>File:Wave mormosi.png</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=File:Wave_mormosi.png&amp;diff=3524"/>
				<updated>2022-12-04T19:41:41Z</updated>
		
		<summary type="html">&lt;p&gt;E6WikiAdmin: File uploaded with MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>E6WikiAdmin</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=Wave_equation&amp;diff=3523</id>
		<title>Wave equation</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=Wave_equation&amp;diff=3523"/>
				<updated>2022-12-04T19:41:40Z</updated>
		
		<summary type="html">&lt;p&gt;E6WikiAdmin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Box-round|title= Related papers |&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/62417923.pdf J. Močnik Berljavac, P. Mishra, J. Slak, G. Kosec; RBF-FD analysis of 2D time-domain acoustic wave propagation in heterogeneous media, Computers &amp;amp; Geosciences, 2021 [DOI: 10.1016/j.cageo.2021.104796]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
== 2D wave equation with Dirichlet boundary conditions ==&lt;br /&gt;
We are solving a problem analogous to a clamped circular membrane being forced to oscillate by fixing its centre to a rigid oscillating rod.  The domain of calculation is for this reason an annulus bounded by the point of contact with the circular source in the centre and the clamped edge of the circular membrane.&lt;br /&gt;
&lt;br /&gt;
[[File:wave_2d_domain_geo.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
Consider the time dependent solution to 2D wave equation on annulus shaped domain&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
    	\frac{ \partial^2 u}{\partial t^2} &amp;amp;= c^2 \nabla^2 u  &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
         u(r,t=0)&amp;amp;=0 &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
    	  u &amp;amp;= 0           &amp;amp;&amp;amp;\text{on } \partial \Omega_O,\\&lt;br /&gt;
          u &amp;amp;= f(t)           &amp;amp;&amp;amp;\text{on } \partial \Omega_I,&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where $\partial\Omega_I$ denotes the inner and $\partial\Omega_O$ the outer boundary of the domain. Through the  boundary condition on the inner boundary the source is introduced to the problem as a function of time&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
f(t)= u_o \sin \omega_o t.&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First the domain is constructed by subtracting a smaller circle domain from a larger one. Boundaries of the domain are populated in the same step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// // identifier to be added to nodes on the inner boundary&lt;br /&gt;
int CENTRE = -10;&lt;br /&gt;
&lt;br /&gt;
 // build circle domain&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; domain({0, 0}, outer_radius);&lt;br /&gt;
auto discretization = domain.discretizeBoundaryWithStep(dx);&lt;br /&gt;
&lt;br /&gt;
// build source domain&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; empty({0, 0}, inner_radius);&lt;br /&gt;
auto discretization_empty = empty.discretizeBoundaryWithStep(dx, CENTRE);  &lt;br /&gt;
    &lt;br /&gt;
// substract the source domain&lt;br /&gt;
discretization -= discretization_empty;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next the domain is populated with nodes in accordance with the desired density function. Once the domain is constructed and discretized, the support (neighborhood) of $n$ nodes is found  for each node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GeneralFill&amp;lt;Vec2d&amp;gt; fill;&lt;br /&gt;
fill.seed(fill_seed);&lt;br /&gt;
discretization.fill(fill, fill_density);&lt;br /&gt;
&lt;br /&gt;
 // find support&lt;br /&gt;
FindClosest find_support(n);&lt;br /&gt;
discretization.findSupport(find_support);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The density function &amp;quot;fill_density&amp;quot; takes as argument the coordinates inside the domain and returns the desired distance between neighboring nodes for that location.&lt;br /&gt;
Now the domain preparation is complete, as domain is constructed and populated with nodes with support relations established. We continue by constructing the approximation engine.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
WLS&amp;lt;Monomials&amp;lt;Vec2d&amp;gt;, GaussianWeight&amp;lt;Vec2d&amp;gt;, ScaleToClosest&amp;gt; approx(m - 1 , sigma);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we are solving a time propagation problem implicitly, we will have to solve a system of equations for every time step. This is equivalent to solving a matrix equation. For this reason a space matrix is constructed. Next the wave equation is turned into code. Medusa encodes this information inside the just constructed matrix $M$. $E1$ and $E0$ represent the known solutions on previous two time steps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
SparseMatrix&amp;lt;double&amp;gt; M(domain_size, domain_size);&lt;br /&gt;
// Set equation on interior&lt;br /&gt;
for (int i : interior) {&lt;br /&gt;
    -(v*v*dt*dt) * op.lap(i) + op.value(i)= 2*E1(i)-E0(i);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Same is done also for the boundary nodes. Since dirichlet boundary conditions are employed the values of the Right Hand Side ($rhs$) of matrix equation are just set to prescribed values ($0$ on the outer boundary and $f(t)$ on inner boundary).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// Set boundary conditions&lt;br /&gt;
for (int i : boundary) {&lt;br /&gt;
    if (discretization.types()[i] == CENTRE) {&lt;br /&gt;
        op.value(i) = A * std::sin(omega*dt*2);  // step&lt;br /&gt;
    } else {&lt;br /&gt;
        op.value(i) = 0.0;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
At each time step the matrix equation is solved  using an Eigen linear equation solver, in this case, the BiCGStab algorithm. $E0$ and $E1$ are updated and the source is set to new value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
 // Solve matrix system&lt;br /&gt;
VectorXd E2 = solver.solve(rhs);&lt;br /&gt;
&lt;br /&gt;
// Update previous states&lt;br /&gt;
E0 = E1;&lt;br /&gt;
E1 = E2;&lt;br /&gt;
&lt;br /&gt;
 // Update rhs on interior&lt;br /&gt;
for (int i : interior) {&lt;br /&gt;
    rhs(i) = 2*E1(i)-E0(i);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Update rhs on boundary&lt;br /&gt;
for (int i : (discretization.types() == CENTRE)) {&lt;br /&gt;
    rhs(i) = A * std::sin(omega*dt*tt);  // step&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The animation of solution is presented below. The complete exampe is avalible at  [https://gitlab.com/e62Lab/medusa/tree/dev/examples/wave_equation wave_equation_2D.cpp]. &lt;br /&gt;
&lt;br /&gt;
[[File:EM_wave_2d_dt_e-6_dens40_omega128_v8 2X speed.mp4|400px]]&lt;br /&gt;
&lt;br /&gt;
== 2D time-domain acoustic wave propagation in heterogeneous media ==&lt;br /&gt;
We also solved wave equation in context of acoustic wave propagation in seismic modeling in the Earth’s subsurface (see related paper [https://e6.ijs.si/ParallelAndDistributedSystems/publications/62417923.pdf J. Močnik Berljavac, P. Mishra, J. Slak, G. Kosec; RBF-FD analysis of 2D time-domain acoustic wave propagation in heterogeneous media, Computers &amp;amp; Geosciences, 2021 [DOI: 10.1016/j.cageo.2021.104796]]. And some highlights from the paper&lt;/div&gt;</summary>
		<author><name>E6WikiAdmin</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=Wave_equation&amp;diff=3522</id>
		<title>Wave equation</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=Wave_equation&amp;diff=3522"/>
				<updated>2022-12-04T19:39:30Z</updated>
		
		<summary type="html">&lt;p&gt;E6WikiAdmin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Box-round|title= Related papers |&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/62417923.pdf J. Močnik Berljavac, P. Mishra, J. Slak, G. Kosec; RBF-FD analysis of 2D time-domain acoustic wave propagation in heterogeneous media, Computers &amp;amp; Geosciences, 2021 [DOI: 10.1016/j.cageo.2021.104796]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
== 2D wave equation with Dirichlet boundary conditions ==&lt;br /&gt;
We are solving a problem analogous to a clamped circular membrane being forced to oscillate by fixing its centre to a rigid oscillating rod.  The domain of calculation is for this reason an annulus bounded by the point of contact with the circular source in the centre and the clamped edge of the circular membrane.&lt;br /&gt;
&lt;br /&gt;
[[File:wave_2d_domain_geo.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
Consider the time dependent solution to 2D wave equation on annulus shaped domain&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
    	\frac{ \partial^2 u}{\partial t^2} &amp;amp;= c^2 \nabla^2 u  &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
         u(r,t=0)&amp;amp;=0 &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
    	  u &amp;amp;= 0           &amp;amp;&amp;amp;\text{on } \partial \Omega_O,\\&lt;br /&gt;
          u &amp;amp;= f(t)           &amp;amp;&amp;amp;\text{on } \partial \Omega_I,&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where $\partial\Omega_I$ denotes the inner and $\partial\Omega_O$ the outer boundary of the domain. Through the  boundary condition on the inner boundary the source is introduced to the problem as a function of time&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
f(t)= u_o \sin \omega_o t.&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First the domain is constructed by subtracting a smaller circle domain from a larger one. Boundaries of the domain are populated in the same step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// // identifier to be added to nodes on the inner boundary&lt;br /&gt;
int CENTRE = -10;&lt;br /&gt;
&lt;br /&gt;
 // build circle domain&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; domain({0, 0}, outer_radius);&lt;br /&gt;
auto discretization = domain.discretizeBoundaryWithStep(dx);&lt;br /&gt;
&lt;br /&gt;
// build source domain&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; empty({0, 0}, inner_radius);&lt;br /&gt;
auto discretization_empty = empty.discretizeBoundaryWithStep(dx, CENTRE);  &lt;br /&gt;
    &lt;br /&gt;
// substract the source domain&lt;br /&gt;
discretization -= discretization_empty;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next the domain is populated with nodes in accordance with the desired density function. Once the domain is constructed and discretized, the support (neighborhood) of $n$ nodes is found  for each node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GeneralFill&amp;lt;Vec2d&amp;gt; fill;&lt;br /&gt;
fill.seed(fill_seed);&lt;br /&gt;
discretization.fill(fill, fill_density);&lt;br /&gt;
&lt;br /&gt;
 // find support&lt;br /&gt;
FindClosest find_support(n);&lt;br /&gt;
discretization.findSupport(find_support);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The density function &amp;quot;fill_density&amp;quot; takes as argument the coordinates inside the domain and returns the desired distance between neighboring nodes for that location.&lt;br /&gt;
Now the domain preparation is complete, as domain is constructed and populated with nodes with support relations established. We continue by constructing the approximation engine.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
WLS&amp;lt;Monomials&amp;lt;Vec2d&amp;gt;, GaussianWeight&amp;lt;Vec2d&amp;gt;, ScaleToClosest&amp;gt; approx(m - 1 , sigma);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we are solving a time propagation problem implicitly, we will have to solve a system of equations for every time step. This is equivalent to solving a matrix equation. For this reason a space matrix is constructed. Next the wave equation is turned into code. Medusa encodes this information inside the just constructed matrix $M$. $E1$ and $E0$ represent the known solutions on previous two time steps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
SparseMatrix&amp;lt;double&amp;gt; M(domain_size, domain_size);&lt;br /&gt;
// Set equation on interior&lt;br /&gt;
for (int i : interior) {&lt;br /&gt;
    -(v*v*dt*dt) * op.lap(i) + op.value(i)= 2*E1(i)-E0(i);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Same is done also for the boundary nodes. Since dirichlet boundary conditions are employed the values of the Right Hand Side ($rhs$) of matrix equation are just set to prescribed values ($0$ on the outer boundary and $f(t)$ on inner boundary).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// Set boundary conditions&lt;br /&gt;
for (int i : boundary) {&lt;br /&gt;
    if (discretization.types()[i] == CENTRE) {&lt;br /&gt;
        op.value(i) = A * std::sin(omega*dt*2);  // step&lt;br /&gt;
    } else {&lt;br /&gt;
        op.value(i) = 0.0;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
At each time step the matrix equation is solved  using an Eigen linear equation solver, in this case, the BiCGStab algorithm. $E0$ and $E1$ are updated and the source is set to new value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
 // Solve matrix system&lt;br /&gt;
VectorXd E2 = solver.solve(rhs);&lt;br /&gt;
&lt;br /&gt;
// Update previous states&lt;br /&gt;
E0 = E1;&lt;br /&gt;
E1 = E2;&lt;br /&gt;
&lt;br /&gt;
 // Update rhs on interior&lt;br /&gt;
for (int i : interior) {&lt;br /&gt;
    rhs(i) = 2*E1(i)-E0(i);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Update rhs on boundary&lt;br /&gt;
for (int i : (discretization.types() == CENTRE)) {&lt;br /&gt;
    rhs(i) = A * std::sin(omega*dt*tt);  // step&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The animation of solution is presented below. The complete exampe is avalible at  [https://gitlab.com/e62Lab/medusa/tree/dev/examples/wave_equation wave_equation_2D.cpp]. &lt;br /&gt;
&lt;br /&gt;
[[File:EM_wave_2d_dt_e-6_dens40_omega128_v8 2X speed.mp4|400px]]&lt;br /&gt;
&lt;br /&gt;
== 2D time-domain acoustic wave propagation in heterogeneous media ==&lt;br /&gt;
We also solved wave equation in context of acoustic wave propagation in seismic modeling in the Earth’s subsurface (see related paper [https://e6.ijs.si/ParallelAndDistributedSystems/publications/62417923.pdf J. Močnik Berljavac, P. Mishra, J. Slak, G. Kosec; RBF-FD analysis of 2D time-domain acoustic wave propagation in heterogeneous media, Computers &amp;amp; Geosciences, 2021 [DOI: 10.1016/j.cageo.2021.104796]].&lt;/div&gt;</summary>
		<author><name>E6WikiAdmin</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=Wave_equation&amp;diff=3521</id>
		<title>Wave equation</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=Wave_equation&amp;diff=3521"/>
				<updated>2022-12-04T19:17:10Z</updated>
		
		<summary type="html">&lt;p&gt;E6WikiAdmin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Box-round|title= Related papers |&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/62417923.pdf J. Močnik Berljavac, P. Mishra, J. Slak, G. Kosec; RBF-FD analysis of 2D time-domain acoustic wave propagation in heterogeneous media, Computers &amp;amp; Geosciences, 2021 [DOI: 10.1016/j.cageo.2021.104796]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
== 2D wave equation with Dirichlet boundary conditions ==&lt;br /&gt;
We are solving a problem analogous to a clamped circular membrane being forced to oscillate by fixing its centre to a rigid oscillating rod.  The domain of calculation is for this reason an annulus bounded by the point of contact with the circular source in the centre and the clamped edge of the circular membrane.&lt;br /&gt;
&lt;br /&gt;
[[File:wave_2d_domain_geo.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
Consider the time dependent solution to 2D wave equation on annulus shaped domain&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
    	\frac{ \partial^2 u}{\partial t^2} &amp;amp;= c^2 \nabla^2 u  &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
         u(r,t=0)&amp;amp;=0 &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
    	  u &amp;amp;= 0           &amp;amp;&amp;amp;\text{on } \partial \Omega_O,\\&lt;br /&gt;
          u &amp;amp;= f(t)           &amp;amp;&amp;amp;\text{on } \partial \Omega_I,&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where $\partial\Omega_I$ denotes the inner and $\partial\Omega_O$ the outer boundary of the domain. Through the  boundary condition on the inner boundary the source is introduced to the problem as a function of time&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
f(t)= u_o \sin \omega_o t.&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First the domain is constructed by subtracting a smaller circle domain from a larger one. Boundaries of the domain are populated in the same step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// // identifier to be added to nodes on the inner boundary&lt;br /&gt;
int CENTRE = -10;&lt;br /&gt;
&lt;br /&gt;
 // build circle domain&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; domain({0, 0}, outer_radius);&lt;br /&gt;
auto discretization = domain.discretizeBoundaryWithStep(dx);&lt;br /&gt;
&lt;br /&gt;
// build source domain&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; empty({0, 0}, inner_radius);&lt;br /&gt;
auto discretization_empty = empty.discretizeBoundaryWithStep(dx, CENTRE);  &lt;br /&gt;
    &lt;br /&gt;
// substract the source domain&lt;br /&gt;
discretization -= discretization_empty;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next the domain is populated with nodes in accordance with the desired density function. Once the domain is constructed and discretized, the support (neighborhood) of $n$ nodes is found  for each node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GeneralFill&amp;lt;Vec2d&amp;gt; fill;&lt;br /&gt;
fill.seed(fill_seed);&lt;br /&gt;
discretization.fill(fill, fill_density);&lt;br /&gt;
&lt;br /&gt;
 // find support&lt;br /&gt;
FindClosest find_support(n);&lt;br /&gt;
discretization.findSupport(find_support);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The density function &amp;quot;fill_density&amp;quot; takes as argument the coordinates inside the domain and returns the desired distance between neighboring nodes for that location.&lt;br /&gt;
Now the domain preparation is complete, as domain is constructed and populated with nodes with support relations established. We continue by constructing the approximation engine.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
WLS&amp;lt;Monomials&amp;lt;Vec2d&amp;gt;, GaussianWeight&amp;lt;Vec2d&amp;gt;, ScaleToClosest&amp;gt; approx(m - 1 , sigma);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we are solving a time propagation problem implicitly, we will have to solve a system of equations for every time step. This is equivalent to solving a matrix equation. For this reason a space matrix is constructed. Next the wave equation is turned into code. Medusa encodes this information inside the just constructed matrix $M$. $E1$ and $E0$ represent the known solutions on previous two time steps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
SparseMatrix&amp;lt;double&amp;gt; M(domain_size, domain_size);&lt;br /&gt;
// Set equation on interior&lt;br /&gt;
for (int i : interior) {&lt;br /&gt;
    -(v*v*dt*dt) * op.lap(i) + op.value(i)= 2*E1(i)-E0(i);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Same is done also for the boundary nodes. Since dirichlet boundary conditions are employed the values of the Right Hand Side ($rhs$) of matrix equation are just set to prescribed values ($0$ on the outer boundary and $f(t)$ on inner boundary).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// Set boundary conditions&lt;br /&gt;
for (int i : boundary) {&lt;br /&gt;
    if (discretization.types()[i] == CENTRE) {&lt;br /&gt;
        op.value(i) = A * std::sin(omega*dt*2);  // step&lt;br /&gt;
    } else {&lt;br /&gt;
        op.value(i) = 0.0;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
At each time step the matrix equation is solved  using an Eigen linear equation solver, in this case, the BiCGStab algorithm. $E0$ and $E1$ are updated and the source is set to new value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
 // Solve matrix system&lt;br /&gt;
VectorXd E2 = solver.solve(rhs);&lt;br /&gt;
&lt;br /&gt;
// Update previous states&lt;br /&gt;
E0 = E1;&lt;br /&gt;
E1 = E2;&lt;br /&gt;
&lt;br /&gt;
 // Update rhs on interior&lt;br /&gt;
for (int i : interior) {&lt;br /&gt;
    rhs(i) = 2*E1(i)-E0(i);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Update rhs on boundary&lt;br /&gt;
for (int i : (discretization.types() == CENTRE)) {&lt;br /&gt;
    rhs(i) = A * std::sin(omega*dt*tt);  // step&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The animation of solution is presented below. The complete exampe is avalible at  [https://gitlab.com/e62Lab/medusa/tree/dev/examples/wave_equation wave_equation_2D.cpp]. &lt;br /&gt;
&lt;br /&gt;
[[File:EM_wave_2d_dt_e-6_dens40_omega128_v8 2X speed.mp4|400px]]&lt;br /&gt;
&lt;br /&gt;
== 2D time-domain acoustic wave propagation in heterogeneous media ==&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>E6WikiAdmin</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=Wave_equation&amp;diff=3520</id>
		<title>Wave equation</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=Wave_equation&amp;diff=3520"/>
				<updated>2022-12-04T19:16:01Z</updated>
		
		<summary type="html">&lt;p&gt;E6WikiAdmin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Box-round|title= Related papers |&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/62417923.pdf J. Močnik Berljavac, P. Mishra, J. Slak, G. Kosec; RBF-FD analysis of 2D time-domain acoustic wave propagation in heterogeneous media, Computers &amp;amp; Geosciences, 2021 [DOI: 10.1016/j.cageo.2021.104796]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
== 2D wave equation with Dirichlet boundary conditions ==&lt;br /&gt;
We are solving a problem analogous to a clamped circular membrane being forced to oscillate by fixing its centre to a rigid oscillating rod.  The domain of calculation is for this reason an annulus bounded by the point of contact with the circular source in the centre and the clamped edge of the circular membrane.&lt;br /&gt;
&lt;br /&gt;
[[File:wave_2d_domain_geo.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
Consider the time dependent solution to 2D wave equation on annulus shaped domain&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
    	\frac{ \partial^2 u}{\partial t^2} &amp;amp;= c^2 \nabla^2 u  &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
         u(r,t=0)&amp;amp;=0 &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
    	  u &amp;amp;= 0           &amp;amp;&amp;amp;\text{on } \partial \Omega_O,\\&lt;br /&gt;
          u &amp;amp;= f(t)           &amp;amp;&amp;amp;\text{on } \partial \Omega_I,&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where $\partial\Omega_I$ denotes the inner and $\partial\Omega_O$ the outer boundary of the domain. Through the  boundary condition on the inner boundary the source is introduced to the problem as a function of time&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
f(t)= u_o \sin \omega_o t.&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First the domain is constructed by subtracting a smaller circle domain from a larger one. Boundaries of the domain are populated in the same step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// // identifier to be added to nodes on the inner boundary&lt;br /&gt;
int CENTRE = -10;&lt;br /&gt;
&lt;br /&gt;
 // build circle domain&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; domain({0, 0}, outer_radius);&lt;br /&gt;
auto discretization = domain.discretizeBoundaryWithStep(dx);&lt;br /&gt;
&lt;br /&gt;
// build source domain&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; empty({0, 0}, inner_radius);&lt;br /&gt;
auto discretization_empty = empty.discretizeBoundaryWithStep(dx, CENTRE);  &lt;br /&gt;
    &lt;br /&gt;
// substract the source domain&lt;br /&gt;
discretization -= discretization_empty;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next the domain is populated with nodes in accordance with the desired density function. Once the domain is constructed and discretized, the support (neighborhood) of $n$ nodes is found  for each node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GeneralFill&amp;lt;Vec2d&amp;gt; fill;&lt;br /&gt;
fill.seed(fill_seed);&lt;br /&gt;
discretization.fill(fill, fill_density);&lt;br /&gt;
&lt;br /&gt;
 // find support&lt;br /&gt;
FindClosest find_support(n);&lt;br /&gt;
discretization.findSupport(find_support);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The density function &amp;quot;fill_density&amp;quot; takes as argument the coordinates inside the domain and returns the desired distance between neighboring nodes for that location.&lt;br /&gt;
Now the domain preparation is complete, as domain is constructed and populated with nodes with support relations established. We continue by constructing the approximation engine.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
WLS&amp;lt;Monomials&amp;lt;Vec2d&amp;gt;, GaussianWeight&amp;lt;Vec2d&amp;gt;, ScaleToClosest&amp;gt; approx(m - 1 , sigma);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we are solving a time propagation problem implicitly, we will have to solve a system of equations for every time step. This is equivalent to solving a matrix equation. For this reason a space matrix is constructed. Next the wave equation is turned into code. Medusa encodes this information inside the just constructed matrix $M$. $E1$ and $E0$ represent the known solutions on previous two time steps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
SparseMatrix&amp;lt;double&amp;gt; M(domain_size, domain_size);&lt;br /&gt;
// Set equation on interior&lt;br /&gt;
for (int i : interior) {&lt;br /&gt;
    -(v*v*dt*dt) * op.lap(i) + op.value(i)= 2*E1(i)-E0(i);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Same is done also for the boundary nodes. Since dirichlet boundary conditions are employed the values of the Right Hand Side ($rhs$) of matrix equation are just set to prescribed values ($0$ on the outer boundary and $f(t)$ on inner boundary).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// Set boundary conditions&lt;br /&gt;
for (int i : boundary) {&lt;br /&gt;
    if (discretization.types()[i] == CENTRE) {&lt;br /&gt;
        op.value(i) = A * std::sin(omega*dt*2);  // step&lt;br /&gt;
    } else {&lt;br /&gt;
        op.value(i) = 0.0;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
At each time step the matrix equation is solved  using an Eigen linear equation solver, in this case, the BiCGStab algorithm. $E0$ and $E1$ are updated and the source is set to new value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
 // Solve matrix system&lt;br /&gt;
VectorXd E2 = solver.solve(rhs);&lt;br /&gt;
&lt;br /&gt;
// Update previous states&lt;br /&gt;
E0 = E1;&lt;br /&gt;
E1 = E2;&lt;br /&gt;
&lt;br /&gt;
 // Update rhs on interior&lt;br /&gt;
for (int i : interior) {&lt;br /&gt;
    rhs(i) = 2*E1(i)-E0(i);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Update rhs on boundary&lt;br /&gt;
for (int i : (discretization.types() == CENTRE)) {&lt;br /&gt;
    rhs(i) = A * std::sin(omega*dt*tt);  // step&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The animation of solution is presented below. The complete exampe is avalible at  [https://gitlab.com/e62Lab/medusa/tree/dev/examples/wave_equation wave_equation_2D.cpp]. &lt;br /&gt;
&lt;br /&gt;
[[File:EM_wave_2d_dt_e-6_dens40_omega128_v8 2X speed.mp4|400px]]&lt;br /&gt;
&lt;br /&gt;
== 2D time-domain acoustic wave propagation in heterogeneous media ==&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>E6WikiAdmin</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=Wave_equation&amp;diff=3519</id>
		<title>Wave equation</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=Wave_equation&amp;diff=3519"/>
				<updated>2022-12-04T19:15:50Z</updated>
		
		<summary type="html">&lt;p&gt;E6WikiAdmin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Box-round|title= Related papers |&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
== 2D wave equation with Dirichlet boundary conditions ==&lt;br /&gt;
We are solving a problem analogous to a clamped circular membrane being forced to oscillate by fixing its centre to a rigid oscillating rod.  The domain of calculation is for this reason an annulus bounded by the point of contact with the circular source in the centre and the clamped edge of the circular membrane.&lt;br /&gt;
&lt;br /&gt;
[[File:wave_2d_domain_geo.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
Consider the time dependent solution to 2D wave equation on annulus shaped domain&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
    	\frac{ \partial^2 u}{\partial t^2} &amp;amp;= c^2 \nabla^2 u  &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
         u(r,t=0)&amp;amp;=0 &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
    	  u &amp;amp;= 0           &amp;amp;&amp;amp;\text{on } \partial \Omega_O,\\&lt;br /&gt;
          u &amp;amp;= f(t)           &amp;amp;&amp;amp;\text{on } \partial \Omega_I,&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where $\partial\Omega_I$ denotes the inner and $\partial\Omega_O$ the outer boundary of the domain. Through the  boundary condition on the inner boundary the source is introduced to the problem as a function of time&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
f(t)= u_o \sin \omega_o t.&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First the domain is constructed by subtracting a smaller circle domain from a larger one. Boundaries of the domain are populated in the same step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// // identifier to be added to nodes on the inner boundary&lt;br /&gt;
int CENTRE = -10;&lt;br /&gt;
&lt;br /&gt;
 // build circle domain&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; domain({0, 0}, outer_radius);&lt;br /&gt;
auto discretization = domain.discretizeBoundaryWithStep(dx);&lt;br /&gt;
&lt;br /&gt;
// build source domain&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; empty({0, 0}, inner_radius);&lt;br /&gt;
auto discretization_empty = empty.discretizeBoundaryWithStep(dx, CENTRE);  &lt;br /&gt;
    &lt;br /&gt;
// substract the source domain&lt;br /&gt;
discretization -= discretization_empty;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next the domain is populated with nodes in accordance with the desired density function. Once the domain is constructed and discretized, the support (neighborhood) of $n$ nodes is found  for each node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GeneralFill&amp;lt;Vec2d&amp;gt; fill;&lt;br /&gt;
fill.seed(fill_seed);&lt;br /&gt;
discretization.fill(fill, fill_density);&lt;br /&gt;
&lt;br /&gt;
 // find support&lt;br /&gt;
FindClosest find_support(n);&lt;br /&gt;
discretization.findSupport(find_support);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The density function &amp;quot;fill_density&amp;quot; takes as argument the coordinates inside the domain and returns the desired distance between neighboring nodes for that location.&lt;br /&gt;
Now the domain preparation is complete, as domain is constructed and populated with nodes with support relations established. We continue by constructing the approximation engine.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
WLS&amp;lt;Monomials&amp;lt;Vec2d&amp;gt;, GaussianWeight&amp;lt;Vec2d&amp;gt;, ScaleToClosest&amp;gt; approx(m - 1 , sigma);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we are solving a time propagation problem implicitly, we will have to solve a system of equations for every time step. This is equivalent to solving a matrix equation. For this reason a space matrix is constructed. Next the wave equation is turned into code. Medusa encodes this information inside the just constructed matrix $M$. $E1$ and $E0$ represent the known solutions on previous two time steps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
SparseMatrix&amp;lt;double&amp;gt; M(domain_size, domain_size);&lt;br /&gt;
// Set equation on interior&lt;br /&gt;
for (int i : interior) {&lt;br /&gt;
    -(v*v*dt*dt) * op.lap(i) + op.value(i)= 2*E1(i)-E0(i);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Same is done also for the boundary nodes. Since dirichlet boundary conditions are employed the values of the Right Hand Side ($rhs$) of matrix equation are just set to prescribed values ($0$ on the outer boundary and $f(t)$ on inner boundary).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// Set boundary conditions&lt;br /&gt;
for (int i : boundary) {&lt;br /&gt;
    if (discretization.types()[i] == CENTRE) {&lt;br /&gt;
        op.value(i) = A * std::sin(omega*dt*2);  // step&lt;br /&gt;
    } else {&lt;br /&gt;
        op.value(i) = 0.0;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
At each time step the matrix equation is solved  using an Eigen linear equation solver, in this case, the BiCGStab algorithm. $E0$ and $E1$ are updated and the source is set to new value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
 // Solve matrix system&lt;br /&gt;
VectorXd E2 = solver.solve(rhs);&lt;br /&gt;
&lt;br /&gt;
// Update previous states&lt;br /&gt;
E0 = E1;&lt;br /&gt;
E1 = E2;&lt;br /&gt;
&lt;br /&gt;
 // Update rhs on interior&lt;br /&gt;
for (int i : interior) {&lt;br /&gt;
    rhs(i) = 2*E1(i)-E0(i);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Update rhs on boundary&lt;br /&gt;
for (int i : (discretization.types() == CENTRE)) {&lt;br /&gt;
    rhs(i) = A * std::sin(omega*dt*tt);  // step&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The animation of solution is presented below. The complete exampe is avalible at  [https://gitlab.com/e62Lab/medusa/tree/dev/examples/wave_equation wave_equation_2D.cpp]. &lt;br /&gt;
&lt;br /&gt;
[[File:EM_wave_2d_dt_e-6_dens40_omega128_v8 2X speed.mp4|400px]]&lt;br /&gt;
&lt;br /&gt;
== 2D time-domain acoustic wave propagation in heterogeneous media ==&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>E6WikiAdmin</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=Wave_equation&amp;diff=3518</id>
		<title>Wave equation</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=Wave_equation&amp;diff=3518"/>
				<updated>2022-12-04T19:15:21Z</updated>
		
		<summary type="html">&lt;p&gt;E6WikiAdmin: /* 2D time-domain acoustic wave propagation in heterogeneous media */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
== 2D wave equation with Dirichlet boundary conditions ==&lt;br /&gt;
We are solving a problem analogous to a clamped circular membrane being forced to oscillate by fixing its centre to a rigid oscillating rod.  The domain of calculation is for this reason an annulus bounded by the point of contact with the circular source in the centre and the clamped edge of the circular membrane.&lt;br /&gt;
&lt;br /&gt;
[[File:wave_2d_domain_geo.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
Consider the time dependent solution to 2D wave equation on annulus shaped domain&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
    	\frac{ \partial^2 u}{\partial t^2} &amp;amp;= c^2 \nabla^2 u  &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
         u(r,t=0)&amp;amp;=0 &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
    	  u &amp;amp;= 0           &amp;amp;&amp;amp;\text{on } \partial \Omega_O,\\&lt;br /&gt;
          u &amp;amp;= f(t)           &amp;amp;&amp;amp;\text{on } \partial \Omega_I,&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where $\partial\Omega_I$ denotes the inner and $\partial\Omega_O$ the outer boundary of the domain. Through the  boundary condition on the inner boundary the source is introduced to the problem as a function of time&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
f(t)= u_o \sin \omega_o t.&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First the domain is constructed by subtracting a smaller circle domain from a larger one. Boundaries of the domain are populated in the same step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// // identifier to be added to nodes on the inner boundary&lt;br /&gt;
int CENTRE = -10;&lt;br /&gt;
&lt;br /&gt;
 // build circle domain&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; domain({0, 0}, outer_radius);&lt;br /&gt;
auto discretization = domain.discretizeBoundaryWithStep(dx);&lt;br /&gt;
&lt;br /&gt;
// build source domain&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; empty({0, 0}, inner_radius);&lt;br /&gt;
auto discretization_empty = empty.discretizeBoundaryWithStep(dx, CENTRE);  &lt;br /&gt;
    &lt;br /&gt;
// substract the source domain&lt;br /&gt;
discretization -= discretization_empty;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next the domain is populated with nodes in accordance with the desired density function. Once the domain is constructed and discretized, the support (neighborhood) of $n$ nodes is found  for each node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GeneralFill&amp;lt;Vec2d&amp;gt; fill;&lt;br /&gt;
fill.seed(fill_seed);&lt;br /&gt;
discretization.fill(fill, fill_density);&lt;br /&gt;
&lt;br /&gt;
 // find support&lt;br /&gt;
FindClosest find_support(n);&lt;br /&gt;
discretization.findSupport(find_support);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The density function &amp;quot;fill_density&amp;quot; takes as argument the coordinates inside the domain and returns the desired distance between neighboring nodes for that location.&lt;br /&gt;
Now the domain preparation is complete, as domain is constructed and populated with nodes with support relations established. We continue by constructing the approximation engine.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
WLS&amp;lt;Monomials&amp;lt;Vec2d&amp;gt;, GaussianWeight&amp;lt;Vec2d&amp;gt;, ScaleToClosest&amp;gt; approx(m - 1 , sigma);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we are solving a time propagation problem implicitly, we will have to solve a system of equations for every time step. This is equivalent to solving a matrix equation. For this reason a space matrix is constructed. Next the wave equation is turned into code. Medusa encodes this information inside the just constructed matrix $M$. $E1$ and $E0$ represent the known solutions on previous two time steps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
SparseMatrix&amp;lt;double&amp;gt; M(domain_size, domain_size);&lt;br /&gt;
// Set equation on interior&lt;br /&gt;
for (int i : interior) {&lt;br /&gt;
    -(v*v*dt*dt) * op.lap(i) + op.value(i)= 2*E1(i)-E0(i);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Same is done also for the boundary nodes. Since dirichlet boundary conditions are employed the values of the Right Hand Side ($rhs$) of matrix equation are just set to prescribed values ($0$ on the outer boundary and $f(t)$ on inner boundary).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// Set boundary conditions&lt;br /&gt;
for (int i : boundary) {&lt;br /&gt;
    if (discretization.types()[i] == CENTRE) {&lt;br /&gt;
        op.value(i) = A * std::sin(omega*dt*2);  // step&lt;br /&gt;
    } else {&lt;br /&gt;
        op.value(i) = 0.0;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
At each time step the matrix equation is solved  using an Eigen linear equation solver, in this case, the BiCGStab algorithm. $E0$ and $E1$ are updated and the source is set to new value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
 // Solve matrix system&lt;br /&gt;
VectorXd E2 = solver.solve(rhs);&lt;br /&gt;
&lt;br /&gt;
// Update previous states&lt;br /&gt;
E0 = E1;&lt;br /&gt;
E1 = E2;&lt;br /&gt;
&lt;br /&gt;
 // Update rhs on interior&lt;br /&gt;
for (int i : interior) {&lt;br /&gt;
    rhs(i) = 2*E1(i)-E0(i);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Update rhs on boundary&lt;br /&gt;
for (int i : (discretization.types() == CENTRE)) {&lt;br /&gt;
    rhs(i) = A * std::sin(omega*dt*tt);  // step&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The animation of solution is presented below. The complete exampe is avalible at  [https://gitlab.com/e62Lab/medusa/tree/dev/examples/wave_equation wave_equation_2D.cpp]. &lt;br /&gt;
&lt;br /&gt;
[[File:EM_wave_2d_dt_e-6_dens40_omega128_v8 2X speed.mp4|400px]]&lt;br /&gt;
&lt;br /&gt;
== 2D time-domain acoustic wave propagation in heterogeneous media ==&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
{{Box-round|title= Related papers |&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/62417923.pdf J. Močnik Berljavac, P. Mishra, J. Slak, G. Kosec; RBF-FD analysis of 2D time-domain acoustic wave propagation in heterogeneous media, Computers &amp;amp; Geosciences, 2021 [DOI: 10.1016/j.cageo.2021.104796]]&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>E6WikiAdmin</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=Wave_equation&amp;diff=3517</id>
		<title>Wave equation</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=Wave_equation&amp;diff=3517"/>
				<updated>2022-12-04T19:14:44Z</updated>
		
		<summary type="html">&lt;p&gt;E6WikiAdmin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
== 2D wave equation with Dirichlet boundary conditions ==&lt;br /&gt;
We are solving a problem analogous to a clamped circular membrane being forced to oscillate by fixing its centre to a rigid oscillating rod.  The domain of calculation is for this reason an annulus bounded by the point of contact with the circular source in the centre and the clamped edge of the circular membrane.&lt;br /&gt;
&lt;br /&gt;
[[File:wave_2d_domain_geo.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
Consider the time dependent solution to 2D wave equation on annulus shaped domain&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
    	\frac{ \partial^2 u}{\partial t^2} &amp;amp;= c^2 \nabla^2 u  &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
         u(r,t=0)&amp;amp;=0 &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
    	  u &amp;amp;= 0           &amp;amp;&amp;amp;\text{on } \partial \Omega_O,\\&lt;br /&gt;
          u &amp;amp;= f(t)           &amp;amp;&amp;amp;\text{on } \partial \Omega_I,&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where $\partial\Omega_I$ denotes the inner and $\partial\Omega_O$ the outer boundary of the domain. Through the  boundary condition on the inner boundary the source is introduced to the problem as a function of time&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
f(t)= u_o \sin \omega_o t.&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First the domain is constructed by subtracting a smaller circle domain from a larger one. Boundaries of the domain are populated in the same step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// // identifier to be added to nodes on the inner boundary&lt;br /&gt;
int CENTRE = -10;&lt;br /&gt;
&lt;br /&gt;
 // build circle domain&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; domain({0, 0}, outer_radius);&lt;br /&gt;
auto discretization = domain.discretizeBoundaryWithStep(dx);&lt;br /&gt;
&lt;br /&gt;
// build source domain&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; empty({0, 0}, inner_radius);&lt;br /&gt;
auto discretization_empty = empty.discretizeBoundaryWithStep(dx, CENTRE);  &lt;br /&gt;
    &lt;br /&gt;
// substract the source domain&lt;br /&gt;
discretization -= discretization_empty;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next the domain is populated with nodes in accordance with the desired density function. Once the domain is constructed and discretized, the support (neighborhood) of $n$ nodes is found  for each node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GeneralFill&amp;lt;Vec2d&amp;gt; fill;&lt;br /&gt;
fill.seed(fill_seed);&lt;br /&gt;
discretization.fill(fill, fill_density);&lt;br /&gt;
&lt;br /&gt;
 // find support&lt;br /&gt;
FindClosest find_support(n);&lt;br /&gt;
discretization.findSupport(find_support);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The density function &amp;quot;fill_density&amp;quot; takes as argument the coordinates inside the domain and returns the desired distance between neighboring nodes for that location.&lt;br /&gt;
Now the domain preparation is complete, as domain is constructed and populated with nodes with support relations established. We continue by constructing the approximation engine.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
WLS&amp;lt;Monomials&amp;lt;Vec2d&amp;gt;, GaussianWeight&amp;lt;Vec2d&amp;gt;, ScaleToClosest&amp;gt; approx(m - 1 , sigma);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we are solving a time propagation problem implicitly, we will have to solve a system of equations for every time step. This is equivalent to solving a matrix equation. For this reason a space matrix is constructed. Next the wave equation is turned into code. Medusa encodes this information inside the just constructed matrix $M$. $E1$ and $E0$ represent the known solutions on previous two time steps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
SparseMatrix&amp;lt;double&amp;gt; M(domain_size, domain_size);&lt;br /&gt;
// Set equation on interior&lt;br /&gt;
for (int i : interior) {&lt;br /&gt;
    -(v*v*dt*dt) * op.lap(i) + op.value(i)= 2*E1(i)-E0(i);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Same is done also for the boundary nodes. Since dirichlet boundary conditions are employed the values of the Right Hand Side ($rhs$) of matrix equation are just set to prescribed values ($0$ on the outer boundary and $f(t)$ on inner boundary).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// Set boundary conditions&lt;br /&gt;
for (int i : boundary) {&lt;br /&gt;
    if (discretization.types()[i] == CENTRE) {&lt;br /&gt;
        op.value(i) = A * std::sin(omega*dt*2);  // step&lt;br /&gt;
    } else {&lt;br /&gt;
        op.value(i) = 0.0;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
At each time step the matrix equation is solved  using an Eigen linear equation solver, in this case, the BiCGStab algorithm. $E0$ and $E1$ are updated and the source is set to new value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
 // Solve matrix system&lt;br /&gt;
VectorXd E2 = solver.solve(rhs);&lt;br /&gt;
&lt;br /&gt;
// Update previous states&lt;br /&gt;
E0 = E1;&lt;br /&gt;
E1 = E2;&lt;br /&gt;
&lt;br /&gt;
 // Update rhs on interior&lt;br /&gt;
for (int i : interior) {&lt;br /&gt;
    rhs(i) = 2*E1(i)-E0(i);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Update rhs on boundary&lt;br /&gt;
for (int i : (discretization.types() == CENTRE)) {&lt;br /&gt;
    rhs(i) = A * std::sin(omega*dt*tt);  // step&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The animation of solution is presented below. The complete exampe is avalible at  [https://gitlab.com/e62Lab/medusa/tree/dev/examples/wave_equation wave_equation_2D.cpp]. &lt;br /&gt;
&lt;br /&gt;
[[File:EM_wave_2d_dt_e-6_dens40_omega128_v8 2X speed.mp4|400px]]&lt;br /&gt;
&lt;br /&gt;
== 2D time-domain acoustic wave propagation in heterogeneous media ==&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>E6WikiAdmin</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=Wave_equation&amp;diff=3516</id>
		<title>Wave equation</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=Wave_equation&amp;diff=3516"/>
				<updated>2022-12-04T19:12:45Z</updated>
		
		<summary type="html">&lt;p&gt;E6WikiAdmin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Box-round|title= Related papers |&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/62417923.pdf J. Močnik Berljavac, P. Mishra, J. Slak, G. Kosec; RBF-FD analysis of 2D time-domain acoustic wave propagation in heterogeneous media, Computers &amp;amp; Geosciences, 2021 [DOI: 10.1016/j.cageo.2021.104796]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
== 2D wave equation with Dirichlet boundary conditions ==&lt;br /&gt;
We are solving a problem analogous to a clamped circular membrane being forced to oscillate by fixing its centre to a rigid oscillating rod.  The domain of calculation is for this reason an annulus bounded by the point of contact with the circular source in the centre and the clamped edge of the circular membrane.&lt;br /&gt;
&lt;br /&gt;
[[File:wave_2d_domain_geo.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
Consider the time dependent solution to 2D wave equation on annulus shaped domain&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
    	\frac{ \partial^2 u}{\partial t^2} &amp;amp;= c^2 \nabla^2 u  &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
         u(r,t=0)&amp;amp;=0 &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
    	  u &amp;amp;= 0           &amp;amp;&amp;amp;\text{on } \partial \Omega_O,\\&lt;br /&gt;
          u &amp;amp;= f(t)           &amp;amp;&amp;amp;\text{on } \partial \Omega_I,&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where $\partial\Omega_I$ denotes the inner and $\partial\Omega_O$ the outer boundary of the domain. Through the  boundary condition on the inner boundary the source is introduced to the problem as a function of time&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
f(t)= u_o \sin \omega_o t.&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First the domain is constructed by subtracting a smaller circle domain from a larger one. Boundaries of the domain are populated in the same step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// // identifier to be added to nodes on the inner boundary&lt;br /&gt;
int CENTRE = -10;&lt;br /&gt;
&lt;br /&gt;
 // build circle domain&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; domain({0, 0}, outer_radius);&lt;br /&gt;
auto discretization = domain.discretizeBoundaryWithStep(dx);&lt;br /&gt;
&lt;br /&gt;
// build source domain&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; empty({0, 0}, inner_radius);&lt;br /&gt;
auto discretization_empty = empty.discretizeBoundaryWithStep(dx, CENTRE);  &lt;br /&gt;
    &lt;br /&gt;
// substract the source domain&lt;br /&gt;
discretization -= discretization_empty;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next the domain is populated with nodes in accordance with the desired density function. Once the domain is constructed and discretized, the support (neighborhood) of $n$ nodes is found  for each node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GeneralFill&amp;lt;Vec2d&amp;gt; fill;&lt;br /&gt;
fill.seed(fill_seed);&lt;br /&gt;
discretization.fill(fill, fill_density);&lt;br /&gt;
&lt;br /&gt;
 // find support&lt;br /&gt;
FindClosest find_support(n);&lt;br /&gt;
discretization.findSupport(find_support);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The density function &amp;quot;fill_density&amp;quot; takes as argument the coordinates inside the domain and returns the desired distance between neighboring nodes for that location.&lt;br /&gt;
Now the domain preparation is complete, as domain is constructed and populated with nodes with support relations established. We continue by constructing the approximation engine.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
WLS&amp;lt;Monomials&amp;lt;Vec2d&amp;gt;, GaussianWeight&amp;lt;Vec2d&amp;gt;, ScaleToClosest&amp;gt; approx(m - 1 , sigma);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we are solving a time propagation problem implicitly, we will have to solve a system of equations for every time step. This is equivalent to solving a matrix equation. For this reason a space matrix is constructed. Next the wave equation is turned into code. Medusa encodes this information inside the just constructed matrix $M$. $E1$ and $E0$ represent the known solutions on previous two time steps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
SparseMatrix&amp;lt;double&amp;gt; M(domain_size, domain_size);&lt;br /&gt;
// Set equation on interior&lt;br /&gt;
for (int i : interior) {&lt;br /&gt;
    -(v*v*dt*dt) * op.lap(i) + op.value(i)= 2*E1(i)-E0(i);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Same is done also for the boundary nodes. Since dirichlet boundary conditions are employed the values of the Right Hand Side ($rhs$) of matrix equation are just set to prescribed values ($0$ on the outer boundary and $f(t)$ on inner boundary).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// Set boundary conditions&lt;br /&gt;
for (int i : boundary) {&lt;br /&gt;
    if (discretization.types()[i] == CENTRE) {&lt;br /&gt;
        op.value(i) = A * std::sin(omega*dt*2);  // step&lt;br /&gt;
    } else {&lt;br /&gt;
        op.value(i) = 0.0;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
At each time step the matrix equation is solved  using an Eigen linear equation solver, in this case, the BiCGStab algorithm. $E0$ and $E1$ are updated and the source is set to new value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
 // Solve matrix system&lt;br /&gt;
VectorXd E2 = solver.solve(rhs);&lt;br /&gt;
&lt;br /&gt;
// Update previous states&lt;br /&gt;
E0 = E1;&lt;br /&gt;
E1 = E2;&lt;br /&gt;
&lt;br /&gt;
 // Update rhs on interior&lt;br /&gt;
for (int i : interior) {&lt;br /&gt;
    rhs(i) = 2*E1(i)-E0(i);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Update rhs on boundary&lt;br /&gt;
for (int i : (discretization.types() == CENTRE)) {&lt;br /&gt;
    rhs(i) = A * std::sin(omega*dt*tt);  // step&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The animation of solution is presented below. The complete exampe is avalible at  [https://gitlab.com/e62Lab/medusa/tree/dev/examples/wave_equation wave_equation_2D.cpp]. &lt;br /&gt;
&lt;br /&gt;
[[File:EM_wave_2d_dt_e-6_dens40_omega128_v8 2X speed.mp4|400px]]&lt;br /&gt;
&lt;br /&gt;
== 2D time-domain acoustic wave propagation in heterogeneous media ==&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>E6WikiAdmin</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=Wave_equation&amp;diff=3515</id>
		<title>Wave equation</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=Wave_equation&amp;diff=3515"/>
				<updated>2022-12-04T19:12:34Z</updated>
		
		<summary type="html">&lt;p&gt;E6WikiAdmin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Box-round|title= Related papers |&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/62417923.pdf J. Močnik Berljavac, P. Mishra, J. Slak, G. Kosec; RBF-FD analysis of 2D time-domain acoustic wave propagation in heterogeneous media, Computers &amp;amp; Geosciences, 2021 [DOI: 10.1016/j.cageo.2021.104796]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
== 2D wave equation with Dirichlet boundary conditions ==&lt;br /&gt;
We are solving a problem analogous to a clamped circular membrane being forced to oscillate by fixing its centre to a rigid oscillating rod.  The domain of calculation is for this reason an annulus bounded by the point of contact with the circular source in the centre and the clamped edge of the circular membrane.&lt;br /&gt;
&lt;br /&gt;
[[File:wave_2d_domain_geo.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
Consider the time dependent solution to 2D wave equation on annulus shaped domain&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
    	\frac{ \partial^2 u}{\partial t^2} &amp;amp;= c^2 \nabla^2 u  &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
         u(r,t=0)&amp;amp;=0 &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
    	  u &amp;amp;= 0           &amp;amp;&amp;amp;\text{on } \partial \Omega_O,\\&lt;br /&gt;
          u &amp;amp;= f(t)           &amp;amp;&amp;amp;\text{on } \partial \Omega_I,&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where $\partial\Omega_I$ denotes the inner and $\partial\Omega_O$ the outer boundary of the domain. Through the  boundary condition on the inner boundary the source is introduced to the problem as a function of time&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
f(t)= u_o \sin \omega_o t.&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First the domain is constructed by subtracting a smaller circle domain from a larger one. Boundaries of the domain are populated in the same step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// // identifier to be added to nodes on the inner boundary&lt;br /&gt;
int CENTRE = -10;&lt;br /&gt;
&lt;br /&gt;
 // build circle domain&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; domain({0, 0}, outer_radius);&lt;br /&gt;
auto discretization = domain.discretizeBoundaryWithStep(dx);&lt;br /&gt;
&lt;br /&gt;
// build source domain&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; empty({0, 0}, inner_radius);&lt;br /&gt;
auto discretization_empty = empty.discretizeBoundaryWithStep(dx, CENTRE);  &lt;br /&gt;
    &lt;br /&gt;
// substract the source domain&lt;br /&gt;
discretization -= discretization_empty;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next the domain is populated with nodes in accordance with the desired density function. Once the domain is constructed and discretized, the support (neighborhood) of $n$ nodes is found  for each node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GeneralFill&amp;lt;Vec2d&amp;gt; fill;&lt;br /&gt;
fill.seed(fill_seed);&lt;br /&gt;
discretization.fill(fill, fill_density);&lt;br /&gt;
&lt;br /&gt;
 // find support&lt;br /&gt;
FindClosest find_support(n);&lt;br /&gt;
discretization.findSupport(find_support);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The density function &amp;quot;fill_density&amp;quot; takes as argument the coordinates inside the domain and returns the desired distance between neighboring nodes for that location.&lt;br /&gt;
Now the domain preparation is complete, as domain is constructed and populated with nodes with support relations established. We continue by constructing the approximation engine.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
WLS&amp;lt;Monomials&amp;lt;Vec2d&amp;gt;, GaussianWeight&amp;lt;Vec2d&amp;gt;, ScaleToClosest&amp;gt; approx(m - 1 , sigma);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we are solving a time propagation problem implicitly, we will have to solve a system of equations for every time step. This is equivalent to solving a matrix equation. For this reason a space matrix is constructed. Next the wave equation is turned into code. Medusa encodes this information inside the just constructed matrix $M$. $E1$ and $E0$ represent the known solutions on previous two time steps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
SparseMatrix&amp;lt;double&amp;gt; M(domain_size, domain_size);&lt;br /&gt;
// Set equation on interior&lt;br /&gt;
for (int i : interior) {&lt;br /&gt;
    -(v*v*dt*dt) * op.lap(i) + op.value(i)= 2*E1(i)-E0(i);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Same is done also for the boundary nodes. Since dirichlet boundary conditions are employed the values of the Right Hand Side ($rhs$) of matrix equation are just set to prescribed values ($0$ on the outer boundary and $f(t)$ on inner boundary).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// Set boundary conditions&lt;br /&gt;
for (int i : boundary) {&lt;br /&gt;
    if (discretization.types()[i] == CENTRE) {&lt;br /&gt;
        op.value(i) = A * std::sin(omega*dt*2);  // step&lt;br /&gt;
    } else {&lt;br /&gt;
        op.value(i) = 0.0;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
At each time step the matrix equation is solved  using an Eigen linear equation solver, in this case, the BiCGStab algorithm. $E0$ and $E1$ are updated and the source is set to new value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
 // Solve matrix system&lt;br /&gt;
VectorXd E2 = solver.solve(rhs);&lt;br /&gt;
&lt;br /&gt;
// Update previous states&lt;br /&gt;
E0 = E1;&lt;br /&gt;
E1 = E2;&lt;br /&gt;
&lt;br /&gt;
 // Update rhs on interior&lt;br /&gt;
for (int i : interior) {&lt;br /&gt;
    rhs(i) = 2*E1(i)-E0(i);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Update rhs on boundary&lt;br /&gt;
for (int i : (discretization.types() == CENTRE)) {&lt;br /&gt;
    rhs(i) = A * std::sin(omega*dt*tt);  // step&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The animation of solution is presented below. The complete exampe is avalible at  [https://gitlab.com/e62Lab/medusa/tree/dev/examples/wave_equation wave_equation_2D.cpp]. &lt;br /&gt;
&lt;br /&gt;
[[File:EM_wave_2d_dt_e-6_dens40_omega128_v8 2X speed.mp4|400px]]&lt;br /&gt;
&lt;br /&gt;
== 2D time-domain acoustic wave propagation in heterogeneous media ==&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>E6WikiAdmin</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=Wave_equation&amp;diff=3514</id>
		<title>Wave equation</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=Wave_equation&amp;diff=3514"/>
				<updated>2022-12-04T19:10:47Z</updated>
		
		<summary type="html">&lt;p&gt;E6WikiAdmin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Box-round|title= Related papers |&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/62417923.pdf J. Močnik Berljavac, P. Mishra, J. Slak, G. Kosec; RBF-FD analysis of 2D time-domain acoustic wave propagation in heterogeneous media, Computers &amp;amp; Geosciences, 2021 [DOI: 10.1016/j.cageo.2021.104796]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
== 2D wave equation with Dirichlet boundary conditions ==&lt;br /&gt;
We are solving a problem analogous to a clamped circular membrane being forced to oscillate by fixing its centre to a rigid oscillating rod.  The domain of calculation is for this reason an annulus bounded by the point of contact with the circular source in the centre and the clamped edge of the circular membrane.&lt;br /&gt;
&lt;br /&gt;
[[File:wave_2d_domain_geo.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
Consider the time dependent solution to 2D wave equation on annulus shaped domain&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
    	\frac{ \partial^2 u}{\partial t^2} &amp;amp;= c^2 \nabla^2 u  &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
         u(r,t=0)&amp;amp;=0 &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
    	  u &amp;amp;= 0           &amp;amp;&amp;amp;\text{on } \partial \Omega_O,\\&lt;br /&gt;
          u &amp;amp;= f(t)           &amp;amp;&amp;amp;\text{on } \partial \Omega_I,&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where $\partial\Omega_I$ denotes the inner and $\partial\Omega_O$ the outer boundary of the domain. Through the  boundary condition on the inner boundary the source is introduced to the problem as a function of time&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
f(t)= u_o \sin \omega_o t.&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First the domain is constructed by subtracting a smaller circle domain from a larger one. Boundaries of the domain are populated in the same step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// // identifier to be added to nodes on the inner boundary&lt;br /&gt;
int CENTRE = -10;&lt;br /&gt;
&lt;br /&gt;
 // build circle domain&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; domain({0, 0}, outer_radius);&lt;br /&gt;
auto discretization = domain.discretizeBoundaryWithStep(dx);&lt;br /&gt;
&lt;br /&gt;
// build source domain&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; empty({0, 0}, inner_radius);&lt;br /&gt;
auto discretization_empty = empty.discretizeBoundaryWithStep(dx, CENTRE);  &lt;br /&gt;
    &lt;br /&gt;
// substract the source domain&lt;br /&gt;
discretization -= discretization_empty;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next the domain is populated with nodes in accordance with the desired density function. Once the domain is constructed and discretized, the support (neighborhood) of $n$ nodes is found  for each node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GeneralFill&amp;lt;Vec2d&amp;gt; fill;&lt;br /&gt;
fill.seed(fill_seed);&lt;br /&gt;
discretization.fill(fill, fill_density);&lt;br /&gt;
&lt;br /&gt;
 // find support&lt;br /&gt;
FindClosest find_support(n);&lt;br /&gt;
discretization.findSupport(find_support);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The density function &amp;quot;fill_density&amp;quot; takes as argument the coordinates inside the domain and returns the desired distance between neighboring nodes for that location.&lt;br /&gt;
Now the domain preparation is complete, as domain is constructed and populated with nodes with support relations established. We continue by constructing the approximation engine.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
WLS&amp;lt;Monomials&amp;lt;Vec2d&amp;gt;, GaussianWeight&amp;lt;Vec2d&amp;gt;, ScaleToClosest&amp;gt; approx(m - 1 , sigma);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we are solving a time propagation problem implicitly, we will have to solve a system of equations for every time step. This is equivalent to solving a matrix equation. For this reason a space matrix is constructed. Next the wave equation is turned into code. Medusa encodes this information inside the just constructed matrix $M$. $E1$ and $E0$ represent the known solutions on previous two time steps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
SparseMatrix&amp;lt;double&amp;gt; M(domain_size, domain_size);&lt;br /&gt;
// Set equation on interior&lt;br /&gt;
for (int i : interior) {&lt;br /&gt;
    -(v*v*dt*dt) * op.lap(i) + op.value(i)= 2*E1(i)-E0(i);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Same is done also for the boundary nodes. Since dirichlet boundary conditions are employed the values of the Right Hand Side ($rhs$) of matrix equation are just set to prescribed values ($0$ on the outer boundary and $f(t)$ on inner boundary).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// Set boundary conditions&lt;br /&gt;
for (int i : boundary) {&lt;br /&gt;
    if (discretization.types()[i] == CENTRE) {&lt;br /&gt;
        op.value(i) = A * std::sin(omega*dt*2);  // step&lt;br /&gt;
    } else {&lt;br /&gt;
        op.value(i) = 0.0;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
At each time step the matrix equation is solved  using an Eigen linear equation solver, in this case, the BiCGStab algorithm. $E0$ and $E1$ are updated and the source is set to new value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
 // Solve matrix system&lt;br /&gt;
VectorXd E2 = solver.solve(rhs);&lt;br /&gt;
&lt;br /&gt;
// Update previous states&lt;br /&gt;
E0 = E1;&lt;br /&gt;
E1 = E2;&lt;br /&gt;
&lt;br /&gt;
 // Update rhs on interior&lt;br /&gt;
for (int i : interior) {&lt;br /&gt;
    rhs(i) = 2*E1(i)-E0(i);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Update rhs on boundary&lt;br /&gt;
for (int i : (discretization.types() == CENTRE)) {&lt;br /&gt;
    rhs(i) = A * std::sin(omega*dt*tt);  // step&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The animation of solution is presented below. The complete exampe is avalible at  [https://gitlab.com/e62Lab/medusa/tree/dev/examples/wave_equation wave_equation_2D.cpp]. &lt;br /&gt;
&lt;br /&gt;
[[File:EM_wave_2d_dt_e-6_dens40_omega128_v8 2X speed.mp4|400px]]&lt;br /&gt;
&lt;br /&gt;
== 2D time-domain acoustic wave propagation in heterogeneous media ==&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>E6WikiAdmin</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=Wave_equation&amp;diff=3513</id>
		<title>Wave equation</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=Wave_equation&amp;diff=3513"/>
				<updated>2022-12-04T19:10:24Z</updated>
		
		<summary type="html">&lt;p&gt;E6WikiAdmin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
{{Box-round|title= Related papers |&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/62417923.pdf J. Močnik Berljavac, P. Mishra, J. Slak, G. Kosec; RBF-FD analysis of 2D time-domain acoustic wave propagation in heterogeneous media, Computers &amp;amp; Geosciences, 2021 [DOI: 10.1016/j.cageo.2021.104796]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
== 2D wave equation with Dirichlet boundary conditions ==&lt;br /&gt;
We are solving a problem analogous to a clamped circular membrane being forced to oscillate by fixing its centre to a rigid oscillating rod.  The domain of calculation is for this reason an annulus bounded by the point of contact with the circular source in the centre and the clamped edge of the circular membrane.&lt;br /&gt;
&lt;br /&gt;
[[File:wave_2d_domain_geo.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
Consider the time dependent solution to 2D wave equation on annulus shaped domain&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
    	\frac{ \partial^2 u}{\partial t^2} &amp;amp;= c^2 \nabla^2 u  &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
         u(r,t=0)&amp;amp;=0 &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
    	  u &amp;amp;= 0           &amp;amp;&amp;amp;\text{on } \partial \Omega_O,\\&lt;br /&gt;
          u &amp;amp;= f(t)           &amp;amp;&amp;amp;\text{on } \partial \Omega_I,&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where $\partial\Omega_I$ denotes the inner and $\partial\Omega_O$ the outer boundary of the domain. Through the  boundary condition on the inner boundary the source is introduced to the problem as a function of time&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
f(t)= u_o \sin \omega_o t.&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First the domain is constructed by subtracting a smaller circle domain from a larger one. Boundaries of the domain are populated in the same step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// // identifier to be added to nodes on the inner boundary&lt;br /&gt;
int CENTRE = -10;&lt;br /&gt;
&lt;br /&gt;
 // build circle domain&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; domain({0, 0}, outer_radius);&lt;br /&gt;
auto discretization = domain.discretizeBoundaryWithStep(dx);&lt;br /&gt;
&lt;br /&gt;
// build source domain&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; empty({0, 0}, inner_radius);&lt;br /&gt;
auto discretization_empty = empty.discretizeBoundaryWithStep(dx, CENTRE);  &lt;br /&gt;
    &lt;br /&gt;
// substract the source domain&lt;br /&gt;
discretization -= discretization_empty;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next the domain is populated with nodes in accordance with the desired density function. Once the domain is constructed and discretized, the support (neighborhood) of $n$ nodes is found  for each node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GeneralFill&amp;lt;Vec2d&amp;gt; fill;&lt;br /&gt;
fill.seed(fill_seed);&lt;br /&gt;
discretization.fill(fill, fill_density);&lt;br /&gt;
&lt;br /&gt;
 // find support&lt;br /&gt;
FindClosest find_support(n);&lt;br /&gt;
discretization.findSupport(find_support);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The density function &amp;quot;fill_density&amp;quot; takes as argument the coordinates inside the domain and returns the desired distance between neighboring nodes for that location.&lt;br /&gt;
Now the domain preparation is complete, as domain is constructed and populated with nodes with support relations established. We continue by constructing the approximation engine.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
WLS&amp;lt;Monomials&amp;lt;Vec2d&amp;gt;, GaussianWeight&amp;lt;Vec2d&amp;gt;, ScaleToClosest&amp;gt; approx(m - 1 , sigma);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we are solving a time propagation problem implicitly, we will have to solve a system of equations for every time step. This is equivalent to solving a matrix equation. For this reason a space matrix is constructed. Next the wave equation is turned into code. Medusa encodes this information inside the just constructed matrix $M$. $E1$ and $E0$ represent the known solutions on previous two time steps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
SparseMatrix&amp;lt;double&amp;gt; M(domain_size, domain_size);&lt;br /&gt;
// Set equation on interior&lt;br /&gt;
for (int i : interior) {&lt;br /&gt;
    -(v*v*dt*dt) * op.lap(i) + op.value(i)= 2*E1(i)-E0(i);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Same is done also for the boundary nodes. Since dirichlet boundary conditions are employed the values of the Right Hand Side ($rhs$) of matrix equation are just set to prescribed values ($0$ on the outer boundary and $f(t)$ on inner boundary).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// Set boundary conditions&lt;br /&gt;
for (int i : boundary) {&lt;br /&gt;
    if (discretization.types()[i] == CENTRE) {&lt;br /&gt;
        op.value(i) = A * std::sin(omega*dt*2);  // step&lt;br /&gt;
    } else {&lt;br /&gt;
        op.value(i) = 0.0;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
At each time step the matrix equation is solved  using an Eigen linear equation solver, in this case, the BiCGStab algorithm. $E0$ and $E1$ are updated and the source is set to new value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
 // Solve matrix system&lt;br /&gt;
VectorXd E2 = solver.solve(rhs);&lt;br /&gt;
&lt;br /&gt;
// Update previous states&lt;br /&gt;
E0 = E1;&lt;br /&gt;
E1 = E2;&lt;br /&gt;
&lt;br /&gt;
 // Update rhs on interior&lt;br /&gt;
for (int i : interior) {&lt;br /&gt;
    rhs(i) = 2*E1(i)-E0(i);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Update rhs on boundary&lt;br /&gt;
for (int i : (discretization.types() == CENTRE)) {&lt;br /&gt;
    rhs(i) = A * std::sin(omega*dt*tt);  // step&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The animation of solution is presented below. The complete exampe is avalible at  [https://gitlab.com/e62Lab/medusa/tree/dev/examples/wave_equation wave_equation_2D.cpp]. &lt;br /&gt;
&lt;br /&gt;
[[File:EM_wave_2d_dt_e-6_dens40_omega128_v8 2X speed.mp4|400px]]&lt;br /&gt;
&lt;br /&gt;
== 2D time-domain acoustic wave propagation in heterogeneous media ==&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>E6WikiAdmin</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=Wave_equation&amp;diff=3512</id>
		<title>Wave equation</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=Wave_equation&amp;diff=3512"/>
				<updated>2022-12-04T19:10:13Z</updated>
		
		<summary type="html">&lt;p&gt;E6WikiAdmin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Box-round|title= Related papers |&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/62417923.pdf J. Močnik Berljavac, P. Mishra, J. Slak, G. Kosec; RBF-FD analysis of 2D time-domain acoustic wave propagation in heterogeneous media, Computers &amp;amp; Geosciences, 2021 [DOI: 10.1016/j.cageo.2021.104796]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
== 2D wave equation with Dirichlet boundary conditions ==&lt;br /&gt;
We are solving a problem analogous to a clamped circular membrane being forced to oscillate by fixing its centre to a rigid oscillating rod.  The domain of calculation is for this reason an annulus bounded by the point of contact with the circular source in the centre and the clamped edge of the circular membrane.&lt;br /&gt;
&lt;br /&gt;
[[File:wave_2d_domain_geo.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
Consider the time dependent solution to 2D wave equation on annulus shaped domain&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
    	\frac{ \partial^2 u}{\partial t^2} &amp;amp;= c^2 \nabla^2 u  &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
         u(r,t=0)&amp;amp;=0 &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
    	  u &amp;amp;= 0           &amp;amp;&amp;amp;\text{on } \partial \Omega_O,\\&lt;br /&gt;
          u &amp;amp;= f(t)           &amp;amp;&amp;amp;\text{on } \partial \Omega_I,&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where $\partial\Omega_I$ denotes the inner and $\partial\Omega_O$ the outer boundary of the domain. Through the  boundary condition on the inner boundary the source is introduced to the problem as a function of time&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
f(t)= u_o \sin \omega_o t.&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First the domain is constructed by subtracting a smaller circle domain from a larger one. Boundaries of the domain are populated in the same step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// // identifier to be added to nodes on the inner boundary&lt;br /&gt;
int CENTRE = -10;&lt;br /&gt;
&lt;br /&gt;
 // build circle domain&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; domain({0, 0}, outer_radius);&lt;br /&gt;
auto discretization = domain.discretizeBoundaryWithStep(dx);&lt;br /&gt;
&lt;br /&gt;
// build source domain&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; empty({0, 0}, inner_radius);&lt;br /&gt;
auto discretization_empty = empty.discretizeBoundaryWithStep(dx, CENTRE);  &lt;br /&gt;
    &lt;br /&gt;
// substract the source domain&lt;br /&gt;
discretization -= discretization_empty;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next the domain is populated with nodes in accordance with the desired density function. Once the domain is constructed and discretized, the support (neighborhood) of $n$ nodes is found  for each node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GeneralFill&amp;lt;Vec2d&amp;gt; fill;&lt;br /&gt;
fill.seed(fill_seed);&lt;br /&gt;
discretization.fill(fill, fill_density);&lt;br /&gt;
&lt;br /&gt;
 // find support&lt;br /&gt;
FindClosest find_support(n);&lt;br /&gt;
discretization.findSupport(find_support);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The density function &amp;quot;fill_density&amp;quot; takes as argument the coordinates inside the domain and returns the desired distance between neighboring nodes for that location.&lt;br /&gt;
Now the domain preparation is complete, as domain is constructed and populated with nodes with support relations established. We continue by constructing the approximation engine.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
WLS&amp;lt;Monomials&amp;lt;Vec2d&amp;gt;, GaussianWeight&amp;lt;Vec2d&amp;gt;, ScaleToClosest&amp;gt; approx(m - 1 , sigma);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we are solving a time propagation problem implicitly, we will have to solve a system of equations for every time step. This is equivalent to solving a matrix equation. For this reason a space matrix is constructed. Next the wave equation is turned into code. Medusa encodes this information inside the just constructed matrix $M$. $E1$ and $E0$ represent the known solutions on previous two time steps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
SparseMatrix&amp;lt;double&amp;gt; M(domain_size, domain_size);&lt;br /&gt;
// Set equation on interior&lt;br /&gt;
for (int i : interior) {&lt;br /&gt;
    -(v*v*dt*dt) * op.lap(i) + op.value(i)= 2*E1(i)-E0(i);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Same is done also for the boundary nodes. Since dirichlet boundary conditions are employed the values of the Right Hand Side ($rhs$) of matrix equation are just set to prescribed values ($0$ on the outer boundary and $f(t)$ on inner boundary).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// Set boundary conditions&lt;br /&gt;
for (int i : boundary) {&lt;br /&gt;
    if (discretization.types()[i] == CENTRE) {&lt;br /&gt;
        op.value(i) = A * std::sin(omega*dt*2);  // step&lt;br /&gt;
    } else {&lt;br /&gt;
        op.value(i) = 0.0;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
At each time step the matrix equation is solved  using an Eigen linear equation solver, in this case, the BiCGStab algorithm. $E0$ and $E1$ are updated and the source is set to new value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
 // Solve matrix system&lt;br /&gt;
VectorXd E2 = solver.solve(rhs);&lt;br /&gt;
&lt;br /&gt;
// Update previous states&lt;br /&gt;
E0 = E1;&lt;br /&gt;
E1 = E2;&lt;br /&gt;
&lt;br /&gt;
 // Update rhs on interior&lt;br /&gt;
for (int i : interior) {&lt;br /&gt;
    rhs(i) = 2*E1(i)-E0(i);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Update rhs on boundary&lt;br /&gt;
for (int i : (discretization.types() == CENTRE)) {&lt;br /&gt;
    rhs(i) = A * std::sin(omega*dt*tt);  // step&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The animation of solution is presented below. The complete exampe is avalible at  [https://gitlab.com/e62Lab/medusa/tree/dev/examples/wave_equation wave_equation_2D.cpp]. &lt;br /&gt;
&lt;br /&gt;
[[File:EM_wave_2d_dt_e-6_dens40_omega128_v8 2X speed.mp4|400px]]&lt;br /&gt;
&lt;br /&gt;
== 2D time-domain acoustic wave propagation in heterogeneous media ==&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>E6WikiAdmin</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=Wave_equation&amp;diff=3511</id>
		<title>Wave equation</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=Wave_equation&amp;diff=3511"/>
				<updated>2022-12-04T19:09:55Z</updated>
		
		<summary type="html">&lt;p&gt;E6WikiAdmin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
== 2D wave equation with Dirichlet boundary conditions ==&lt;br /&gt;
We are solving a problem analogous to a clamped circular membrane being forced to oscillate by fixing its centre to a rigid oscillating rod.  The domain of calculation is for this reason an annulus bounded by the point of contact with the circular source in the centre and the clamped edge of the circular membrane.&lt;br /&gt;
&lt;br /&gt;
[[File:wave_2d_domain_geo.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
Consider the time dependent solution to 2D wave equation on annulus shaped domain&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
    	\frac{ \partial^2 u}{\partial t^2} &amp;amp;= c^2 \nabla^2 u  &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
         u(r,t=0)&amp;amp;=0 &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
    	  u &amp;amp;= 0           &amp;amp;&amp;amp;\text{on } \partial \Omega_O,\\&lt;br /&gt;
          u &amp;amp;= f(t)           &amp;amp;&amp;amp;\text{on } \partial \Omega_I,&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where $\partial\Omega_I$ denotes the inner and $\partial\Omega_O$ the outer boundary of the domain. Through the  boundary condition on the inner boundary the source is introduced to the problem as a function of time&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
f(t)= u_o \sin \omega_o t.&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First the domain is constructed by subtracting a smaller circle domain from a larger one. Boundaries of the domain are populated in the same step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// // identifier to be added to nodes on the inner boundary&lt;br /&gt;
int CENTRE = -10;&lt;br /&gt;
&lt;br /&gt;
 // build circle domain&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; domain({0, 0}, outer_radius);&lt;br /&gt;
auto discretization = domain.discretizeBoundaryWithStep(dx);&lt;br /&gt;
&lt;br /&gt;
// build source domain&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; empty({0, 0}, inner_radius);&lt;br /&gt;
auto discretization_empty = empty.discretizeBoundaryWithStep(dx, CENTRE);  &lt;br /&gt;
    &lt;br /&gt;
// substract the source domain&lt;br /&gt;
discretization -= discretization_empty;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next the domain is populated with nodes in accordance with the desired density function. Once the domain is constructed and discretized, the support (neighborhood) of $n$ nodes is found  for each node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GeneralFill&amp;lt;Vec2d&amp;gt; fill;&lt;br /&gt;
fill.seed(fill_seed);&lt;br /&gt;
discretization.fill(fill, fill_density);&lt;br /&gt;
&lt;br /&gt;
 // find support&lt;br /&gt;
FindClosest find_support(n);&lt;br /&gt;
discretization.findSupport(find_support);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The density function &amp;quot;fill_density&amp;quot; takes as argument the coordinates inside the domain and returns the desired distance between neighboring nodes for that location.&lt;br /&gt;
Now the domain preparation is complete, as domain is constructed and populated with nodes with support relations established. We continue by constructing the approximation engine.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
WLS&amp;lt;Monomials&amp;lt;Vec2d&amp;gt;, GaussianWeight&amp;lt;Vec2d&amp;gt;, ScaleToClosest&amp;gt; approx(m - 1 , sigma);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we are solving a time propagation problem implicitly, we will have to solve a system of equations for every time step. This is equivalent to solving a matrix equation. For this reason a space matrix is constructed. Next the wave equation is turned into code. Medusa encodes this information inside the just constructed matrix $M$. $E1$ and $E0$ represent the known solutions on previous two time steps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
SparseMatrix&amp;lt;double&amp;gt; M(domain_size, domain_size);&lt;br /&gt;
// Set equation on interior&lt;br /&gt;
for (int i : interior) {&lt;br /&gt;
    -(v*v*dt*dt) * op.lap(i) + op.value(i)= 2*E1(i)-E0(i);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Same is done also for the boundary nodes. Since dirichlet boundary conditions are employed the values of the Right Hand Side ($rhs$) of matrix equation are just set to prescribed values ($0$ on the outer boundary and $f(t)$ on inner boundary).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// Set boundary conditions&lt;br /&gt;
for (int i : boundary) {&lt;br /&gt;
    if (discretization.types()[i] == CENTRE) {&lt;br /&gt;
        op.value(i) = A * std::sin(omega*dt*2);  // step&lt;br /&gt;
    } else {&lt;br /&gt;
        op.value(i) = 0.0;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
At each time step the matrix equation is solved  using an Eigen linear equation solver, in this case, the BiCGStab algorithm. $E0$ and $E1$ are updated and the source is set to new value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
 // Solve matrix system&lt;br /&gt;
VectorXd E2 = solver.solve(rhs);&lt;br /&gt;
&lt;br /&gt;
// Update previous states&lt;br /&gt;
E0 = E1;&lt;br /&gt;
E1 = E2;&lt;br /&gt;
&lt;br /&gt;
 // Update rhs on interior&lt;br /&gt;
for (int i : interior) {&lt;br /&gt;
    rhs(i) = 2*E1(i)-E0(i);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Update rhs on boundary&lt;br /&gt;
for (int i : (discretization.types() == CENTRE)) {&lt;br /&gt;
    rhs(i) = A * std::sin(omega*dt*tt);  // step&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The animation of solution is presented below. The complete exampe is avalible at  [https://gitlab.com/e62Lab/medusa/tree/dev/examples/wave_equation wave_equation_2D.cpp]. &lt;br /&gt;
&lt;br /&gt;
[[File:EM_wave_2d_dt_e-6_dens40_omega128_v8 2X speed.mp4|400px]]&lt;br /&gt;
&lt;br /&gt;
== 2D time-domain acoustic wave propagation in heterogeneous media ==&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>E6WikiAdmin</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=Wave_equation&amp;diff=3510</id>
		<title>Wave equation</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=Wave_equation&amp;diff=3510"/>
				<updated>2022-12-04T19:08:48Z</updated>
		
		<summary type="html">&lt;p&gt;E6WikiAdmin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Box-round|title= Related papers |&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/62417923.pdf J. Močnik Berljavac, P. Mishra, J. Slak, G. Kosec; RBF-FD analysis of 2D time-domain acoustic wave propagation in heterogeneous media, Computers &amp;amp; Geosciences, 2021 [DOI: 10.1016/j.cageo.2021.104796]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
== 2D wave equation with Dirichlet boundary conditions ==&lt;br /&gt;
We are solving a problem analogous to a clamped circular membrane being forced to oscillate by fixing its centre to a rigid oscillating rod.  The domain of calculation is for this reason an annulus bounded by the point of contact with the circular source in the centre and the clamped edge of the circular membrane.&lt;br /&gt;
&lt;br /&gt;
[[File:wave_2d_domain_geo.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
Consider the time dependent solution to 2D wave equation on annulus shaped domain&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
    	\frac{ \partial^2 u}{\partial t^2} &amp;amp;= c^2 \nabla^2 u  &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
         u(r,t=0)&amp;amp;=0 &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
    	  u &amp;amp;= 0           &amp;amp;&amp;amp;\text{on } \partial \Omega_O,\\&lt;br /&gt;
          u &amp;amp;= f(t)           &amp;amp;&amp;amp;\text{on } \partial \Omega_I,&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where $\partial\Omega_I$ denotes the inner and $\partial\Omega_O$ the outer boundary of the domain. Through the  boundary condition on the inner boundary the source is introduced to the problem as a function of time&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
f(t)= u_o \sin \omega_o t.&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First the domain is constructed by subtracting a smaller circle domain from a larger one. Boundaries of the domain are populated in the same step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// // identifier to be added to nodes on the inner boundary&lt;br /&gt;
int CENTRE = -10;&lt;br /&gt;
&lt;br /&gt;
 // build circle domain&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; domain({0, 0}, outer_radius);&lt;br /&gt;
auto discretization = domain.discretizeBoundaryWithStep(dx);&lt;br /&gt;
&lt;br /&gt;
// build source domain&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; empty({0, 0}, inner_radius);&lt;br /&gt;
auto discretization_empty = empty.discretizeBoundaryWithStep(dx, CENTRE);  &lt;br /&gt;
    &lt;br /&gt;
// substract the source domain&lt;br /&gt;
discretization -= discretization_empty;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next the domain is populated with nodes in accordance with the desired density function. Once the domain is constructed and discretized, the support (neighborhood) of $n$ nodes is found  for each node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GeneralFill&amp;lt;Vec2d&amp;gt; fill;&lt;br /&gt;
fill.seed(fill_seed);&lt;br /&gt;
discretization.fill(fill, fill_density);&lt;br /&gt;
&lt;br /&gt;
 // find support&lt;br /&gt;
FindClosest find_support(n);&lt;br /&gt;
discretization.findSupport(find_support);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The density function &amp;quot;fill_density&amp;quot; takes as argument the coordinates inside the domain and returns the desired distance between neighboring nodes for that location.&lt;br /&gt;
Now the domain preparation is complete, as domain is constructed and populated with nodes with support relations established. We continue by constructing the approximation engine.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
WLS&amp;lt;Monomials&amp;lt;Vec2d&amp;gt;, GaussianWeight&amp;lt;Vec2d&amp;gt;, ScaleToClosest&amp;gt; approx(m - 1 , sigma);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we are solving a time propagation problem implicitly, we will have to solve a system of equations for every time step. This is equivalent to solving a matrix equation. For this reason a space matrix is constructed. Next the wave equation is turned into code. Medusa encodes this information inside the just constructed matrix $M$. $E1$ and $E0$ represent the known solutions on previous two time steps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
SparseMatrix&amp;lt;double&amp;gt; M(domain_size, domain_size);&lt;br /&gt;
// Set equation on interior&lt;br /&gt;
for (int i : interior) {&lt;br /&gt;
    -(v*v*dt*dt) * op.lap(i) + op.value(i)= 2*E1(i)-E0(i);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Same is done also for the boundary nodes. Since dirichlet boundary conditions are employed the values of the Right Hand Side ($rhs$) of matrix equation are just set to prescribed values ($0$ on the outer boundary and $f(t)$ on inner boundary).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// Set boundary conditions&lt;br /&gt;
for (int i : boundary) {&lt;br /&gt;
    if (discretization.types()[i] == CENTRE) {&lt;br /&gt;
        op.value(i) = A * std::sin(omega*dt*2);  // step&lt;br /&gt;
    } else {&lt;br /&gt;
        op.value(i) = 0.0;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
At each time step the matrix equation is solved  using an Eigen linear equation solver, in this case, the BiCGStab algorithm. $E0$ and $E1$ are updated and the source is set to new value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
 // Solve matrix system&lt;br /&gt;
VectorXd E2 = solver.solve(rhs);&lt;br /&gt;
&lt;br /&gt;
// Update previous states&lt;br /&gt;
E0 = E1;&lt;br /&gt;
E1 = E2;&lt;br /&gt;
&lt;br /&gt;
 // Update rhs on interior&lt;br /&gt;
for (int i : interior) {&lt;br /&gt;
    rhs(i) = 2*E1(i)-E0(i);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Update rhs on boundary&lt;br /&gt;
for (int i : (discretization.types() == CENTRE)) {&lt;br /&gt;
    rhs(i) = A * std::sin(omega*dt*tt);  // step&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The animation of solution is presented below. The complete exampe is avalible at  [https://gitlab.com/e62Lab/medusa/tree/dev/examples/wave_equation wave_equation_2D.cpp]. &lt;br /&gt;
&lt;br /&gt;
[[File:EM_wave_2d_dt_e-6_dens40_omega128_v8 2X speed.mp4|400px]]&lt;br /&gt;
&lt;br /&gt;
== 2D time-domain acoustic wave propagation in heterogeneous media ==&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>E6WikiAdmin</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=Wave_equation&amp;diff=3509</id>
		<title>Wave equation</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=Wave_equation&amp;diff=3509"/>
				<updated>2022-12-04T19:06:57Z</updated>
		
		<summary type="html">&lt;p&gt;E6WikiAdmin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Box-round|title= Related papers |&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/62417923.pdf J. Močnik Berljavac, P. Mishra, J. Slak, G. Kosec; RBF-FD analysis of 2D time-domain acoustic wave propagation in heterogeneous media, Computers &amp;amp; Geosciences, 2021 [DOI: 10.1016/j.cageo.2021.104796]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
== 2D wave equation with Dirichlet boundary conditions ==&lt;br /&gt;
We are solving a problem analogous to a clamped circular membrane being forced to oscillate by fixing its centre to a rigid oscillating rod.  The domain of calculation is for this reason an annulus bounded by the point of contact with the circular source in the centre and the clamped edge of the circular membrane.&lt;br /&gt;
&lt;br /&gt;
[[File:wave_2d_domain_geo.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
Consider the time dependent solution to 2D wave equation on annulus shaped domain&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
    	\frac{ \partial^2 u}{\partial t^2} &amp;amp;= c^2 \nabla^2 u  &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
         u(r,t=0)&amp;amp;=0 &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
    	  u &amp;amp;= 0           &amp;amp;&amp;amp;\text{on } \partial \Omega_O,\\&lt;br /&gt;
          u &amp;amp;= f(t)           &amp;amp;&amp;amp;\text{on } \partial \Omega_I,&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where $\partial\Omega_I$ denotes the inner and $\partial\Omega_O$ the outer boundary of the domain. Through the  boundary condition on the inner boundary the source is introduced to the problem as a function of time&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
f(t)= u_o \sin \omega_o t.&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First the domain is constructed by subtracting a smaller circle domain from a larger one. Boundaries of the domain are populated in the same step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// // identifier to be added to nodes on the inner boundary&lt;br /&gt;
int CENTRE = -10;&lt;br /&gt;
&lt;br /&gt;
 // build circle domain&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; domain({0, 0}, outer_radius);&lt;br /&gt;
auto discretization = domain.discretizeBoundaryWithStep(dx);&lt;br /&gt;
&lt;br /&gt;
// build source domain&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; empty({0, 0}, inner_radius);&lt;br /&gt;
auto discretization_empty = empty.discretizeBoundaryWithStep(dx, CENTRE);  &lt;br /&gt;
    &lt;br /&gt;
// substract the source domain&lt;br /&gt;
discretization -= discretization_empty;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next the domain is populated with nodes in accordance with the desired density function. Once the domain is constructed and discretized, the support (neighborhood) of $n$ nodes is found  for each node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GeneralFill&amp;lt;Vec2d&amp;gt; fill;&lt;br /&gt;
fill.seed(fill_seed);&lt;br /&gt;
discretization.fill(fill, fill_density);&lt;br /&gt;
&lt;br /&gt;
 // find support&lt;br /&gt;
FindClosest find_support(n);&lt;br /&gt;
discretization.findSupport(find_support);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The density function &amp;quot;fill_density&amp;quot; takes as argument the coordinates inside the domain and returns the desired distance between neighboring nodes for that location.&lt;br /&gt;
Now the domain preparation is complete, as domain is constructed and populated with nodes with support relations established. We continue by constructing the approximation engine.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
WLS&amp;lt;Monomials&amp;lt;Vec2d&amp;gt;, GaussianWeight&amp;lt;Vec2d&amp;gt;, ScaleToClosest&amp;gt; approx(m - 1 , sigma);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we are solving a time propagation problem implicitly, we will have to solve a system of equations for every time step. This is equivalent to solving a matrix equation. For this reason a space matrix is constructed. Next the wave equation is turned into code. Medusa encodes this information inside the just constructed matrix $M$. $E1$ and $E0$ represent the known solutions on previous two time steps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
SparseMatrix&amp;lt;double&amp;gt; M(domain_size, domain_size);&lt;br /&gt;
// Set equation on interior&lt;br /&gt;
for (int i : interior) {&lt;br /&gt;
    -(v*v*dt*dt) * op.lap(i) + op.value(i)= 2*E1(i)-E0(i);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Same is done also for the boundary nodes. Since dirichlet boundary conditions are employed the values of the Right Hand Side ($rhs$) of matrix equation are just set to prescribed values ($0$ on the outer boundary and $f(t)$ on inner boundary).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// Set boundary conditions&lt;br /&gt;
for (int i : boundary) {&lt;br /&gt;
    if (discretization.types()[i] == CENTRE) {&lt;br /&gt;
        op.value(i) = A * std::sin(omega*dt*2);  // step&lt;br /&gt;
    } else {&lt;br /&gt;
        op.value(i) = 0.0;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
At each time step the matrix equation is solved  using an Eigen linear equation solver, in this case, the BiCGStab algorithm. $E0$ and $E1$ are updated and the source is set to new value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
 // Solve matrix system&lt;br /&gt;
VectorXd E2 = solver.solve(rhs);&lt;br /&gt;
&lt;br /&gt;
// Update previous states&lt;br /&gt;
E0 = E1;&lt;br /&gt;
E1 = E2;&lt;br /&gt;
&lt;br /&gt;
 // Update rhs on interior&lt;br /&gt;
for (int i : interior) {&lt;br /&gt;
    rhs(i) = 2*E1(i)-E0(i);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Update rhs on boundary&lt;br /&gt;
for (int i : (discretization.types() == CENTRE)) {&lt;br /&gt;
    rhs(i) = A * std::sin(omega*dt*tt);  // step&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The animation of solution is presented below. The complete exampe is avalible at  [https://gitlab.com/e62Lab/medusa/tree/dev/examples/wave_equation wave_equation_2D.cpp]. &lt;br /&gt;
&lt;br /&gt;
[[File:EM_wave_2d_dt_e-6_dens40_omega128_v8 2X speed.mp4|400px]]&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>E6WikiAdmin</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=Wave_equation&amp;diff=3508</id>
		<title>Wave equation</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=Wave_equation&amp;diff=3508"/>
				<updated>2022-12-04T19:04:48Z</updated>
		
		<summary type="html">&lt;p&gt;E6WikiAdmin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Box-round|title= Related papers |&lt;br /&gt;
&lt;br /&gt;
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/62417923.pdf J. Močnik Berljavac, P. Mishra, J. Slak, G. Kosec; RBF-FD analysis of 2D time-domain acoustic wave propagation in heterogeneous media, Computers &amp;amp; Geosciences, 2021 [DOI: 10.1016/j.cageo.2021.104796]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;br /&gt;
&lt;br /&gt;
== 2D wave equation with Dirichlet boundary conditions ==&lt;br /&gt;
We are solving a problem analogous to a clamped circular membrane being forced to oscillate by fixing its centre to a rigid oscillating rod.  The domain of calculation is for this reason an annulus bounded by the point of contact with the circular source in the centre and the clamped edge of the circular membrane.&lt;br /&gt;
&lt;br /&gt;
[[File:wave_2d_domain_geo.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
Consider the time dependent solution to 2D wave equation on annulus shaped domain&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
    	\frac{ \partial^2 u}{\partial t^2} &amp;amp;= c^2 \nabla^2 u  &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
         u(r,t=0)&amp;amp;=0 &amp;amp;&amp;amp;\text{in } \Omega, \\&lt;br /&gt;
    	  u &amp;amp;= 0           &amp;amp;&amp;amp;\text{on } \partial \Omega_O,\\&lt;br /&gt;
          u &amp;amp;= f(t)           &amp;amp;&amp;amp;\text{on } \partial \Omega_I,&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where $\partial\Omega_I$ denotes the inner and $\partial\Omega_O$ the outer boundary of the domain. Through the  boundary condition on the inner boundary the source is introduced to the problem as a function of time&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align*}&lt;br /&gt;
f(t)= u_o \sin \omega_o t.&lt;br /&gt;
\end{align*}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First the domain is constructed by subtracting a smaller circle domain from a larger one. Boundaries of the domain are populated in the same step.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// // identifier to be added to nodes on the inner boundary&lt;br /&gt;
int CENTRE = -10;&lt;br /&gt;
&lt;br /&gt;
 // build circle domain&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; domain({0, 0}, outer_radius);&lt;br /&gt;
auto discretization = domain.discretizeBoundaryWithStep(dx);&lt;br /&gt;
&lt;br /&gt;
// build source domain&lt;br /&gt;
BallShape&amp;lt;Vec2d&amp;gt; empty({0, 0}, inner_radius);&lt;br /&gt;
auto discretization_empty = empty.discretizeBoundaryWithStep(dx, CENTRE);  &lt;br /&gt;
    &lt;br /&gt;
// substract the source domain&lt;br /&gt;
discretization -= discretization_empty;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next the domain is populated with nodes in accordance with the desired density function. Once the domain is constructed and discretized, the support (neighborhood) of $n$ nodes is found  for each node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GeneralFill&amp;lt;Vec2d&amp;gt; fill;&lt;br /&gt;
fill.seed(fill_seed);&lt;br /&gt;
discretization.fill(fill, fill_density);&lt;br /&gt;
&lt;br /&gt;
 // find support&lt;br /&gt;
FindClosest find_support(n);&lt;br /&gt;
discretization.findSupport(find_support);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The density function &amp;quot;fill_density&amp;quot; takes as argument the coordinates inside the domain and returns the desired distance between neighboring nodes for that location.&lt;br /&gt;
Now the domain preparation is complete, as domain is constructed and populated with nodes with support relations established. We continue by constructing the approximation engine.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
WLS&amp;lt;Monomials&amp;lt;Vec2d&amp;gt;, GaussianWeight&amp;lt;Vec2d&amp;gt;, ScaleToClosest&amp;gt; approx(m - 1 , sigma);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we are solving a time propagation problem implicitly, we will have to solve a system of equations for every time step. This is equivalent to solving a matrix equation. For this reason a space matrix is constructed. Next the wave equation is turned into code. Medusa encodes this information inside the just constructed matrix $M$. $E1$ and $E0$ represent the known solutions on previous two time steps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
SparseMatrix&amp;lt;double&amp;gt; M(domain_size, domain_size);&lt;br /&gt;
// Set equation on interior&lt;br /&gt;
for (int i : interior) {&lt;br /&gt;
    -(v*v*dt*dt) * op.lap(i) + op.value(i)= 2*E1(i)-E0(i);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Same is done also for the boundary nodes. Since dirichlet boundary conditions are employed the values of the Right Hand Side ($rhs$) of matrix equation are just set to prescribed values ($0$ on the outer boundary and $f(t)$ on inner boundary).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
// Set boundary conditions&lt;br /&gt;
for (int i : boundary) {&lt;br /&gt;
    if (discretization.types()[i] == CENTRE) {&lt;br /&gt;
        op.value(i) = A * std::sin(omega*dt*2);  // step&lt;br /&gt;
    } else {&lt;br /&gt;
        op.value(i) = 0.0;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
At each time step the matrix equation is solved  using an Eigen linear equation solver, in this case, the BiCGStab algorithm. $E0$ and $E1$ are updated and the source is set to new value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot; line&amp;gt;&lt;br /&gt;
 // Solve matrix system&lt;br /&gt;
VectorXd E2 = solver.solve(rhs);&lt;br /&gt;
&lt;br /&gt;
// Update previous states&lt;br /&gt;
E0 = E1;&lt;br /&gt;
E1 = E2;&lt;br /&gt;
&lt;br /&gt;
 // Update rhs on interior&lt;br /&gt;
for (int i : interior) {&lt;br /&gt;
    rhs(i) = 2*E1(i)-E0(i);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Update rhs on boundary&lt;br /&gt;
for (int i : (discretization.types() == CENTRE)) {&lt;br /&gt;
    rhs(i) = A * std::sin(omega*dt*tt);  // step&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The animation of solution is presented below. The complete exampe is avalible at  [https://gitlab.com/e62Lab/medusa/tree/dev/examples/wave_equation wave_equation_2D.cpp].  This example is covered in more detail in linked document [[:File:Meshless solution to wave equation.pdf]].&lt;br /&gt;
&lt;br /&gt;
[[File:EM_wave_2d_dt_e-6_dens40_omega128_v8 2X speed.mp4|400px]]&lt;br /&gt;
&lt;br /&gt;
Go back to [[Medusa#Examples|Examples]].&lt;/div&gt;</summary>
		<author><name>E6WikiAdmin</name></author>	</entry>

	<entry>
		<id>http://e6.ijs.si/medusa/wiki/index.php?title=Solid_Mechanics&amp;diff=3507</id>
		<title>Solid Mechanics</title>
		<link rel="alternate" type="text/html" href="http://e6.ijs.si/medusa/wiki/index.php?title=Solid_Mechanics&amp;diff=3507"/>
				<updated>2022-12-04T17:33:16Z</updated>
		
		<summary type="html">&lt;p&gt;E6WikiAdmin: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Numerical examples =&lt;br /&gt;
&lt;br /&gt;
The following pages describe several case studies in the field of elastostatics and elastodynamics. The subpages include the problem description (equations and boundary conditions), analytical solutions if obtainable and numerical results for given parameter values.&lt;br /&gt;
&lt;br /&gt;
*[[Point contact]]&lt;br /&gt;
*[[Cantilever beam]]&lt;br /&gt;
*[[Hertzian contact]]&lt;br /&gt;
*[[FWO case | Fretting fatigue contact]]&lt;br /&gt;
&lt;br /&gt;
=Basic equations of elasticity=&lt;br /&gt;
&lt;br /&gt;
To determine the distribution of static stresses and displacements in a solid body we must obtain a solution (either analytically or numerically) to the basic equations of the theory of elasticity, satisfying the boundary conditions on forces and/or displacements. The equations thus form a boundary value problem. For a general three dimensional solid object the equations governing its behavior are:&lt;br /&gt;
* equations of equilibrium (3)&lt;br /&gt;
* strain-displacement equations (6)&lt;br /&gt;
* stress-strain equations (6)&lt;br /&gt;
where the number in brackets indicates the number of equations. The equations of equilibrium are three tensor partial differential equations for the balance of linear momentum, the strain-displacement equations are relations that stem from infinitesimal strain theory and the stress-strain equations are a set of linear algebraic constitutive relations (3D Hooke's law). In two dimensions these equations simplify to 8 equations (2 equilibrium, 3 strain-displacement, and 3 stress-strain).&lt;br /&gt;
&lt;br /&gt;
A large amount of confusion regarding linear elasticity originates from the many different notations used in this field. For this reason we first provide an overview of the different notations that are used.&lt;br /&gt;
&lt;br /&gt;
=== Direct tensor form ===&lt;br /&gt;
In direct tensor form (independent of coordinate system) the governing equations are:&lt;br /&gt;
*Equation of motion (an expression of Newton's second law):&lt;br /&gt;
\[&lt;br /&gt;
\boldsymbol{\nabla} \cdot \boldsymbol{\sigma} + \boldsymbol{F} = \rho \ddot{\boldsymbol{u}}&lt;br /&gt;
\]&lt;br /&gt;
*Strain-displacement equations:&lt;br /&gt;
\[&lt;br /&gt;
\boldsymbol{\varepsilon} = \frac{1}{2}\left[ \boldsymbol{\nabla} \boldsymbol{u} + (\boldsymbol{\nabla} \boldsymbol{u})^T  \right]&lt;br /&gt;
\]&lt;br /&gt;
*Stress-displacement equations (constitutive equations). For a linear elastic material this is Hooke's law:&lt;br /&gt;
\[&lt;br /&gt;
\boldsymbol{\sigma} = \boldsymbol{C} : \boldsymbol{\varepsilon}&lt;br /&gt;
\]&lt;br /&gt;
&lt;br /&gt;
where $\boldsymbol{\sigma}$ is the Cauchy stress tensor, $\boldsymbol{\varepsilon}$ is the infinitesimal strain tensor, $\boldsymbol{u}$ is the displacement vector, $\boldsymbol{C}$ is the fourth order stiffness tensor, $\boldsymbol{F}$ is the body force per unit volume (a vector quantity), $\rho$ is the mass density, $\boldsymbol{\nabla}(\bullet)$ is the gradient operator, $\boldsymbol{\nabla}\cdot(\bullet)$ is the divergence operator, $(\bullet)^T$ represents a transpose, $\ddot{(\bullet)}$ is the second derivative with respect to time, and $\boldsymbol{A}:\boldsymbol{B}$ is the inner product of two second order tensors (a tensor contraction).&lt;br /&gt;
&lt;br /&gt;
=== Cartesian coordinate form ===&lt;br /&gt;
&lt;br /&gt;
Using the Einstein summation convention (implied summations over repeated indexes) the equations are:&lt;br /&gt;
*Equation of motion (an expression of Newton's second law):&lt;br /&gt;
\[&lt;br /&gt;
\sigma_{ji,j} + F_i = \rho \partial_{tt} u_i&lt;br /&gt;
\]&lt;br /&gt;
*Strain-displacement equations:&lt;br /&gt;
\[&lt;br /&gt;
\varepsilon_{ij} = \frac{1}{2}\left(u_{j,i}+u_{i,j}\right)&lt;br /&gt;
\]&lt;br /&gt;
*Stress-displacement equations (constitutive equations). For a linear elastic material this is Hooke's law:&lt;br /&gt;
\[&lt;br /&gt;
\sigma_{i,j} = C_{ijkl} \varepsilon_{kl},&lt;br /&gt;
\]&lt;br /&gt;
where $i,j = 1,2,3$ represent, respectively, $x$, $y$ and $z$, the $(\bullet),j$ subscript is a shorthand for partial derivative $\partial(\bullet)/\partial x_j$ and $\partial_{tt}$ is shorthand notation for $\partial^2/\partial t^2$, $\sigma_{ij}=\sigma_{ji}$ is the Cauchy stress tensor (with 6 independent components), $F_i$ are the body forces, $\rho$ is the mass density, $u_i$ is the displacement, $\varepsilon_{ij} = \varepsilon_{ji}$ is the strain tensor (also with 6 independent components), and, finally $C_{ijkl}$ is the fourth-order stiffness tensor that due to symmetry requirements $C_{ijkl} = C_{klij} = C_{jikl} =C_{ijkl}$ can be reduced to 21 different elements.&lt;br /&gt;
&lt;br /&gt;
=== Matrix-vector (FEM) notation ===&lt;br /&gt;
&lt;br /&gt;
*Equation of motion:&lt;br /&gt;
\[&lt;br /&gt;
\boldsymbol{L}^T\boldsymbol{\sigma} + \boldsymbol{F} = \rho\ddot{\boldsymbol{u}}&lt;br /&gt;
\]&lt;br /&gt;
*Strain-displacement equations:&lt;br /&gt;
\[&lt;br /&gt;
\boldsymbol{\varepsilon} = \boldsymbol{L}\boldsymbol{u}&lt;br /&gt;
\]&lt;br /&gt;
*Stress-displacement equations (constitutive equations). For a linear elastic material this is Hooke's law:&lt;br /&gt;
\[&lt;br /&gt;
\boldsymbol{\sigma} = \boldsymbol{C}\boldsymbol{\varepsilon}&lt;br /&gt;
\]&lt;br /&gt;
where $\boldsymbol{\sigma}$ is the Cauchy stress tensor represented in vector form (6 components), $\boldsymbol{L}$ is a differential operator matrix (size $3 \times 6$), $\bullet^T$ is transpose of a matrix $\bullet$, $\boldsymbol{F}$ is the body force vector, $\rho$ is the mass density, $\boldsymbol{u}$ is the displacement vector, $\boldsymbol{\varepsilon}$ is the strain tensor represented in vector form (6 components), and $\boldsymbol{C}$ is the symmetric stress-strain matrix (size $6 \times 6$ with 21 material constants $C_{ij} = C_{ji}$). Certain literature prefers using the symbol $\boldsymbol{D}$ instead of $\boldsymbol{C}$ for the stress-strain matrix. The symbol $C$ is then used as the &amp;quot;compliance tensor&amp;quot; that relates the strains to the stresses, e.g. $\boldsymbol{\varepsilon} = \boldsymbol{C}\boldsymbol{\sigma}$.&lt;br /&gt;
&lt;br /&gt;
To solve the basic equations of elasticity two approaches exist according to the boundary conditions of the boundary value problem. In the '''displacement formulation''' the displacements are prescribed everywhere at the boundaries and the stresses and strains are eliminated from the formulation. The other possible option is that the surface tractions are prescribed everywhere on the surface boundary. The equations of elasticity are then manipulated to leave the stresses as the unknown to be solved for. This approach is known as the [https://en.wikipedia.org/wiki/Linear_elasticity#Stress_formulation '''stress formulation'''] and will not be considered here further.&lt;br /&gt;
&lt;br /&gt;
== Displacement formulation ==&lt;br /&gt;
&lt;br /&gt;
The goal of the displacement formulation is to eliminate the strains and stresses from the basic equations of elasticity and leave only the displacements as the unknown to be solved for. The first step is to substitute the strain-displacement equations into Hooke's law, eliminating the strains as unknowns:&lt;br /&gt;
\begin{equation}\label{eq:3d_hooke}&lt;br /&gt;
\sigma_{ij} = \lambda\delta_{ij}\varepsilon_{kk} + 2\mu\varepsilon_{ij} \quad \Rightarrow \quad &lt;br /&gt;
\begin{cases} &lt;br /&gt;
\sigma_{xx} = \lambda (u_{x,x}+u_{y,y}+u_{z,z}) + 2\mu u_{x,x}\\ &lt;br /&gt;
\sigma_{yy} = \lambda (u_{x,x}+u_{y,y}+u_{z,z}) + 2\mu u_{y,y}\\&lt;br /&gt;
\sigma_{zz} = \lambda (u_{x,x}+u_{y,y}+u_{z,z}) + 2\mu u_{z,z}\\&lt;br /&gt;
\sigma_{xy} = \mu (u_{x,y} + u_{y,x})\\&lt;br /&gt;
\sigma_{yz} = \mu (u_{y,z} + u_{z,y})\\&lt;br /&gt;
\sigma_{zx} = \mu (u_{z,x} + u_{x,z})&lt;br /&gt;
\end{cases}&lt;br /&gt;
\end{equation}&lt;br /&gt;
where $\lambda$ and $\mu$ are [https://en.wikipedia.org/wiki/Lam%C3%A9_parameters Lamé parameters]. The formula above can also be written more concisely as &lt;br /&gt;
\[&lt;br /&gt;
\sigma_{ij} = \lambda \delta_{ij} u_{k,k} + \mu(u_{i,j}+u_{j,i}).&lt;br /&gt;
\]&lt;br /&gt;
The next step is to substitute these equations into the equilibrium equation&lt;br /&gt;
\[&lt;br /&gt;
\sigma_{ij,j} + F_i = \rho \partial_{tt} u_i \quad \Rightarrow \quad &lt;br /&gt;
\begin{cases}&lt;br /&gt;
\frac{\partial \sigma_{xx}}{\partial x} + \frac{\partial \sigma_{xy}}{\partial y} + \frac{\partial \sigma_{xz}}{\partial z} + F_x = \rho \frac{\partial^2 u_x}{\partial t^2} \\&lt;br /&gt;
\frac{\partial \sigma_{yx}}{\partial x} + \frac{\partial \sigma_{yy}}{\partial y} + \frac{\partial \sigma_{yz}}{\partial z} + F_y = \rho \frac{\partial^2 u_y}{\partial t^2} \\&lt;br /&gt;
\frac{\partial \sigma_{zx}}{\partial x} + \frac{\partial \sigma_{zy}}{\partial y} + \frac{\partial \sigma_{zz}}{\partial z} + F_z = \rho \frac{\partial^2 u_z}{\partial t^2} &lt;br /&gt;
\end{cases}&lt;br /&gt;
\]&lt;br /&gt;
resulting in&lt;br /&gt;
\begin{align*}&lt;br /&gt;
&lt;br /&gt;
\frac{\partial}{\partial x}\left( \lambda \left( \frac{\partial u_x}{\partial x} + \frac{\partial u_y}{\partial y} + \frac{\partial u_z}{\partial z} \right) + 2\mu \frac{\partial u_x}{\partial x} \right) + \frac{\partial}{\partial y}\left(\mu\left(\frac{\partial u_x}{\partial y}+\frac{\partial u_y}{\partial x}\right)\right) + \frac{\partial}{\partial z}\left(\mu\left(\frac{\partial u_x}{\partial z}+\frac{\partial u_z}{\partial x}\right)\right) + F_x &amp;amp;= \rho \frac{\partial^2 u_x}{\partial t^2} \\&lt;br /&gt;
\frac{\partial}{\partial x}\left(\mu\left(\frac{\partial u_y}{\partial x}+\frac{\partial u_x}{\partial y}\right)\right) + \frac{\partial}{\partial y}\left(\lambda \left( \frac{\partial u_x}{\partial x} + \frac{\partial u_y}{\partial y} + \frac{\partial u_z}{\partial z} \right) + 2\mu \frac{\partial u_y}{\partial y}\right) + \frac{\partial}{\partial z}\left(\mu\left(\frac{\partial u_y}{\partial z}+\frac{\partial u_z}{\partial y}\right)\right) + F_y &amp;amp;= \rho \frac{\partial^2 u_y}{\partial t^2}\\&lt;br /&gt;
\frac{\partial}{\partial x}\left(\mu\left(\frac{\partial u_z}{\partial x}+\frac{\partial u_x}{\partial z}\right)\right) + \frac{\partial}{\partial y}\left(\mu\left(\frac{\partial u_z}{\partial y}+\frac{\partial u_y}{\partial z}\right)\right) + \frac{\partial}{\partial z}\left(\lambda \left( \frac{\partial u_x}{\partial x} + \frac{\partial u_y}{\partial y} + \frac{\partial u_z}{\partial z} \right) + 2\mu \frac{\partial u_z}{\partial z}\right) + F_z &amp;amp;= \rho \frac{\partial^2 u_z}{\partial t^2}&lt;br /&gt;
&lt;br /&gt;
\end{align*}&lt;br /&gt;
Using the assumption that Lamé parameters $\lambda$ and $\mu$ are constant we can rearrange to produce:&lt;br /&gt;
\begin{align*}&lt;br /&gt;
(\lambda + \mu) \frac{\partial}{\partial x}\left(\frac{\partial u_x}{\partial x}+\frac{\partial u_y}{\partial y}+\frac{\partial u_z}{\partial z}\right) + \mu\left(\frac{\partial^2 u_x}{\partial x^2}+\frac{\partial^2 u_x}{\partial y^2}+\frac{\partial^2 u_x}{\partial z^2}\right) + F_x &amp;amp;= \rho \frac{\partial^2 u_x}{\partial t^2} \\&lt;br /&gt;
(\lambda + \mu) \frac{\partial}{\partial y}\left(\frac{\partial u_x}{\partial x}+\frac{\partial u_y}{\partial y}+\frac{\partial u_z}{\partial z}\right) + \mu\left(\frac{\partial^2 u_y}{\partial x^2}+\frac{\partial^2 u_y}{\partial y^2}+\frac{\partial^2 u_y}{\partial z^2}\right) + F_y &amp;amp;= \rho \frac{\partial^2 u_y}{\partial t^2} \\&lt;br /&gt;
(\lambda + \mu) \frac{\partial}{\partial z}\left(\frac{\partial u_x}{\partial x}+\frac{\partial u_y}{\partial y}+\frac{\partial u_z}{\partial z}\right) + \mu\left(\frac{\partial^2 u_z}{\partial x^2}+\frac{\partial^2 u_z}{\partial y^2}+\frac{\partial^2 u_z}{\partial z^2}\right) + F_z &amp;amp;= \rho \frac{\partial^2 u_z}{\partial t^2} \\&lt;br /&gt;
\end{align*}&lt;br /&gt;
&lt;br /&gt;
We can easily see that only the displacements are left in these equations. The equations obtaines in this manner are known as the Navier-Cauchy equations.&lt;br /&gt;
&lt;br /&gt;
=== Navier-Cauchy equations ===&lt;br /&gt;
The Navier or Navier-Cauchy equations describe the dynamics of a solid through the displacement vector field $\b{u}$. The equations can also be expressed concisely in vector form as follows&lt;br /&gt;
\begin{equation}\label{eq:navier_mu_lambda}&lt;br /&gt;
\rho \frac{\partial^2 \b{u}}{\partial t^2} = (\lambda + \mu) \nabla(\nabla \cdot \b{u}) + \mu \nabla^2 \b{u} + \b{F}&lt;br /&gt;
\end{equation}&lt;br /&gt;
where $\mu$ and $\lambda$ are Lamé constants, $\rho$ is the object density and $\b{F}$ are the external forces. In certain cases we may prefer to use the Young modulus $E$ and the Poisson ratio $\nu$ instead of the Lamé constants. In this case the Navier equations are&lt;br /&gt;
\begin{equation}\label{eq:navier_young_poisson}&lt;br /&gt;
\rho \frac{\partial^2 \b{u}}{\partial t^2} = \frac{E}{2(1+\nu)}\left(\nabla^2 \b{u} + \frac{1}{1-2\nu}\nabla\left(\nabla \cdot \b{u}\right)\right) + \b{F}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ==Strain-displacement equations==&lt;br /&gt;
&lt;br /&gt;
Under the action of applied forces, a point in the solid originally at $\boldsymbol{x} = (x,y,z)$ moves to position $\boldsymbol{X} = (X,Y,Z)$. This movement can be described completely by the displacement vector &lt;br /&gt;
\begin{equation*}&lt;br /&gt;
\boldsymbol{u}(\boldsymbol{x}) = \boldsymbol{X} - \boldsymbol{x},&lt;br /&gt;
\end{equation*}&lt;br /&gt;
consisting of three components&lt;br /&gt;
\begin{equation}&lt;br /&gt;
\boldsymbol{u} = \{u_x \quad u_y \quad u_z\}.&lt;br /&gt;
\end{equation}&lt;br /&gt;
The brackets $\{\}$ indicate that this is a column vector. The components of this vector are mutually orthogonal and their positive directions correspond to the positive directions of the coordinate axes. To prevent confusion with the shorthand notation for partial derivatives, the components of $\boldsymbol{u}$ are sometimes represented with the letter $u, v, w$, e.g. $\boldsymbol{u} = \{u \quad v \quad w\}$.&lt;br /&gt;
&lt;br /&gt;
The strains in the deformed structure can be expressed as partial derivatives of the displacements as follows: --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Two-dimensional stress distributions ==&lt;br /&gt;
Many problems in elasticity can be simplified as two-dimensional problems described by ''plane theory of elasticity''. In general there are two types of problems we may encounter in plane analysis: '''plane stress''' and '''plane strain'''. The first problem arises in analysis of thin plates loaded in the plane of the plate, while the second is used for elongated bodies of constant cross section subject to uniform loading.&lt;br /&gt;
&lt;br /&gt;
=== Plane stress ===&lt;br /&gt;
&lt;br /&gt;
Plane stress distributions build on the assumption that the normal stress and shear stresses directed perpendicular to the $x$-$y$ plane are assumed zero:&lt;br /&gt;
\begin{equation}\label{eq:pstress_assump}&lt;br /&gt;
\sigma_{zz} = \sigma_{zx} = \sigma_{zy} = 0.&lt;br /&gt;
\end{equation}&lt;br /&gt;
It is also assumed that the stress components do not vary through the thickness of the plate (the assumptions do violate some compatibility conditions, but are still sufficiently accurate for practical applications if the plate is thin).&lt;br /&gt;
&lt;br /&gt;
Using (\ref{eq:pstress_assump}) the three-dimensional Hooke's law can be reduced to:&lt;br /&gt;
\begin{equation}\label{eq:planestress}&lt;br /&gt;
\boldsymbol{\sigma} = \boldsymbol{C}\boldsymbol{\varepsilon}&lt;br /&gt;
\end{equation}&lt;br /&gt;
in matrix form where for isotropic materials, we have&lt;br /&gt;
\begin{equation}\label{eq:planestressmatrix}&lt;br /&gt;
\boldsymbol{C}&lt;br /&gt;
= \frac{E}{1-\nu^2}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
1 &amp;amp; \nu &amp;amp; 0 \\&lt;br /&gt;
\nu &amp;amp; 1 &amp;amp; 0 \\&lt;br /&gt;
0 &amp;amp; 0 &amp;amp; \frac{1-\nu}{2}&lt;br /&gt;
\end{bmatrix} \qquad \text{(Plane stress)}&lt;br /&gt;
\end{equation}&lt;br /&gt;
and &lt;br /&gt;
\begin{equation}\label{eq:2d_stress}&lt;br /&gt;
\b{\sigma} = \begin{bmatrix} \sigma_{xx} \\ \sigma_{yy} \\ \sigma_{xy}\end{bmatrix},&lt;br /&gt;
\end{equation}&lt;br /&gt;
\begin{equation}\label{eq:2d_strain}&lt;br /&gt;
\b{\varepsilon} = \begin{bmatrix} \varepsilon_{xx} \\ \varepsilon_{yy} \\ \gamma_{xy} \end{bmatrix} =&lt;br /&gt;
\begin{bmatrix} \varepsilon_{xx} \\ \varepsilon_{yy} \\ 2\varepsilon_{xy} \end{bmatrix} = &lt;br /&gt;
\begin{bmatrix} \frac{\partial u_x}{\partial x} \\ \frac{\partial u_y}{\partial y} \\ \frac{\partial u_y}{\partial x} + \frac{\partial u_x}{\partial y} \end{bmatrix}.&lt;br /&gt;
\end{equation}&lt;br /&gt;
Note that the strain tensor uses the so-called engineering shear strain $\gamma_{ij}$. Under the plane stress assumption the Navier equations are given as:&lt;br /&gt;
\begin{equation}\label{eq:navier_plane_stress}&lt;br /&gt;
\rho \frac{\partial^2 \b{u}}{\partial t^2} = \frac{E}{2(1+\nu)} \left( \b{\nabla}^2 \b{u} + \frac{1+\nu}{1-\nu}\b{\nabla}\left( \b{\nabla}\cdot \b{u}\right)  \right) + \b{F}&lt;br /&gt;
\end{equation}&lt;br /&gt;
or in component notation&lt;br /&gt;
\begin{align}&lt;br /&gt;
\rho \frac{\partial^2 u_x}{\partial t^2} &amp;amp;= \frac{E}{2(1+\nu)} \left( \frac{\partial^2 u_x}{\partial x^2} + \frac{\partial^2 u_x}{\partial y^2} \right) + \frac{E}{2(1-\nu)} \frac{\partial}{\partial x}\left( \frac{\partial u_x}{\partial x} + \frac{\partial u_y}{\partial y} \right) \\&lt;br /&gt;
\rho \frac{\partial^2 u_y}{\partial t^2} &amp;amp;= \frac{E}{2(1+\nu)} \left( \frac{\partial^2 u_y}{\partial x^2} + \frac{\partial^2 u_y}{\partial y^2} \right) + \frac{E}{2(1-\nu)} \frac{\partial}{\partial y}\left( \frac{\partial u_x}{\partial x} + \frac{\partial u_y}{\partial y} \right)&lt;br /&gt;
\end{align}&lt;br /&gt;
&lt;br /&gt;
==== Plane stress with Lamé constants ====&lt;br /&gt;
&lt;br /&gt;
The plane stress stiffness tensor (\ref{eq:planestressmatrix}) may also be expressed in terms of Lamé constants $\lambda$ and $\mu$ by substituting $E$ and $\nu$ with &lt;br /&gt;
\[E = \frac{\mu(3\lambda+2\mu)}{\lambda+\mu}\] &lt;br /&gt;
\[\nu = \frac{\lambda}{2(\lambda+\mu)}\]&lt;br /&gt;
&lt;br /&gt;
With these substitutions the Navier equations can be written in their component form as&lt;br /&gt;
\begin{align}&lt;br /&gt;
\rho \frac{\partial^2 u_x}{\partial t^2} &amp;amp;= \mu \left( \frac{\partial^2 u_x}{\partial x^2} + \frac{\partial^2 u_x}{\partial y^2} \right) + \left(\frac{2 \lambda \mu}{\lambda + 2 \mu}+\mu\right) \frac{\partial}{\partial x}\left( \frac{\partial u_x}{\partial x} + \frac{\partial u_y}{\partial y} \right) \\&lt;br /&gt;
\rho \frac{\partial^2 u_y}{\partial t^2} &amp;amp;= \mu \left( \frac{\partial^2 u_y}{\partial x^2} + \frac{\partial^2 u_y}{\partial y^2} \right) + \left(\frac{2 \lambda \mu}{\lambda + 2 \mu}+\mu\right) \frac{\partial}{\partial y}\left( \frac{\partial u_x}{\partial x} + \frac{\partial u_y}{\partial y} \right)&lt;br /&gt;
\end{align}&lt;br /&gt;
&lt;br /&gt;
=== Plane strain ===&lt;br /&gt;
&lt;br /&gt;
The plane strain problem arises in analysis of walls, dams, tunnels where one dimension of the structure is very large in comparison to the other two dimensions ($x$- and $y$- coordinates). It is also appropriate for small-scale problems such as bars and rollers compressed by forces normal to their cross section. In all such problems the body may be imagined as a prismatic cylinder with one dimension much larger that the other two. The applied forces act in the $x$-$y$ plane and do not vary in the $z$ direction, leading to the assumption&lt;br /&gt;
\begin{equation}&lt;br /&gt;
\frac{\partial}{\partial z} = u_z = 0.&lt;br /&gt;
\end{equation} &lt;br /&gt;
&lt;br /&gt;
With the above assumption it follows immediately that&lt;br /&gt;
\begin{equation}&lt;br /&gt;
\varepsilon_{zz} = \varepsilon_{zx} = \varepsilon_{zy} = 0.&lt;br /&gt;
\end{equation}&lt;br /&gt;
The three dimensional Hooke's law can now be reduced to&lt;br /&gt;
\begin{equation}\label{eq:planestrain}&lt;br /&gt;
\boldsymbol{\sigma} = \boldsymbol{C}\boldsymbol{\varepsilon}&lt;br /&gt;
\end{equation}&lt;br /&gt;
where the matrix $C$ is given by&lt;br /&gt;
\begin{equation}\label{eq:matrixplanestrain}&lt;br /&gt;
\boldsymbol{C}&lt;br /&gt;
= \frac{E}{(1+\nu)(1-2\nu)}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
1-\nu &amp;amp; \nu &amp;amp; 0 \\&lt;br /&gt;
\nu &amp;amp; 1-\nu &amp;amp; 0 \\&lt;br /&gt;
0 &amp;amp; 0 &amp;amp; \frac{1-2\nu}{2}&lt;br /&gt;
\end{bmatrix} \qquad \text{(Plane strain)}&lt;br /&gt;
\end{equation}&lt;br /&gt;
The vectors $\boldsymbol{\sigma}$ and $\boldsymbol{\varepsilon}$ are the same as above for plane stress and are given in (\ref{eq:2d_stress}) and (\ref{eq:2d_strain}), respectively. In the case of plane strain we have additonal non-zero components of the stress tensor:&lt;br /&gt;
\begin{equation}\label{eq:sigmazz}&lt;br /&gt;
\sigma_{zz} = \nu(\sigma_{xx}+\sigma_{yy})&lt;br /&gt;
\end{equation}&lt;br /&gt;
\begin{equation}&lt;br /&gt;
\sigma_{yz} = \sigma_{zx} = 0&lt;br /&gt;
\end{equation}&lt;br /&gt;
The reason $\sigma_{zz}$ is not included in the matrix stress-strain equation (\ref{eq:planestrain}) is because it is linearly dependent on the normal stresses $\sigma_{xx}$ and $\sigma_{zz}$.&lt;br /&gt;
&lt;br /&gt;
The Navier-Cauchy equation that follows from the plane strain assumption can be found in (\ref{eq:navier_young_poisson}). For purposes of completeness we provide here the equations in component notation:&lt;br /&gt;
\begin{align}&lt;br /&gt;
\rho \frac{\partial^2 u_x}{\partial t^2} &amp;amp;= \frac{E}{2(1+\nu)} \left( \frac{\partial^2 u_x}{\partial x^2} + \frac{\partial^2 u_x}{\partial y^2} \right) + \frac{E}{2(1+\nu)(1-2\nu)} \frac{\partial}{\partial x}\left( \frac{\partial u_x}{\partial x} + \frac{\partial u_y}{\partial y} \right) \\&lt;br /&gt;
\rho \frac{\partial^2 u_y}{\partial t^2} &amp;amp;= \frac{E}{2(1+\nu)} \left( \frac{\partial^2 u_y}{\partial x^2} + \frac{\partial^2 u_y}{\partial y^2} \right) + \frac{E}{2(1+\nu)(1-2\nu)} \frac{\partial}{\partial y}\left( \frac{\partial u_x}{\partial x} + \frac{\partial u_y}{\partial y} \right)&lt;br /&gt;
\end{align}&lt;br /&gt;
&lt;br /&gt;
==== Plane strain with Lamé constants ====&lt;br /&gt;
&lt;br /&gt;
Alternatively the stiffness tensor $\b{C}$ in the stress-strain equation $\b{\sigma} = \b{C}\b{\varepsilon}$ may be expressed in terms of $\mu$ and $\lambda$:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
\boldsymbol{C}&lt;br /&gt;
= &lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
2\mu + \lambda &amp;amp; \lambda &amp;amp; 0 \\&lt;br /&gt;
\lambda &amp;amp; 2\mu + \lambda &amp;amp; 0 \\&lt;br /&gt;
0 &amp;amp; 0 &amp;amp; \mu^*&lt;br /&gt;
\end{bmatrix} \qquad \text{(Plane strain)}&lt;br /&gt;
\end{equation}&lt;br /&gt;
(*Note that this matrix requires the strain tensor to be defined using the engineering shear strain $\gamma_{xy} = 2\varepsilon_{xy}$. If we define the strain tensor as $\b{\varepsilon} = \{\varepsilon_{xx}\;\varepsilon_{yy}\;\varepsilon_{xy}\}^T$ then matrix component $C_{33}$ must be $2\mu$.)&lt;br /&gt;
&lt;br /&gt;
The Navier equations in vector form can be found in (\ref{eq:navier_mu_lambda}). In component notation the equations are:&lt;br /&gt;
\begin{align}&lt;br /&gt;
\rho \frac{\partial^2 u_x}{\partial t^2} &amp;amp;= \mu \left( \frac{\partial^2 u_x}{\partial x^2} + \frac{\partial^2 u_x}{\partial y^2} \right) + (\lambda+\mu) \frac{\partial}{\partial x}\left( \frac{\partial u_x}{\partial x} + \frac{\partial u_y}{\partial y} \right) \\&lt;br /&gt;
\rho \frac{\partial^2 u_y}{\partial t^2} &amp;amp;= \mu \left( \frac{\partial^2 u_y}{\partial x^2} + \frac{\partial^2 u_y}{\partial y^2} \right) + (\lambda+\mu) \frac{\partial}{\partial y}\left( \frac{\partial u_x}{\partial x} + \frac{\partial u_y}{\partial y} \right)&lt;br /&gt;
\end{align}&lt;br /&gt;
&lt;br /&gt;
=== Connection between plane stress and plane strain ===&lt;br /&gt;
&lt;br /&gt;
For '''isotropic''' materials with elastic modulus $E$ and Poisson's ratio $\nu$ it is possible to go from plane stress to plane strain, or vice-versa, by replacing $E$ and $\nu$ in the stress-strain matrix with a fictitious modulus $E^*$ and fictitious Poisson ratio $\nu^*$. This allows us to &amp;quot;reuse&amp;quot; a plane stress program to solve plane strain or again vice-versa (as long as the material is isotropic). A few exercises on this topic are given [http://www.colorado.edu/engineering/cas/courses.d/IFEM.d/IFEM.Ch14.d/IFEM.Ch14.pdf at this link (page 13)].&lt;br /&gt;
&lt;br /&gt;
To go from plane stres'''s''' ($s$) to plane strai'''n''' ($n$) insert the fictitious quantities&lt;br /&gt;
\begin{equation}\label{eq:ston1}&lt;br /&gt;
E_n^* = \frac{E_s}{1-\nu_s^2},&lt;br /&gt;
\end{equation}&lt;br /&gt;
\begin{equation}\label{eq:ston2}&lt;br /&gt;
\nu_n^* = \frac{\nu_s}{1-\nu_s}.&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
'''Substitution from plane stress to plane strain'''&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;Note: this derivation is shown just to confirm the above formulas. In a numerical program, we keep the stress-strain matrix and just use the above formulas (\ref{eq:ston1}) and (\ref{eq:ston2}) to update the values of $E$ and $\nu$. Also note we have omitted the indexes ($s$) and ($n$) in the following derivations.&lt;br /&gt;
&lt;br /&gt;
We start with the plane stress matrix with the inserted fictitious values $E^*$ and $\nu^*$&lt;br /&gt;
\[&lt;br /&gt;
\frac{E^*}{1-{\nu^*}^2}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
1 &amp;amp; \nu^* &amp;amp; 0 \\&lt;br /&gt;
\nu^* &amp;amp; 1 &amp;amp; 0 \\&lt;br /&gt;
0 &amp;amp; 0 &amp;amp; \frac{1}{2}(1-\nu^*)&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\] &lt;br /&gt;
and make the above substitutions (\ref{eq:ston1}) and (\ref{eq:ston2}) leading to:&lt;br /&gt;
\[&lt;br /&gt;
\frac{E}{\left(1-\nu^2\right)\left(1-\left(\frac{\nu}{1-\nu}\right)^2\right)}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
1 &amp;amp; \frac{\nu}{1-\nu} &amp;amp; 0 \\&lt;br /&gt;
\frac{\nu}{1-\nu} &amp;amp; 1 &amp;amp; 0 \\&lt;br /&gt;
0 &amp;amp; 0 &amp;amp; \frac{1}{2}(1-\frac{\nu}{1-\nu})&lt;br /&gt;
\end{bmatrix}.&lt;br /&gt;
\]&lt;br /&gt;
We can then use the rule to convert sums of squares into products as well as bring the factor $1/(1-v)$ out of the matrix:&lt;br /&gt;
\[&lt;br /&gt;
\frac{E}{\left(1-\nu\right)\left(1+\nu\right)\left(1-\frac{\nu}{1-\nu}\right)\left(1+\frac{\nu}{1-\nu}\right)\left(1-\nu\right)}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
1-\nu &amp;amp; \nu &amp;amp; 0 \\&lt;br /&gt;
\nu &amp;amp; 1-\nu &amp;amp; 0 \\&lt;br /&gt;
0 &amp;amp; 0 &amp;amp; \frac{1}{2}(1-2\nu)&lt;br /&gt;
\end{bmatrix}.&lt;br /&gt;
\]&lt;br /&gt;
By joining some of the factors to a common denominator and rearranging leads to&lt;br /&gt;
\[&lt;br /&gt;
\frac{E\left(1-\nu\right)\left(1-\nu\right)}{\left(1-\nu\right)\left(1+\nu\right)\left(1-2\nu\right)1\left(1-\nu\right)}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
1-\nu &amp;amp; \nu &amp;amp; 0 \\&lt;br /&gt;
\nu &amp;amp; 1-\nu &amp;amp; 0 \\&lt;br /&gt;
0 &amp;amp; 0 &amp;amp; \frac{1}{2}(1-2\nu)&lt;br /&gt;
\end{bmatrix}.&lt;br /&gt;
\]&lt;br /&gt;
The final step is canceling the factors that occur in both the numerator and denominator &lt;br /&gt;
\[&lt;br /&gt;
\frac{E}{\left(1+\nu\right)\left(1-2\nu\right)}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
1-\nu &amp;amp; \nu &amp;amp; 0 \\&lt;br /&gt;
\nu &amp;amp; 1-\nu &amp;amp; 0 \\&lt;br /&gt;
0 &amp;amp; 0 &amp;amp; \frac{1}{2}(1-2\nu)&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\]&lt;br /&gt;
which leads exactly to the relationship for plane strain given in (\ref{eq:planestrain}).&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the opposite case we want to go from plane strai'''n''' ($n$) to plane stres'''s''' ($s$) we can use:&lt;br /&gt;
\begin{equation}\label{eq:ntos1}&lt;br /&gt;
E_s^* = \frac{E_n(1+2\nu_n)}{(1+\nu_n)^2},&lt;br /&gt;
\end{equation}&lt;br /&gt;
\begin{equation}\label{eq:ntos2}&lt;br /&gt;
\nu_s^* = \frac{\nu_n}{1+\nu_n}.&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
'''Substitution from plane strain to plane stress'''&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Note that we have again omitted the indexes ($s$) and ($n$) since our wish is expressed by the bold title.&lt;br /&gt;
&lt;br /&gt;
We start with the plane strain matrix with the inserted fictitious values $E^*$ and $\nu^*$&lt;br /&gt;
\[&lt;br /&gt;
\frac{E^*}{\left(1+\nu^*\right)\left(1-2\nu^*\right)}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
1-\nu^* &amp;amp; \nu^* &amp;amp; 0 \\&lt;br /&gt;
\nu^* &amp;amp; 1-\nu^* &amp;amp; 0 \\&lt;br /&gt;
0 &amp;amp; 0 &amp;amp; \frac{1}{2}(1-2\nu^*)&lt;br /&gt;
\end{bmatrix}&lt;br /&gt;
\] &lt;br /&gt;
and make the above substitutions (\ref{eq:ntos1}) and (\ref{eq:ntos2}) leading to:&lt;br /&gt;
\[&lt;br /&gt;
\frac{E(1+2\nu)}{\left(1+\nu\right)^2\left(1+\frac{\nu}{1+\nu}\right)\left(1-2\frac{\nu}{1+\nu}\right)}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
1-\frac{\nu}{1+\nu} &amp;amp; \frac{\nu}{1+\nu} &amp;amp; 0 \\&lt;br /&gt;
\frac{\nu}{1+\nu} &amp;amp; 1-\frac{\nu}{1+\nu} &amp;amp; 0 \\&lt;br /&gt;
0 &amp;amp; 0 &amp;amp; \frac{1}{2}(1-2\frac{\nu}{1+\nu})&lt;br /&gt;
\end{bmatrix}.&lt;br /&gt;
\]&lt;br /&gt;
Writing some of the sums with common denominators and rearranging leads to&lt;br /&gt;
\[&lt;br /&gt;
\frac{E(1+2\nu)(1+\nu)(1+\nu)}{\left(1+\nu\right)^2\left(1+2\nu\right)\left(1-\nu\right)}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
\frac{1}{1+\nu} &amp;amp; \frac{\nu}{1+\nu} &amp;amp; 0 \\&lt;br /&gt;
\frac{\nu}{1+\nu} &amp;amp; \frac{1}{1+\nu} &amp;amp; 0 \\&lt;br /&gt;
0 &amp;amp; 0 &amp;amp; \frac{1}{2}\left(\frac{1-\nu}{1+\nu}\right)&lt;br /&gt;
\end{bmatrix}.&lt;br /&gt;
\]&lt;br /&gt;
We can also bring the factor $1/(1+\nu)$ out from the matrix components. After canceling all factors that occur in both denominator and numerator we are left with&lt;br /&gt;
\[&lt;br /&gt;
\frac{E}{\left(1+\nu\right)\left(1-\nu\right)}&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
1 &amp;amp; \nu &amp;amp; 0 \\&lt;br /&gt;
\nu &amp;amp; 1 &amp;amp; 0 \\&lt;br /&gt;
0 &amp;amp; 0 &amp;amp; \frac{1}{2}(1-\nu)&lt;br /&gt;
\end{bmatrix}.&lt;br /&gt;
\]&lt;br /&gt;
Rewriting the product of sums as a sum of squares gives us the matrix for plane stress in (\ref{eq:planestress}).&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Principal stresses ===&lt;br /&gt;
This are the stresses when we rotate our coordinate system so that there are no shear components.&lt;br /&gt;
The principal stresses for plane stress conditions are given as eigenvalues of $\sigma$ with &lt;br /&gt;
\[&lt;br /&gt;
  \sigma_{1,2} = \frac12 (s_{xx} + s_{zz}) \pm \sqrt{\frac{1}{4}(s_{xx}-s_{zz})^2 + s_{xz}^2}.&lt;br /&gt;
\]&lt;br /&gt;
The principal shear stress or principal stress difference is the stress where only shear stresses are present. In case of plane stress it is calculated as&lt;br /&gt;
\[&lt;br /&gt;
  \tau_1 = \sqrt{\frac{1}{4}(s_{xx}-s_{zz})^2 + s_{xz}^2} = \frac{|\sigma_1 - \sigma_2|}{2}.&lt;br /&gt;
\]&lt;br /&gt;
&lt;br /&gt;
When the stress tensor is z 3x3 matrix, the formulas for eigenvalues are more complicated.&lt;br /&gt;
&lt;br /&gt;
=== Von Mises stress ===&lt;br /&gt;
&lt;br /&gt;
A more detailed explanation of the von Mises stress can be found on [https://en.wikipedia.org/wiki/Von_Mises_yield_criterion Wikipedia].&lt;br /&gt;
&lt;br /&gt;
In materials science and engineering the von Mises yield criterion can be also formulated in terms of the von Mises stress or equivalent tensile stress, $\sigma_\mathrm{v}$. This is a scalar value of stress that can be computed from the Cauchy stress tensor $\boldsymbol{\sigma}$. In this case, a material is said to start yielding when the von Mises stress reaches a value known as yield strength, $\sigma_\mathrm{y}$.&lt;br /&gt;
&lt;br /&gt;
Mathematically the von Mises yield criterion can be expressed as:&lt;br /&gt;
\[&lt;br /&gt;
  \sigma _\mathrm{v}=\sigma_\mathrm{y}={\sqrt {3J_{2}}}, &lt;br /&gt;
\]&lt;br /&gt;
where $J_2$ is the [https://en.wikipedia.org/wiki/Cauchy_stress_tensor#Stress_deviator_tensor second deviatoric stress invariant].&lt;br /&gt;
&lt;br /&gt;
In the case of general '''plane stress''' ($\sigma_{33}=0$,$\sigma_{23}=0$, $\sigma_{31}=0$) the von Mises stress can be calculated as:&lt;br /&gt;
\[&lt;br /&gt;
\sigma_\mathrm{v} = \sqrt{\sigma_{11}^2 - \sigma_{11}\sigma_{22}+\sigma_{22}^2 + 3\sigma_{12}^2}.&lt;br /&gt;
\]&lt;br /&gt;
&lt;br /&gt;
= computational solid mechanics =&lt;br /&gt;
&lt;br /&gt;
The goal in computational solid mechanics is to solve the equation of motion for a solid body&lt;br /&gt;
\[\rho \frac{\partial^2 \b{u}}{\partial t^2} = \nabla\cdot\b{\sigma} + \b{F}\]&lt;br /&gt;
&lt;br /&gt;
on the given domain $\Gamma = \Gamma_N \cup \Gamma_D$ with Dirichlet (essential) boundary conditions&lt;br /&gt;
\[ \b{u} = \bar{\b{u}} \quad \text{ on } \Gamma_D,\]&lt;br /&gt;
and traction (natural) boundary conditions&lt;br /&gt;
\[ \b{\sigma}\cdot\b{n} = \bar{\b{t}},\quad \text{ on } \Gamma_N,\]&lt;br /&gt;
where the quantities with the bar sign $\bar{}$ indicate prescribed displacements and surface tractions, respectively. Another type of boundary condition are mixed (Robyn) type boundary conditions. In this case the displacement might be given in one direction, and the traction will be given for the other direction.&lt;br /&gt;
In case the right-hand side value is zero, the boundary conditions are called homogeneous. Homogeneous Dirichlet boundary conditions mean the the body is fully fixed (constrained), while zero traction boundary conditions allow the surface to move freely.&lt;br /&gt;
&lt;br /&gt;
Using Hooke's law and the strain-displacement relation, the equation of motion can be transformed into the Navier-Cauchy equations&lt;br /&gt;
\[\rho \frac{\partial^2 \b{u}}{\partial t^2} = \mu\nabla^2\b{u} + (\lambda+\mu)\nabla(\nabla\cdot\b{u}) + \b{F}.\]&lt;br /&gt;
The solution of this equation with appropriate BC's will give us the desired displacement values across the domain.&lt;br /&gt;
&lt;br /&gt;
To obtain the steady state solution we have two possible strategies:&lt;br /&gt;
# Add a (linear) dampening term to the Navier equation, and simulate the dynamic behaviour until the motion ceases: \[\rho \frac{\partial^2 \b{u}}{\partial t^2} + \eta_C \frac{\partial \b{u}}{\partial t} = \mu\nabla^2\b{u} + (\lambda+\mu)\nabla(\nabla\cdot\b{u}) + \b{F}.\]&lt;br /&gt;
# Directly solve for steady state: \[\mu\nabla^2\b{u} + (\lambda+\mu)\nabla(\nabla\cdot\b{u}) + \b{F} = 0.\]&lt;br /&gt;
&lt;br /&gt;
Displacement boundary conditions are very simple to implement with both approaches. The desired values are simply prescribed for dynamic simulation with explicit methods, In case of implicit methods where we need to solve a system of equations the prescribed displacements are placed into the right-hand side of the system, and the value 1 is placed in the diagonal of the matrix (for a given node).&lt;br /&gt;
&lt;br /&gt;
For the traction boundary condition&lt;br /&gt;
&lt;br /&gt;
\[\begin{bmatrix}&lt;br /&gt;
\sigma_{xx} &amp;amp; \sigma_{xy} \\&lt;br /&gt;
\sigma_{yx} &amp;amp; \sigma_{yy}&lt;br /&gt;
\end{bmatrix} \cdot&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
n_x \\&lt;br /&gt;
n_y&lt;br /&gt;
\end{bmatrix} =&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
\bar{t}_x \\&lt;br /&gt;
\bar{t}_y&lt;br /&gt;
\end{bmatrix}\]&lt;br /&gt;
&lt;br /&gt;
we first use Hooke's law and the strain-displacement relations to express the traction boundary in terms of displacements:&lt;br /&gt;
&lt;br /&gt;
\[\begin{bmatrix}&lt;br /&gt;
(2\mu+\lambda)\partial_x u_x + \lambda \partial_y u_y &amp;amp; \mu(\partial_x u_y + \partial_y u_x) \\&lt;br /&gt;
\mu(\partial_x u_y + \partial_y u_x) &amp;amp; \lambda \partial_x u_x + (2\mu + \lambda) \partial_y u_y&lt;br /&gt;
\end{bmatrix} \cdot&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
n_x \\&lt;br /&gt;
n_y&lt;br /&gt;
\end{bmatrix} =&lt;br /&gt;
\begin{bmatrix}&lt;br /&gt;
\bar{t}_x \\&lt;br /&gt;
\bar{t}_y&lt;br /&gt;
\end{bmatrix}\]&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
* Slak J., Kosec G.; Refined meshless local strong form solution of Cauchy-Navier equation on an irregular domain. Engineering analysis with boundary elements. 2018;11 ; [http://comms.ijs.si/~gkosec/data/papers/31107623.pdf manuscript]&lt;br /&gt;
* Theory of matrix structural analysis&lt;br /&gt;
&lt;br /&gt;
'''This list might be incomplete, check also reference on the Main Page.'''&lt;/div&gt;</summary>
		<author><name>E6WikiAdmin</name></author>	</entry>

	</feed>