39 #include "../Rocsurf/test/IM_Reader.h"
61 cout <<
"Usage: " << argv[0] <<
" <surffile> <controlfile>" << std::endl;
69 steps(0), interval(0) {}
110 is.get( buf, 255,
':');
111 if ( buf[0] ==
'\0') { is.getline( buf, 255);
continue; }
113 istringstream istr(buf);
114 string keyword; istr >> keyword;
115 is.getline( buf, 255,
':');
117 if ( keyword ==
"method")
119 else if ( keyword ==
"wavefrontal")
121 else if ( keyword ==
"normaldif")
123 else if ( keyword ==
"eigthres")
125 else if ( keyword ==
"courant")
127 else if ( keyword ==
"fangle")
129 else if ( keyword ==
"smoother")
131 else if ( keyword ==
"rediter")
133 else if ( keyword ==
"perturb")
135 else if ( keyword ==
"speed")
137 else if ( keyword ==
"sploc")
139 else if ( keyword ==
"timestep")
141 else if ( keyword ==
"steps")
143 else if ( keyword ==
"interval")
145 else if ( keyword ==
"verbose")
148 std::cerr <<
"Unknow keyword " << keyword << std::endl;
149 is.getline( buf, 255);
152 if (
rank==0) std::cout <<
" speed is " << cp.
speed << std::endl;
158 if ( !cntr_param.
method.empty()) {
161 if (
rank==0) std::cout <<
"Set propagation method to " << cntr_param.
method << std::endl;
166 if (
rank==0) std::cout <<
"Set wavefrontal to " << cntr_param.
wavefrontal << std::endl;
171 if (
rank==0) std::cout <<
"Set normaldif to " << cntr_param.
normaldif << std::endl;
174 if ( !cntr_param.
eigthres.empty()) {
176 if (
rank==0) std::cout <<
"Set eigthres to " << cntr_param.
eigthres << std::endl;
179 if ( !cntr_param.
courant.empty()) {
181 if (
rank==0) std::cout <<
"Set courant constant to " << cntr_param.
courant << std::endl;
184 if ( !cntr_param.
fangle.empty()) {
186 if (
rank==0) std::cout <<
"Set feature angle to " << cntr_param.
fangle << std::endl;
189 if ( !cntr_param.
smoother.empty()) {
191 if (
rank==0) std::cout <<
"Set smoother to " << cntr_param.
smoother << std::endl;
194 if ( !cntr_param.
rediter.empty()) {
196 if (
rank==0) std::cout <<
"Set rediter to " << cntr_param.
rediter << std::endl;
199 if ( !cntr_param.
verbose.empty()) {
202 if (
rank==0) std::cout <<
"Set verbose level to " << cntr_param.
verbose << std::endl;
209 if (
rank==0) cout <<
"Reading surface mesh file \"" << fname <<
'"' << endl;
211 std::string fname_str(fname);
213 std::string::size_type pos = fname_str.find_first_of(
".");
214 const string wname = fname_str.substr( 0, pos);
216 if (
rank==0) cout <<
"Creating window \"" << wname <<
'"' << endl;
227 static int BLAS_copy_scalar=0, cnstr_handle, MAP_maxabs;
229 if ( BLAS_copy_scalar==0) {
240 COM_get_array( (wname+
".cnstr_types").c_str(), 2, (
void**)&cnstr_types);
242 MAP::Vector_3<double> *coors;
249 for (
int j=0;
j<nnodes; ++
j) {
250 cnstr_types[
j] =
'x';
261 static int BLAS_copy_scalar=0, cnstr_handle, MAP_maxabs;
263 if ( BLAS_copy_scalar==0) {
274 COM_get_array( (wname+
".cnstr_types").c_str(), 3, (
void**)&cnstr_types);
276 MAP::Vector_3<double> *coors;
283 for (
int j=0;
j<nnodes; ++
j) {
284 if ( coors[
j].
x() <= 1.e-10 || coors[
j].
x() > 0.047624)
287 cnstr_types[
j] =
'x';
298 static int BLAS_copy_scalar=0, cnstr_handle, MAP_maxabs;
300 if ( BLAS_copy_scalar==0) {
310 COM_get_array( (wname+
".cnstr_types").c_str(), 2, (
void**)&cnstr_types);
312 MAP::Vector_3<double> *coors;
319 for (
int j=0;
j<nnodes; ++
j) {
320 if ( coors[
j].
y() > -20.054 || coors[
j].
x() < -20.5538)
321 cnstr_types[
j] = -
'y';
362 const double pi = 3.14159265358979;
363 for (
int i=0;
i<
n; ++
i) {
365 velocities[3*
i] = pi*(-coors[3*
i+1]);
366 velocities[3*
i+1] = pi*(coors[3*
i]-1.5);
367 velocities[3*
i+2] = 0;
369 double xs[]={pi*coors[3*
i], pi*coors[3*
i+1], pi*coors[3*
i+2]};
379 int *pane_ids, npanes;
382 for (
int i=0;
i<npanes; ++
i) {
397 static int OUT_write = 0, hdl;
407 std::string fname = wname+
"_"+timelevel;
410 else fname.append(
"_");
413 &hdl, (
char*)wname.c_str(), timelevel);
416 int main(
int argc,
char *argv[]) {
446 if (
rank==0) cout <<
"Propagating interface..." << endl;
451 if ( wname.substr(0,6) ==
"acmflu")
453 else if ( wname.substr(0,3) ==
"acm")
455 else if ( wname.substr(0,4) ==
"star")
467 std::sprintf(fname,
"timedata_%03d.txt",
rank);
469 for (
int i=1;
i<=cntr_param.
steps; ++
i) {
470 if (
rank==0) cout <<
"Step " <<
i << endl;
481 std::sprintf( steps,
"%05d",
i);
int COMMPI_Comm_rank(MPI_Comm c)
here we put it at the!beginning of the common block The point to point and collective!routines know about but MPI_TYPE_STRUCT as yet does not!MPI_STATUS_IGNORE and MPI_STATUSES_IGNORE are similar objects!Until the underlying MPI library implements the C version of these are declared as arrays of MPI_STATUS_SIZE!The types and are OPTIONAL!Their values are zero if they are not available Note that!using these reduces the portability of MPI_IO INTEGER MPI_BOTTOM INTEGER MPI_DOUBLE_PRECISION INTEGER MPI_LOGICAL INTEGER MPI_2REAL INTEGER MPI_2DOUBLE_COMPLEX INTEGER MPI_LB INTEGER MPI_WTIME_IS_GLOBAL INTEGER MPI_COMM_WORLD
void init_constraints_acmfrac(const string &wname)
void int int REAL REAL * y
#define COM_assertion_msg(EX, msg)
void COM_set_size(const char *wa_str, int pane_id, int size, int ng=0)
Set sizes of for a specific attribute.
This file contains the prototypes for Roccom API.
void COM_get_array(const char *wa_str, int pane_id, void **addr, int *strd, int *cap)
Get the address for an attribute on a specific pane.
int COM_get_attribute_handle(const char *waname)
void init_parameters(const Control_parameter &cntr_param)
std::string read_in_mesh(const char *fname)
void COM_print_profile(const char *fname, const char *header)
void COM_set_profiling_barrier(int hdl, MPI_Comm comm)
void COM_window_init_done(const char *w_str, int pane_changed=true)
This file contains a set of routines for error assertion.
void COM_get_size(const char *wa_str, int pane_id, int *size, int *ng=0)
Get the sizes of an attribute.
void init_constraints_acmflu(const string &wname)
void print_usage(int argc, char *argv[])
void COM_set_profiling(int i)
void COM_call_function(const int wf, int argc,...)
int main(int argc, char *argv[])
void COM_init(int *argc, char ***argv)
void init_speed_arrays(const double *coors, double *velocities, int n)
void init_speed(const string &wname)
void COM_new_attribute(const char *wa_str, const char loc, const int type, int ncomp, const char *unit)
Registering an attribute type.
void COM_get_panes(const char *wname, std::vector< int > &pane_ids, int rank=-2)
void COM_free_buffer(int **buf)
void init_constraints_starslice(const string &wname, const Control_parameter &cntr_param)
int read_winmesh(const char *fname, const std::string &wname, bool del=true)
double output_solution(const string &wname, const char *timelevel, double ref=0.)
void init_attributes(const string &wname, const Control_parameter &cntr_param)
#define COM_LOAD_MODULE_STATIC_DYNAMIC(moduleName, windowString)
void COM_resize_array(const char *wa_str, int pane_id=0, void **addr=NULL, int strd=-1, int cap=0)
Resize an attribute on a specific pane and return the address by setting addr.
int COM_get_function_handle(const char *wfname)
void read_control_file(const char *fname, Control_parameter &cp)
#define COM_EXTERN_MODULE(moduleName)