zer011b / fdtd3d

fdtd3d is an open source 1D, 2D, 3D FDTD electromagnetics solver with MPI, OpenMP and CUDA support for x64, ARM, ARM64, RISC-V, PowerPC, Wasm architectures
GNU General Public License v2.0
126 stars 33 forks source link

FieldPointValue and some other functions are not defined when compiling #196

Closed YouthTIAN closed 7 months ago

YouthTIAN commented 7 months ago

It seems that there is a lack of FieldPoint.h and FieldPoint.cpp file in the fdtd3d/Source/Kernels folder that causes errors during compilation.

zer011b commented 7 months ago

Please share your build commands and full build logs with errors

YouthTIAN commented 7 months ago

My build commands: cmake . . -DCMAKE_BUILD_TYPE=Debug -DSOLVER_DIM_MODES=DIM3 -DVALUE_TYPE=d -DCOMPLEX_FIELD_VALUES=OFF -DPARALLEL_GRID_DIMENSION=3 -DPRINT_MESSAGE=ON -DPARALLEL_GRID=ON -DPARALLEL_BUFFER_DIMENSION=xyz -DCUDA_ENABLED=OFF -DLARGE_COORDINATES=OFF -DCMAKE_CXX_COMPILER=g++

Full build logs with errors: [ 2%] Built target EasyBMP [ 5%] Built target Coordinate [ 8%] Built target Kernels [ 14%] Built target Layout [ 16%] Built target Helpers [ 19%] Built target Settings [ 36%] Built target Grid [ 40%] Built target InternalScheme [ 50%] Built target FM [ 54%] Built target Loader [ 59%] Built target Dumper [ 63%] Built target Scheme [ 66%] Built target fdtd3d [ 69%] Built target fdtd3d-convert [ 71%] Built target unit-test-settings [ 74%] Built target unit-test-clock [ 77%] Built target unit-test-parallel-grid [ 78%] Building CXX object Source/UnitTests/CMakeFiles/perf-test-parallel-grid.dir/perf-test-parallel-grid.cpp.o /home/fdtd3d/Source/UnitTests/perf-test-parallel-grid.cpp: In function ‘int main(int, char)’: /home/fdtd3d/Source/UnitTests/perf-test-parallel-grid.cpp:124:80: error: no matching function for call to ‘ParallelGrid::ParallelGrid(GridCoordinate3D&, GridCoordinate3D&, int, GridCoordinate3D)’ 124 | ParallelGrid grid (overallSize, bufferSize, 0, yeeLayout.getSizeForCurNode ()); | ^ In file included from /home/fdtd3d/Source/UnitTests/perf-test-parallel-grid.cpp:33: /home/fdtd3d/Source/Grid/ParallelGrid.h:255:3: note: candidate: ‘ParallelGrid::ParallelGrid(const GridCoordinate3D&, const GridCoordinate3D&, time_step, const GridCoordinate3D&, int, int, const char)’ 255 | ParallelGrid (const ParallelGridCoordinate &, | ^~~~ /home/fdtd3d/Source/Grid/ParallelGrid.h:255:3: note: candidate expects 7 arguments, 4 provided /home/fdtd3d/Source/UnitTests/perf-test-parallel-grid.cpp:136:5: error: ‘FieldPointValue’ was not declared in this scope; did you mean ‘FieldValue’? 136 | FieldPointValue val; | ^~~~~~~ | FieldValue /home/fdtd3d/Source/UnitTests/perf-test-parallel-grid.cpp:141:5: error: ‘val’ was not declared in this scope 141 | val.setCurValue (FieldValue (i PhysicsConst::Eps0)); | ^~~ /home/fdtd3d/Source/UnitTests/perf-test-parallel-grid.cpp:166:10: error: ‘class ParallelGrid’ has no member named ‘setFieldPointValue’; did you mean ‘setFieldValue’? 166 | grid.setFieldPointValue (val, pos); | ^~~~~~ | setFieldValue /home/fdtd3d/Source/UnitTests/perf-test-parallel-grid.cpp:224:9: error: ‘FieldPointValue’ was not declared in this scope; did you mean ‘FieldValue’? 224 | FieldPointValue value = grid.getFieldPointValue (pos); | ^~~~~~~ | FieldValue /home/fdtd3d/Source/UnitTests/perf-test-parallel-grid.cpp:224:26: error: ‘value’ was not declared in this scope; did you mean ‘FPValue’? 224 | FieldPointValue value = grid.getFieldPointValue (pos); | ^~~~~ | FPValue /home/fdtd3d/Source/UnitTests/perf-test-parallel-grid.cpp:224:39: error: ‘class ParallelGrid’ has no member named ‘getFieldPointValue’; did you mean ‘getFieldValue’? 224 | FieldPointValue value = grid.getFieldPointValue (pos); | ^~~~~~ | getFieldValue /home/fdtd3d/Source/UnitTests/perf-test-parallel-grid.cpp:252:33: error: base operand of ‘->’ has non-pointer type ‘ParallelGrid’ 252 | grid.shiftInTime (zero, grid->getSize ()); | ^~ /home/fdtd3d/Source/UnitTests/perf-test-parallel-grid.cpp:254:5: error: expected ‘,’ or ‘;’ before ‘group’ 254 | group->nextShareStep (); | ^~~~~ make[2]: [Source/UnitTests/CMakeFiles/perf-test-parallel-grid.dir/build.make:76: Source/UnitTests/CMakeFiles/perf-test-parallel-grid.dir/perf-test-parallel-grid.cpp.o] Error 1 make[1]: [CMakeFiles/Makefile2:849: Source/UnitTests/CMakeFiles/perf-test-parallel-grid.dir/all] Error 2 make: [Makefile:91: all] Error 2

Thank you!

zer011b commented 7 months ago

This is somewhat intentional (though I agree that a bit inconvenient), because make build command builds all targets, including all unit-tests, etc. Test perf-test-parallel-grid is unfinished yet, so it shouldn't be built. Please just use make fdtd3d, fdtd3d is the main binary.

YouthTIAN commented 7 months ago

Thanks a lot.

zer011b commented 7 months ago

Feel free to reopen if you have any more question