Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
catalyst_adapter
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ICON ComIn
plugins
catalyst_adapter
Commits
43f00580
Commit
43f00580
authored
10 months ago
by
Nils-Arne Dreier
Browse files
Options
Downloads
Patches
Plain Diff
add mpi_rank and decomp_domain variables
parent
d9491eb6
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
catalyst_adapter.cpp
+22
-1
22 additions, 1 deletion
catalyst_adapter.cpp
with
22 additions
and
1 deletion
catalyst_adapter.cpp
+
22
−
1
View file @
43f00580
...
...
@@ -79,6 +79,7 @@ void catalyst_adapter_secondary_constructor(){
}
channel
[
"data/topologies/mesh/elements/connectivity"
].
set
(
vidx
);
// add all 2d variables
for
(
void
*
it
=
comin_var_get_descr_list_head
();
it
!=
nullptr
;
it
=
comin_var_get_descr_list_next
(
it
)){
...
...
@@ -88,6 +89,7 @@ void catalyst_adapter_secondary_constructor(){
comin_metadata_get_integer
(
var_desc
,
"zaxis_id"
,
&
zaxis_id
,
&
ierr
);
if
(
var_desc
.
id
==
jg
&&
zaxis_id
==
COMIN_ZAXIS_2D
){
// TODO split tracers in separate arrays
channel
[
"data/fields/"
+
std
::
string
(
var_desc
.
name
)
+
"/association"
]
=
"element"
;
channel
[
"data/fields/"
+
std
::
string
(
var_desc
.
name
)
+
"/topology"
]
=
"mesh"
;
channel
[
"data/fields/"
+
std
::
string
(
var_desc
.
name
)
+
"/volume_dependend"
]
=
false
;
...
...
@@ -97,6 +99,22 @@ void catalyst_adapter_secondary_constructor(){
.
set_external
(
comin_var_get_ptr
(
handle
),
ncells
);
}
}
// add some special fields
channel
[
"data/fields/mpi_rank/association"
]
=
"element"
;
channel
[
"data/fields/mpi_rank/topology"
]
=
"mesh"
;
channel
[
"data/fields/mpi_rank/volume_dependend"
]
=
false
;
channel
[
"data/fields/mpi_rank/values"
]
.
set
(
std
::
vector
<
int
>
(
ncells
,
comin_parallel_get_host_mpi_rank
()));
channel
[
"data/fields/decomp_domain/association"
]
=
"element"
;
channel
[
"data/fields/decomp_domain/topology"
]
=
"mesh"
;
channel
[
"data/fields/decomp_domain/volume_dependend"
]
=
false
;
int
*
decomp_domain_ptr
=
nullptr
;
int
arr_size2
[
2
];
comin_descrdata_get_domain_cells_decomp_domain
(
jg
,
&
decomp_domain_ptr
,
arr_size2
);
channel
[
"data/fields/decomp_domain/values"
]
.
set_external
(
decomp_domain_ptr
,
ncells
);
}
}
...
...
@@ -104,9 +122,12 @@ void catalyst_adapter_execute(){
static
int64_t
cycle
=
0
;
catalyst_exec_params
[
"catalyst/state/cycle"
]
=
cycle
;
catalyst_exec_params
[
"catalyst/state/time"
]
=
cycle
;
static
double
dt
=
comin_descrdata_get_timesteplength
(
1
);
// TODO jg=1?!
catalyst_exec_params
[
"catalyst/state/time"
]
=
cycle
*
dt
;
cycle
++
;
// TODO: update pointers of time dependend variables
enum
catalyst_status
err
=
catalyst_execute
(
conduit_cpp
::
c_node
(
&
catalyst_exec_params
));
if
(
err
!=
catalyst_status_ok
)
{
...
...
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