Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
wenqing
ogs
Commits
e5e6d5d4
Commit
e5e6d5d4
authored
8 years ago
by
Christoph Lehmann
Browse files
Options
Downloads
Patches
Plain Diff
[PL] documented VectorMatrixAssembler
parent
a3ba8180
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ProcessLib/VectorMatrixAssembler.cpp
+3
-1
3 additions, 1 deletion
ProcessLib/VectorMatrixAssembler.cpp
ProcessLib/VectorMatrixAssembler.h
+12
-1
12 additions, 1 deletion
ProcessLib/VectorMatrixAssembler.h
with
15 additions
and
2 deletions
ProcessLib/VectorMatrixAssembler.cpp
+
3
−
1
View file @
e5e6d5d4
...
@@ -96,7 +96,9 @@ void VectorMatrixAssembler::assembleWithJacobian(
...
@@ -96,7 +96,9 @@ void VectorMatrixAssembler::assembleWithJacobian(
MathLib
::
toMatrix
(
_local_Jac_data
,
num_r_c
,
num_r_c
);
MathLib
::
toMatrix
(
_local_Jac_data
,
num_r_c
,
num_r_c
);
Jac
.
add
(
r_c_indices
,
local_Jac
);
Jac
.
add
(
r_c_indices
,
local_Jac
);
}
else
{
}
else
{
OGS_FATAL
(
"No Jacobian has been assembled!"
);
OGS_FATAL
(
"No Jacobian has been assembled! This might be due to programming "
"errors in the local assembler of the current process."
);
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
ProcessLib/VectorMatrixAssembler.h
+
12
−
1
View file @
e5e6d5d4
...
@@ -23,18 +23,26 @@ namespace ProcessLib
...
@@ -23,18 +23,26 @@ namespace ProcessLib
{
{
class
LocalAssemblerInterface
;
class
LocalAssemblerInterface
;
//! Utility class used to assemble global matrices and vectors.
//!
//! The methods of this class get the global matrices and vectors as input and
//! pass only local data on to the local assemblers.
class
VectorMatrixAssembler
final
class
VectorMatrixAssembler
final
{
{
public:
public:
VectorMatrixAssembler
(
explicit
VectorMatrixAssembler
(
std
::
unique_ptr
<
AbstractJacobianAssembler
>&&
jacobian_assembler
);
std
::
unique_ptr
<
AbstractJacobianAssembler
>&&
jacobian_assembler
);
//! Assembles\c M, \c K, and \c b.
//! \remark Jacobian is not assembled here, see assembleWithJacobian().
void
assemble
(
std
::
size_t
const
mesh_item_id
,
void
assemble
(
std
::
size_t
const
mesh_item_id
,
LocalAssemblerInterface
&
local_assembler
,
LocalAssemblerInterface
&
local_assembler
,
NumLib
::
LocalToGlobalIndexMap
const
&
dof_table
,
NumLib
::
LocalToGlobalIndexMap
const
&
dof_table
,
double
const
t
,
GlobalVector
const
&
x
,
GlobalMatrix
&
M
,
double
const
t
,
GlobalVector
const
&
x
,
GlobalMatrix
&
M
,
GlobalMatrix
&
K
,
GlobalVector
&
b
);
GlobalMatrix
&
K
,
GlobalVector
&
b
);
//! Assembles \c M, \c K, \c b, and the Jacobian \c Jac of the residual.
//! \note The Jacobian must be assembled.
void
assembleWithJacobian
(
std
::
size_t
const
mesh_item_id
,
void
assembleWithJacobian
(
std
::
size_t
const
mesh_item_id
,
LocalAssemblerInterface
&
local_assembler
,
LocalAssemblerInterface
&
local_assembler
,
NumLib
::
LocalToGlobalIndexMap
const
&
dof_table
,
NumLib
::
LocalToGlobalIndexMap
const
&
dof_table
,
...
@@ -45,11 +53,14 @@ public:
...
@@ -45,11 +53,14 @@ public:
GlobalMatrix
&
Jac
);
GlobalMatrix
&
Jac
);
private:
private:
// temporary data only stored here in order to avoid frequent memory
// reallocations.
std
::
vector
<
double
>
_local_M_data
;
std
::
vector
<
double
>
_local_M_data
;
std
::
vector
<
double
>
_local_K_data
;
std
::
vector
<
double
>
_local_K_data
;
std
::
vector
<
double
>
_local_b_data
;
std
::
vector
<
double
>
_local_b_data
;
std
::
vector
<
double
>
_local_Jac_data
;
std
::
vector
<
double
>
_local_Jac_data
;
//! Used to assemble the Jacobian.
std
::
unique_ptr
<
AbstractJacobianAssembler
>
_jacobian_assembler
;
std
::
unique_ptr
<
AbstractJacobianAssembler
>
_jacobian_assembler
;
};
};
...
...
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