w05-g03-matrix-assembly-function
Matrix Assembly Function
Basics
Before starting with your assignment, please go through the following basic exercises:
- w05-bsc-functions-1 #10 (closed)
- w05-bsc-functions-2 #11 (closed)
Objective
The overall objective of this assignment is to implement the matrix assembly part of the Direct Stiffness Method in various functions. Specifically, the code needs to be split into meaningful subparts and implemented in functions.
The underlying method for matrix assembly is described in the issue for w03-02-matrix-assembly
.
Implementation
-
Use the file named
matrix_assembly_function.cpp
as a starting point which is provided in thetehpc/basics/
directory. -
Include the header file
matrices_operations.h
at the top ofmatrix_assembly_function.cpp
. -
Follow the comments given in the file and implement the missing part of the code as instructed. You may use the code implemented in
tehpc/basics/matrix_assembly.cpp
. You may want to use functions provided inmatrices_operations.h
. -
Make sure that your code is well structured and commented.
Notes:
Compile and run your code by:
- going into the
tehpc/build/
folder - copy
tehpc/basics/matrices_operations.h
into thebuild
folder. - compile with the following command:
g++ -Werror -Wpedantic -g -o matrix_assembly_function ../basics/matrix_assembly_function.cpp
- run code with
./matrix_assembly_function