Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dg
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
Package registry
Model registry
Operate
Environments
Terraform modules
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
dg
Commits
dbd3868a
Commit
dbd3868a
authored
3 years ago
by
Matteo Cicuttin
Browse files
Options
Downloads
Patches
Plain Diff
New implementation of interface sources.
parent
ad399724
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/maxwell/maxwell_common.h
+41
-0
41 additions, 0 deletions
include/maxwell/maxwell_common.h
src/libgmshdg/gmsh_io.cpp
+2
-2
2 additions, 2 deletions
src/libgmshdg/gmsh_io.cpp
with
43 additions
and
2 deletions
include/maxwell/maxwell_common.h
+
41
−
0
View file @
dbd3868a
...
...
@@ -265,6 +265,47 @@ eval_interface_sources(const model& mod, const parameter_loader& mpl,
}
}
/* Field must be either 'field' or 'pinned_field'. Too early to use a concept. */
template
<
typename
State
,
typename
Field
>
void
eval_interface_sources_new
(
const
model
&
mod
,
const
parameter_loader
&
mpl
,
State
&
state
,
Field
&
srcfield
)
{
auto
&
is
=
mod
.
get_interfaces
();
assert
(
srcfield
.
num_dofs
==
mod
.
num_fluxes
()
);
for
(
auto
&
[
si
,
sd
]
:
is
)
{
const
auto
&
e
=
mod
.
entity_at
(
sd
.
adjacent_volume_entity
);
//auto etag = e.gmsh_tag();
auto
mtag
=
sd
.
gmsh_tag
();
switch
(
mpl
.
interface_type
(
mtag
)
)
{
case
interface_condition
::
UNSPECIFIED
:
case
interface_condition
::
E_FIELD
:
case
interface_condition
::
H_FIELD
:
break
;
case
interface_condition
::
SURFACE_CURRENT
:
{
for
(
auto
&
[
local
,
global
]
:
sd
.
face_numbers
)
{
vec3d
n
=
state
.
eds
[
e
.
number
()].
normals
.
row
(
local
);
auto
fJ
=
[
&
](
const
point_3d
&
pt
)
->
vec3d
{
vec3d
J
=
mpl
.
eval_interface_source
(
mtag
,
pt
,
state
.
curr_time
);
return
n
.
cross
(
J
);
};
matxd
prjJ
=
e
.
project_on_face
(
local
,
fJ
);
auto
num_bf
=
prjJ
.
rows
();
srcfield
.
Hx
.
segment
(
global
*
num_bf
,
num_bf
)
=
prjJ
.
col
(
0
);
srcfield
.
Hy
.
segment
(
global
*
num_bf
,
num_bf
)
=
prjJ
.
col
(
1
);
srcfield
.
Hz
.
segment
(
global
*
num_bf
,
num_bf
)
=
prjJ
.
col
(
2
);
}
}
break
;
/* case interface_condition::SURFACE_CURRENT */
}
}
}
#ifdef USE_MPI
std
::
vector
<
double
>
compute_cell_ranks
(
const
model
&
);
#endif
/* USE_MPI */
...
...
This diff is collapsed.
Click to expand it.
src/libgmshdg/gmsh_io.cpp
+
2
−
2
View file @
dbd3868a
...
...
@@ -576,10 +576,10 @@ model::map_boundaries_new(void)
sd
.
sort
();
}
//
std::cout << "Interfaces:" << std::endl;
std
::
cout
<<
"Interfaces:"
<<
std
::
endl
;
for
(
auto
&
[
si
,
sd
]
:
interfaces
)
{
//
std::cout << si << " " << sd.face_numbers.size() << std::endl;
std
::
cout
<<
si
<<
" "
<<
sd
.
face_numbers
.
size
()
<<
std
::
endl
;
sd
.
sort
();
}
}
...
...
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