-
Notifications
You must be signed in to change notification settings - Fork 5
Implement postprocess #84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
@tsarikahin can you please describe with a few words what the proposed changes do? |
@@ -21,10 +21,11 @@ | |||
#include "mirco_nonlinearsolver.h" | |||
|
|||
|
|||
void MIRCO::Evaluate(double& pressure, double Delta, double LateralLength, double GridSize, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will break the MIRCO integration in BACI. @tsarikahin please have a look together with @RShaw026 to assess the effect of this changes also on the BACI integration. If you make a change that breaks the API for BACI, then you need to also bring those changes to BACI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I already talked to Rishav about that and he mentioned all those challenges. But I believe it is a necessary step for the future since in mirco_evaluate
, no information is returned to the main file.
@RShaw026 it should be fine now. |
@tsarikahin Thanks Tarik. Since I need this interface for the Evaluate call in BACI, I will be making slight changes in this branch, and then we can go ahead with the merge request. |
|
||
const auto start = std::chrono::high_resolution_clock::now(); | ||
// following function generates the actual path of the output file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// following function generates the actual path of the output file. | |
// Generate the <...> path to the output file |
... replace <...>
with absolute or relative.
// Initialise Pressure | ||
double pressure = 0.0; | ||
// Number of contact points | ||
int nf = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nf
is not a great name for a variable. Why not num_contact_points
? Then, one does not need a comment to explain it.
// Number of contact points | ||
int nf = 0; | ||
// Coordinates of the points in contact in the last iteration. | ||
std::vector<double> xvf, yvf; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not great variabel names
// Coordinates of the points in contact in the last iteration. | ||
std::vector<double> xvf, yvf; | ||
// Contact force at (xvf,yvf) calculated in the last iteration. | ||
std::vector<double> pf; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a great name for a variable.
#include <numeric> | ||
#include <vector> | ||
|
||
long findClosestIndex(const std::vector<double>& sorted_array, double x) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need the long
type or would int
be sufficient?
// std::cout << ix << "\t" << iy << std::endl; | ||
// std::cout << xvf[i] << "\t" << yvf[i] << "\t" << pf[i] << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// std::cout << ix << "\t" << iy << std::endl; | |
// std::cout << xvf[i] << "\t" << yvf[i] << "\t" << pf[i] << std::endl; |
|
||
// Calculate average pressure via total force | ||
auto totalForce = std::accumulate(pf.begin(), pf.end(), 0.0); | ||
double pressure = totalForce / pow(LateralLength, 2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
double pressure = totalForce / pow(LateralLength, 2); | |
const double pressure = totalForce / pow(LateralLength, 2); |
} | ||
outputForceFile.close(); | ||
|
||
// Calculate average pressure via total force |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Calculate average pressure via total force | |
// Calculate average pressure from total force |
Description
In this MR followings are aimed:
mirco_evaluate
to return necessary variables, contact force, coordinates, and so onInterested Parties / Possible Reviewers
@RShaw026 @isteinbrecher