Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
fwi
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
fwi
Commits
51831e69
Commit
51831e69
authored
1 year ago
by
Boris Martin
Browse files
Options
Downloads
Patches
Plain Diff
added line acquisition .pos loading
parent
cb3157fe
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
specific/configuration/line_acquisition.cpp
+51
-28
51 additions, 28 deletions
specific/configuration/line_acquisition.cpp
with
51 additions
and
28 deletions
specific/configuration/line_acquisition.cpp
+
51
−
28
View file @
51831e69
...
...
@@ -163,43 +163,66 @@ namespace line_acquisition
*/
_mb
.
resize
(
model_size
());
_mi
.
resize
(
model_size
());
for
(
unsigned
int
c
=
0
;
c
<
model_size
();
c
++
)
{
double
Remb
,
Immb
;
if
(
!
(
gmshFem
.
userDefinedParameter
(
Remb
,
"Re(mbc"
+
std
::
to_string
(
c
)
+
")"
)
&&
gmshFem
.
userDefinedParameter
(
Immb
,
"Im(mbc"
+
std
::
to_string
(
c
)
+
")"
)
)
)
std
::
string
m0_type
=
"constant"
;
std
::
string
suffix
=
"c"
+
std
::
to_string
(
c
);
if
(
!
gmshFem
.
userDefinedParameter
(
m0_type
,
"m0_type"
+
suffix
))
{
throw
common
::
Exception
(
"Background (reference) model parameter (component"
+
std
::
to_string
(
c
)
+
") could not be found."
)
;
msg
::
warning
<<
"No value of m0_type"
<<
suffix
<<
" found. Using constant (per inclusion) by default."
<<
msg
::
endl
;
}
else
if
(
m0_type
==
"constant"
)
{
_mb
[
c
]
=
Remb
+
im
*
Immb
;
_mc
[
c
]
=
_mb
[
c
];
}
ScalarPiecewiseFunction
<
std
::
complex
<
double
>
>
m0
;
m0
.
addFunction
(
_mb
[
c
],
_background
[
Support
::
BLK
]
|
_background
[
Support
::
BND
]
|
_points
);
double
Remb
,
Immb
;
if
(
!
(
gmshFem
.
userDefinedParameter
(
Remb
,
"Re(mbc"
+
std
::
to_string
(
c
)
+
")"
)
&&
gmshFem
.
userDefinedParameter
(
Immb
,
"Im(mbc"
+
std
::
to_string
(
c
)
+
")"
)))
{
throw
common
::
Exception
(
"Background (reference) model parameter (component"
+
std
::
to_string
(
c
)
+
") could not be found."
);
}
else
{
_mb
[
c
]
=
Remb
+
im
*
Immb
;
_mc
[
c
]
=
_mb
[
c
];
}
ScalarPiecewiseFunction
<
std
::
complex
<
double
>>
m0
;
m0
.
addFunction
(
_mb
[
c
],
_background
[
Support
::
BLK
]
|
_background
[
Support
::
BND
]
|
_points
);
_mi
[
c
].
resize
(
_ni
);
for
(
unsigned
int
i
=
0
;
i
<
_ni
;
i
++
)
{
double
Remi
=
0.
,
Immi
=
0.
;
if
(
!
(
gmshFem
.
userDefinedParameter
(
Remi
,
"Re(mi"
+
std
::
to_string
(
i
)
+
"c"
+
std
::
to_string
(
c
)
+
")"
)
&&
gmshFem
.
userDefinedParameter
(
Immi
,
"Im(mi"
+
std
::
to_string
(
i
)
+
"c"
+
std
::
to_string
(
c
)
+
")"
))
)
_mi
[
c
].
resize
(
_ni
);
for
(
unsigned
int
i
=
0
;
i
<
_ni
;
i
++
)
{
double
Remi
=
0.
,
Immi
=
0.
;
if
(
!
(
gmshFem
.
userDefinedParameter
(
Remi
,
"Re(mi"
+
std
::
to_string
(
i
)
+
"c"
+
std
::
to_string
(
c
)
+
")"
)
&&
gmshFem
.
userDefinedParameter
(
Immi
,
"Im(mi"
+
std
::
to_string
(
i
)
+
"c"
+
std
::
to_string
(
c
)
+
")"
)))
{
throw
Exception
(
"Inclusion model parameter could not be found."
);
}
_mi
[
c
][
i
]
=
Remi
+
im
*
Immi
;
m0
.
addFunction
(
_mi
[
c
][
i
],
_inclusion
[
i
]);
}
_m0
.
push_back
(
m0
);
}
else
if
(
m0_type
==
"file.pos"
)
{
std
::
string
path
=
""
;
if
(
!
gmshFem
.
userDefinedParameter
(
path
,
"m0_path"
+
suffix
))
{
throw
Exception
(
"
Inclusion model parameter
could not be found."
);
throw
common
::
Exception
(
"
Path to subsurface data
could not be found."
);
}
_mi
[
c
][
i
]
=
Remi
+
im
*
Immi
;
m0
.
addFunction
(
_mi
[
c
][
i
],
_inclusion
[
i
]);
gmsh
::
merge
(
path
+
suffix
+
".pos"
);
// Fix for weird tags when loading .pos files.
std
::
vector
<
int
>
tags
;
gmsh
::
view
::
getTags
(
tags
);
auto
view
=
tags
.
back
();
ScalarFunction
<
std
::
complex
<
double
>>
mpos
=
probeScalarView
<
std
::
complex
<
double
>>
(
view
);
_m0
.
push_back
(
mpos
);
}
else
{
throw
Exception
(
"Invalid model type: "
+
m0_type
);
}
_m0
.
push_back
(
m0
);
}
}
void
Configuration
::
mesh
()
const
...
...
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