Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
ddm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
gmsh
ddm
Commits
9810f091
Commit
9810f091
authored
2 years ago
by
Boris Martin
Browse files
Options
Downloads
Patches
Plain Diff
working!
parent
2d004d9c
No related branches found
No related tags found
1 merge request
!21
Poisson tutorial with non-overlapping Robin exchange
Pipeline
#10118
passed
2 years ago
Stage: gmshfem
Stage: build
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
tutorials/poisson_robin_no_overlap/domain.geo
+6
-6
6 additions, 6 deletions
tutorials/poisson_robin_no_overlap/domain.geo
tutorials/poisson_robin_no_overlap/main.cpp
+18
-28
18 additions, 28 deletions
tutorials/poisson_robin_no_overlap/main.cpp
with
24 additions
and
34 deletions
tutorials/poisson_robin_no_overlap/domain.geo
+
6
−
6
View file @
9810f091
// Gmsh project created on Fri Oct 7 15:45:08 2022
// Gmsh project created on Fri Oct 7 15:45:08 2022
//+
//+
Point(1) = {0, 0, 0, 0.0
5
};
Point(1) = {0, 0, 0, 0.0
2
};
//+
//+
Point(2) = {1, 0, 0, 0.0
5
};
Point(2) = {1, 0, 0, 0.0
2
};
//+
//+
Point(3) = {2, 0, 0, 0.0
5
};
Point(3) = {2, 0, 0, 0.0
2
};
//+
//+
Point(4) = {2, 1, 0, 0.0
5
};
Point(4) = {2, 1, 0, 0.0
2
};
//+
//+
Point(5) = {1, 1, 0, 0.0
5
};
Point(5) = {1, 1, 0, 0.0
2
};
//+
//+
Point(6) = {0, 1, 0, 0.0
5
};
Point(6) = {0, 1, 0, 0.0
2
};
//+
//+
Line(1) = {1, 2};
Line(1) = {1, 2};
//+
//+
...
...
This diff is collapsed.
Click to expand it.
tutorials/poisson_robin_no_overlap/main.cpp
+
18
−
28
View file @
9810f091
...
@@ -52,8 +52,8 @@ int main(int argc, char **argv)
...
@@ -52,8 +52,8 @@ int main(int argc, char **argv)
Subdomain
omega
(
nDom
);
Subdomain
omega
(
nDom
);
Interface
sigma
(
nDom
);
Interface
sigma
(
nDom
);
omega
(
0
)
=
omega0
;
// | interface;
omega
(
0
)
=
omega0
;
omega
(
1
)
=
omega1
;
// | interface;
omega
(
1
)
=
omega1
;
sigma
(
0
,
1
)
=
interface
;
sigma
(
0
,
1
)
=
interface
;
sigma
(
1
,
0
)
=
interface
;
sigma
(
1
,
0
)
=
interface
;
...
@@ -76,35 +76,26 @@ int main(int argc, char **argv)
...
@@ -76,35 +76,26 @@ int main(int argc, char **argv)
InterfaceField
<
std
::
complex
<
double
>
,
Form
::
Form0
>
g
(
"g"
,
sigma
,
FunctionSpaceTypeForm0
::
HierarchicalH1
,
order
);
InterfaceField
<
std
::
complex
<
double
>
,
Form
::
Form0
>
g
(
"g"
,
sigma
,
FunctionSpaceTypeForm0
::
HierarchicalH1
,
order
);
formulation
.
addInterfaceField
(
g
);
formulation
.
addInterfaceField
(
g
);
double
alpha
=
1
;
// First domain
// Laplacian(u) = -1 on the domain, and u matches g(1,0) on the interface
formulation
(
0
).
integral
(
grad
(
dof
(
u
(
0
))),
grad
(
tf
(
u
(
0
))),
omega
(
0
)
|
interface
,
gauss
);
formulation
(
0
).
integral
(
-
1.0
,
tf
(
u
(
0
)),
omega
(
0
)
|
interface
,
gauss
);
formulation
(
0
).
integral
((
formulation
.
artificialSource
(
-
g
(
1
,
0
))),
tf
(
u
(
0
)),
interface
,
gauss
);
//formulation(0).integral(dof(u(0)), tf(u(0)), interface, gauss);
// First interface (What 0 sends to 1)
// First interface (What 0 sends to 1)
// Compute g(0,1) such that g(0,1) + g(1,0) = 2 u(0)
// Compute g(0,1) such that g(0,1) + g(1,0) = 2 u(0)
formulation
(
0
,
1
).
integral
(
-
dof
(
g
(
0
,
1
)),
tf
(
g
(
0
,
1
)),
sigma
(
0
,
1
),
gauss
);
formulation
(
0
,
1
).
integral
(
-
formulation
.
artificialSource
(
g
(
1
,
0
)),
tf
(
g
(
0
,
1
)),
sigma
(
0
,
1
),
gauss
);
formulation
(
0
,
1
).
integral
((
2
*
u
(
0
)),
tf
(
g
(
0
,
1
)),
sigma
(
0
,
1
),
gauss
);
//formulation(0, 1).integral((2* grad(u(0))) * normal<std::complex<double>>(), tf(g(0, 1)), sigma(0, 1), gauss);
// Second domain
for
(
int
i
=
0
;
i
<=
1
;
++
i
)
{
formulation
(
1
).
integral
(
grad
(
dof
(
u
(
1
))),
grad
(
tf
(
u
(
1
))),
omega
(
1
)
|
interface
,
gauss
);
std
::
complex
<
double
>
im
(
0.0
,
1.0
);
formulation
(
1
).
integral
(
-
1.0
,
tf
(
u
(
1
)),
omega
(
1
)
|
interface
,
gauss
);
auto
other
=
1
-
i
;
// Domain
formulation
(
1
).
integral
(
formulation
.
artificialSource
(
-
g
(
0
,
1
)),
tf
(
u
(
1
)),
interface
,
gauss
);
formulation
(
i
).
integral
(
grad
(
dof
(
u
(
i
))),
grad
(
tf
(
u
(
i
))),
omega
(
i
),
gauss
);
//formulation(1).integral(dof(u(1)), tf(u(1)), interface, gauss);
formulation
(
i
).
integral
(
formulation
.
physicalSource
(
-
1.0
),
tf
(
u
(
i
)),
omega
(
i
),
gauss
);
formulation
(
i
).
integral
(
formulation
.
artificialSource
(
-
g
(
other
,
i
)),
tf
(
u
(
i
)),
interface
,
gauss
);
// Second interface
formulation
(
i
).
integral
(
alpha
*
(
dof
(
u
(
i
))),
tf
(
u
(
i
)),
interface
,
gauss
);
formulation
(
1
,
0
).
integral
(
-
dof
(
g
(
1
,
0
)),
tf
(
g
(
1
,
0
)),
sigma
(
1
,
0
),
gauss
);
formulation
(
1
,
0
).
integral
(
-
formulation
.
artificialSource
(
g
(
0
,
1
)),
tf
(
g
(
1
,
0
)),
sigma
(
1
,
0
),
gauss
);
// Interface
formulation
(
1
,
0
).
integral
((
2
*
u
(
1
)),
tf
(
g
(
1
,
0
)),
sigma
(
1
,
0
),
gauss
);
formulation
(
i
,
other
).
integral
(
dof
(
g
(
i
,
other
)),
tf
(
g
(
i
,
other
)),
sigma
(
i
,
other
),
gauss
);
//formulation(1, 0).integral((2* grad(u(1))) * normal<std::complex<double>>(), tf(g(0, 1)), sigma(0, 1), gauss);
formulation
(
i
,
other
).
integral
(
formulation
.
artificialSource
(
g
(
other
,
i
)),
tf
(
g
(
i
,
other
)),
sigma
(
i
,
other
),
gauss
);
// It is critical that u(i) be not an artificial source (why ?)
formulation
(
i
,
other
).
integral
(((
-
2.0
*
alpha
)
*
u
(
i
)),
tf
(
g
(
i
,
other
)),
sigma
(
i
,
other
),
gauss
);
}
formulation
.
pre
();
formulation
.
pre
();
...
@@ -117,7 +108,6 @@ int main(int argc, char **argv)
...
@@ -117,7 +108,6 @@ int main(int argc, char **argv)
if
(
isItMySubdomain
(
i
))
{
if
(
isItMySubdomain
(
i
))
{
save
(
u
(
i
),
omega
(
i
),
"u_"
+
std
::
to_string
(
i
));
save
(
u
(
i
),
omega
(
i
),
"u_"
+
std
::
to_string
(
i
));
save
(
u
(
i
)
-
trueSolution
,
omega
(
i
),
"err_"
+
std
::
to_string
(
i
));
save
(
u
(
i
)
-
trueSolution
,
omega
(
i
),
"err_"
+
std
::
to_string
(
i
));
save
(
g
(
i
,
1
-
i
),
sigma
(
i
,
1
-
i
),
"g"
);
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment